function loadSpecifics()
{ 
	ajaxMakeRequest('scripts/php/events_list.php', 	'mobounce_nav_events');
	ajaxMakeRequest('scripts/php/counter.php', 		'mobounce_visitors');
	closetabs();
}

function navMouseOver(imgID) 
{
	if (imgID == 'navHome')
		document.getElementById(imgID).src='images/button_home_mo.jpg';
	if (imgID == 'navStudio')
		document.getElementById(imgID).src='images/button_studio_mo.jpg';
	if (imgID == 'navEvents')
		document.getElementById(imgID).src='images/button_events_mo.jpg';
	if (imgID == 'navContact')
		document.getElementById(imgID).src='images/button_contact_mo.jpg';
	if (imgID == 'navAbout')
		document.getElementById(imgID).src='images/button_about_mo.jpg';
	if (imgID == 'navWebDesigner')
		document.getElementById(imgID).src='images/button_webdesign_mo.jpg';
}

function navMouseOut(imgID) 
{
	if (imgID == 'navHome')
		document.getElementById(imgID).src='images/button_home.jpg';
	if (imgID == 'navStudio')
		document.getElementById(imgID).src='images/button_studio.jpg';
	if (imgID == 'navEvents')
		document.getElementById(imgID).src='images/button_events.jpg';
	if (imgID == 'navContact')
		document.getElementById(imgID).src='images/button_contact.jpg';
	if (imgID == 'navAbout')
		document.getElementById(imgID).src='images/button_about.jpg';
	if (imgID == 'navWebDesigner')
		document.getElementById(imgID).src='images/button_webdesign.jpg';
}



function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function StopFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject("Revolt");
	flashMovie.StopPlay();
}

function PlayFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

function RewindFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	flashMovie.Rewind();
}

function NextFrameFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	// 4 is the index of the property for _currentFrame
	var currentFrame=flashMovie.TGetProperty("/", 4);
	var nextFrame=parseInt(currentFrame);
	if (nextFrame>=10)
		nextFrame=0;
	flashMovie.GotoFrame(nextFrame);		
}


function ZoominFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	flashMovie.Zoom(90);
}

function ZoomoutFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	flashMovie.Zoom(110);
}


function SendDataToFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	flashMovie.SetVariable("/:message", document.controller.Data.value);
}

function ReceiveDataFromFlashMovie(flashID)
{
	var flashMovie=getFlashMovieObject(flashID);
	var message=flashMovie.GetVariable("/:message");
	document.controller.Data.value=message;
}

function iFrame_init(iFrame) 
{
    var iframeEl = document.getElementById(iFrame);
    if (iframeEl && iframeEl.parentNode && document.createElement) 
	{
		var table_iFrame = getIFrameElementById(iFrame, 'mobounce_content_iframe');
		document.getElementById('mobounce_info').style.height = table_iFrame.offsetHeight + "px";			
	}
}


function getIFrameElementById(iFrame, ifrmElement)
{
	var iframeEl = document.getElementById(iFrame);
	if (iframeEl.contentDocument) 
	{ 
		var frmChild = iframeEl.contentDocument.getElementById(ifrmElement);
	} 
	else if (iframeEl.contentWindow) 
	{
		var frmChild = iframeEl.contentWindow.document.getElementById(ifrmElement);
	}

	return frmChild;
}


function navToggle(tbleObj)  
{	
    if (document.getElementById(tbleObj).style.display == 'none') 
        document.getElementById(tbleObj).style.display = "";
    else 
       document.getElementById(tbleObj).style.display = "none";         
}

function closetabs(tbleObj)  
{	
	navToggle('mobounce_nav_studio');
	navToggle('mobounce_nav_events');
}


function DisplayImage(ifile,ix,iy,ititle) 
{ 
	var win;
	var sWidth;
	var sHeight;
	var NS = (document.layers) ? 1 : 0;
	win = window.open("", "imageviewer", "width="+ix+", height="+iy+", menubar=no, toolbar=no");
	if (NS) 
	{
		sWidth = win.innerWidth;
		sHeight = win.innerHeight;
	} 
	else 
	{
		sWidth = win.document.body.clientWidth;
		sHeight = win.document.body.clientHeight;
	}
	if (sWidth!=ix || sHeight!=iy) 
	{
		win.close();
		setTimeout("DisplayImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
		return;
	}
	win.document.open();
	win.document.write("<html><head><title>"+ititle+"</title>");
	win.document.write("</head><body>");
	win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
	win.document.write("<img src="+ifile+"></div></body></html>");
	win.document.close();
}

function Directories()
{
	 directory = document.location.pathname;
                  
     directories = new Array();
                           
     do {
			// Creates an array with all the parent folders
         	// of the file where this function is called.
          	last_slash = directory.lastIndexOf('/');
         
          	if(last_slash != false)
          	{              
          		directory = directory.substr(0, last_slash);                             
           		directories[directories.length] = directory;                            
          	}
                                                         
         } while(last_slash != false);
         
        return(directories);
}




//
// Returns the width or height of the client (content) area of the browser.
// If returnWidth == true then it will return the width of the content area.
// If returnWidth == false then it will return the height of the content area.
//
function windowSize(returnWidth) 
{
  	var myWidth = 0, myHeight = 0;
  	if (typeof(window.innerWidth) == 'number') 
  	{
    	//Non-IE
    	myWidth = window.innerWidth;
    	myHeight = window.innerHeight;
  	} 
  	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
  	{
    	//IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
  	} 
  	else if (document.body && (document.body.clientWidth || document.body.clientHeight)) 
  	{
    	//IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
  	}
  
  	if (returnWidth == true)
  		return myWidth;
  	else
    	return myHeight;
}


//
// Count the number of entries in an arry
//
Array.prototype.count = function () 
{
	return this.length;
}


//
// This function gets the scroll position with all browsers (Thanks to http://www.softcomplex.com)
//
function browser_scrollTop() 
{
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) 
{
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

//
// Display the progress bar
//
function slideShow_Progressbar(bVis, iPercent)
{
	var hContainer = document.getElementById('slideShow_Progress');
	var hProgress  = document.getElementById('slideShow_Prog_Bar');
	var hText;
	var hFont;
			
	// Hide the flash (mp3 player)
	//var audio = document.getElementById('mobounce_audio_player');
	//audio.style.visibility = 'hidden';

	if (bVis)
	{
		// if 'slideShow_Progress' object does not already exist then create it
		if (!hContainer)
		{										
			// Create progress bar's div container
			hContainer 	= document.createElement('div'); 
			hProgress 	= document.createElement('div'); 
			hText 		= document.createTextNode('Loading...'); 
			hFont 		= document.createElement('font');
			
			// Set the containers 'id' attribute to 'slideShow_Progress'
			hContainer.setAttribute	('id', 'slideShow_Progress'); 
			hProgress.setAttribute	('id', 'slideShow_Prog_Bar'); 
		}
		
		var width 	= 188;
		var height 	= 28;
		var x = (windowSize(true) / 2) - (width / 2);
		var y = (windowSize(false) / 2) - (height / 2) + browser_scrollTop();
	
		// Set the position attributes of the div container
		hContainer.style.width 		= width + "px";
		hContainer.style.height 	= height + "px";
		hContainer.style.left 		= x + "px";
		hContainer.style.top 		= y + "px";
		hContainer.style.zIndex 	= 50;		
		hContainer.style.position 	= "absolute"; 
		hContainer.style.display 	= 'block'; 
		hContainer.style.backgroundImage = "url(" + "/../images/progressbar_bg.gif" + ")";

		// Set the position attributes of the div container
		hProgress.style.width 		= "0px";
		hProgress.style.height 		= (height - 6) + "px";
		hProgress.style.left 		= 3 + "px";
		hProgress.style.top 		= 3 + "px";
		hProgress.style.zIndex 		= 50;		
		hProgress.style.position 	= "absolute"; 
		hProgress.style.display 	= 'block'; 
		hProgress.align 			= 'center';
		hProgress.style.backgroundImage = "url(" + "/../images/progressbar_meter.gif" + ")";

		document.body.appendChild(hContainer);
		hContainer.appendChild(hProgress);

		if (hFont && hText)
		{
			hFont.style.fontSize = 'small';
			hFont.style.color = "white";
			hFont.appendChild(hText);
			hProgress.appendChild(hFont);
		}
	}
	else
	{
		if (hContainer)
			hContainer.style.display = 'none'; // Remove the progress bar
	}
}

//
// Update the progress bar
//
function slideShow_UpdateProgress(iPercent)
{
	var hContainer = document.getElementById('slideShow_Progress');

	if (hContainer)
	{
		var hProgress  = document.getElementById('slideShow_Prog_Bar');
		var hText	   = hProgress.childNodes[0];
		
		// 100% = the main containers width minus 9.
		var iMax   = hContainer.offsetWidth - 6;
		var iWidth = (iPercent / 100) * iMax; 

		hProgress.style.width =  Math.round(iWidth) + "px";		
		hText.innerHTML = Math.round(iPercent) + "%";
	}
}


//
// Create all container objects for the Slide Show
//
function slideShow_Create(idPictures)
{
	// Create the container element
	var hContainer;
	var hPictures;

	// Hide the flash (mp3 player)
	//var audio = document.getElementById('mobounce_audio_player');
	//audio.style.visibility = 'hidden';
		
	// Set the x, y coordinates and the height/width of the div container
	var szI;
	var hImage;
	var width 	= 400;
	var height 	= 400;
	var x = (windowSize(true) / 2) - (width / 2);
  	var y = (windowSize(false) / 2) - (height / 2);
	y = y + browser_scrollTop();
	
	// This will count the number of pictures we need to display
	// then create all of the div and img containers with the appropriate id names, screen positions, and styles
	for (var i = 0; i < slideShow_array.count() - 1; i++)
	{
		if (slideShow_array[i] != 'undefined')
		{
			szI = i;
			
			// If the containers already exist (due to a previous slideShow viewing) then
			//	Don't create the containers just edit the existing ones.										
			if (!document.getElementById(slideShow_id + szI.toString()))
			{														  
				// Create main container and picture (img) elements if they do not exist
				hContainer 	= document.createElement('div'); // Create div container
				hPictures 	= document.createElement('img'); // Create img container
				// Set the containers 'id' attribute to a specified name (i.e: "slideShow0")
				hContainer.setAttribute	('id', slideShow_id + szI.toString());
				hPictures.setAttribute	('id', idPictures + szI.toString());
			}
			else
			{
				hContainer 	= document.getElementById(slideShow_id + szI.toString());	
				hPictures 	= document.getElementById(idPictures + szI.toString());	
			}
			
			// Set the position attributes of the div container
			hContainer.style.width 		= width + "px";
			hContainer.style.height 	= height + "px";
			hContainer.style.left 		= x + "px";
			hContainer.style.top 		= y + "px";
			hContainer.style.zIndex 	= 50;		
			// Set the appearance attributes of the div container
			hContainer.style.position 	= "absolute";
			hContainer.style.background = "#FFFFFF";
			hContainer.style.border 	= "0px solid #000000";
			hContainer.style.padding 	= "3px";
			if (i == 0)
				hContainer.style.display 	= 'block'; // Display container
			else
				hContainer.style.display 	= 'none';  // Hide the container
			
			// Set hPicture container screen coordinates
			hPictures.style.width 	= width + "px";
			hPictures.style.height 	= height + "px";
			hPictures.style.left 	= "3px";
			hPictures.style.top 	= "3px";	
			// Set the appearance attributes of the pictures container
			hPictures.style.position 	= "absolute";
			hPictures.style.background 	= "#000000";
			hPictures.style.border 		= "0px solid #000000";
			
			// Append the containers to the document
			document.body.appendChild(hContainer); // Append to the body (main document)
			hContainer.appendChild(hPictures);     // Append to the hContainer object. (Child Window)
			
			hImage = document.getElementById('slideShow_Pictures' + szI.toString());		
			hImage.src = slideShow_array[i];
		}
	}
	
	// Create the navigation containers
	var imgNext	= "nav_next";
	var imgPrev	= "nav_prev";
	var idNext 	= document.getElementById(imgNext);
	var idPrev 	= document.getElementById(imgPrev);
	var idClose = document.getElementById('nav_closeslideshow');

	// "Next" Button
	if (!idNext)
		var hNext = document.createElement('img');
	else
		var hNext = idNext;
	hNext.setAttribute		('id', imgNext);
	hNext.style.left 		= x + width + 32 + "px";
	hNext.style.top  		= y + (height / 2) - 16 + "px";
	hNext.style.width  		= "32px";
	hNext.style.height  	= "32px";
	hNext.style.position 	= "absolute";
	hNext.style.zIndex 		= 50;
	hNext.style.display 	= 'block';
	// "Previous" button
	if (!idPrev)
		var hPrev = document.createElement('img');
	else
		var hPrev = idPrev;
	hPrev.setAttribute		('id', imgPrev);
	hPrev.style.left 		= x - 64 + "px";
	hPrev.style.top  		= y + (height / 2) - 16 + "px";
	hPrev.style.width  		= "32px";
	hPrev.style.height  	= "32px";
	hPrev.style.position 	= "absolute";
	hPrev.style.zIndex 		= 50;
	hPrev.style.display 	= 'block';
	// "Close" Button
	if (!idClose)
		var hClose = document.createElement('img');
	else
		var hClose = idClose;
	hClose.setAttribute		('id', 'nav_closeslideshow');
	hClose.style.left 		= x + width - 98 + "px";
	hClose.style.top  		= y + height + 15 + "px";
	hClose.style.width  	= "98px";
	hClose.style.height  	= "22px";
	hClose.style.position 	= "absolute";
	hClose.style.zIndex 	= 50;
	hClose.style.display 	= 'block';
	
	// Append the new img elements to the body of the document
	document.body.appendChild(hNext);
	document.body.appendChild(hPrev);
	document.body.appendChild(hClose);
	
	// Add the image source and the mouse events to the navigation buttons
	if ((slideShow_array.count() - 2) > 0)
		hNext.src 		= "/../images/nav_next.gif";
	else
		hNext.src 		= "/../images/nav_next_dis.gif";
	hNext.onclick 		= slideShow_Next;
	hNext.onmouseover	= slideShow_Next_MouseOver;
	hNext.onmouseout	= slideShow_Next_MouseOut;
	
	hPrev.src 			= "/../images/nav_prev_dis.gif";
	hPrev.onclick 		= slideShow_Prev;
	hPrev.onmouseover	= slideShow_Prev_MouseOver;
	hPrev.onmouseout	= slideShow_Prev_MouseOut;

	hClose.src 			= "/../images/nav_close.gif";
	hClose.onclick 		= slideShow_Close;
	hClose.onmouseover	= slideShow_Close_MouseOver;
	hClose.onmouseout	= slideShow_Close_MouseOut;
}


//
// Displayes the next picture in the slideShow
//
function slideShow_Next()
{
	var szI = slideShow_num;

	if (szI != (slideShow_array.count() - 2))
	{
		var id_curr = document.getElementById(slideShow_id + szI.toString());
		szI++;
		var id_next = document.getElementById(slideShow_id + szI.toString());
		
		id_curr.style.display = 'none';
		id_next.style.display = 'block';
		
		slideShow_num = szI;
		
		if (szI == (slideShow_array.count() - 2))
		{
			var idNext = document.getElementById('nav_next');
			idNext.src = "/../images/nav_next_dis.gif";
		}
		if (szI == 1)
		{
			var idPrev = document.getElementById('nav_prev');
			idPrev.src = "/../images/nav_prev.gif";
		}
	}

	return false;	
}


//
// Changes the image of the "next" button when the user puts his/her mouse over it
//
function slideShow_Next_MouseOver()
{
	if (slideShow_num < (slideShow_array.count() - 2))
	{	
		var idNext = document.getElementById('nav_next');
		idNext.src = "/../images/nav_next_mo.gif";
	}
	
	return false;
}

//
// Changes the image of the "next" button when the user takes his/her mouse off of it
//
function slideShow_Next_MouseOut()
{
	if (slideShow_num < (slideShow_array.count() - 2))
	{
		var idNext = document.getElementById('nav_next');
		idNext.src = "/../images/nav_next.gif";
	}
	
	return false;
}


//
// Displayes the previous picture in the slideShow
//
function slideShow_Prev()
{
	var szI = slideShow_num;
	
	if (szI != 0)
	{
		var id_curr = document.getElementById(slideShow_id + szI.toString());
		szI--;
		var id_prev = document.getElementById(slideShow_id + szI.toString());
		
		id_curr.style.display = 'none';
		id_prev.style.display = 'block';
		
		slideShow_num = szI;
		
		if (szI < (slideShow_array.count() - 2))
		{
			var idNext = document.getElementById('nav_next');
			idNext.src = "/../images/nav_next.gif";
		}
		if (szI == 0)
		{
			var idPrev = document.getElementById('nav_prev');
			idPrev.src = "/../images/nav_prev_dis.gif";
		}		
		
	}
	
	return false;	
}


//
// Changes the image of the "previous" button when the user puts his/her mouse over it
//
function slideShow_Prev_MouseOver()
{
	if (slideShow_num != 0)
	{	
		var idPrev = document.getElementById('nav_prev');
		idPrev.src = "/../images/nav_prev_mo.gif";
	}
	
	return false;
}

//
// Changes the image of the "previous" button when the user takes his/her mouse off of it
//
function slideShow_Prev_MouseOut()
{
	if (slideShow_num != 0)
	{
		var idPrev = document.getElementById('nav_prev');
		idPrev.src = "/../images/nav_prev.gif";
	}
	
	return false;
}


//
// Exits the slide show
//
function slideShow_Close()
{
	for (var i = 0; i < slideShow_array.count() - 1; i++)
	{
		if (slideShow_array[i] != 'undefined')
		{
			szI = i;
			
			var idPic 	= document.getElementById(slideShow_id + szI.toString());
			var hImage 	= document.getElementById('slideShow_Pictures' + szI.toString());		
			
			idPic.style.display = 'none';
			hImage.src 			= ""; 
			
		}
	}
	
	var idPic = document.getElementById('nav_next');
	idPic.style.display = 'none';
	
	idPic = document.getElementById('nav_prev');
	idPic.style.display = 'none';
	
	idPic = document.getElementById('nav_closeslideshow');
	idPic.style.display = 'none';
	
	slideShow_array = [];
	grayOut(false);

	// Hide the flash (mp3 player)
	//var audio = document.getElementById('mobounce_audio_player');
	//audio.style.visibility = 'visible';

	return false;	
}


//
// Changes the image of the "close slide show" button when the user puts his/her mouse over it
//
function slideShow_Close_MouseOver()
{
	var idClose = document.getElementById('nav_closeslideshow');
	idClose.src = "/../images/nav_close_mo.gif";

	return false;
}

//
// Changes the image of the "close slide show" button when the user takes his/her mouse off of it
//
function slideShow_Close_MouseOut()
{
	var idClose = document.getElementById('nav_closeslideshow');
	idClose.src = "/../images/nav_close.gif";
	
	return false;
}

// 
// Create and display the slideShow (slideShow uses Ajax to retrieve the picture from a directory)
//
var slideShow_id;	 // ID of the slideShow
var slideShow_num;	 // The current picture displayed in the slideShow
var slideShow_array; // Array of pictures for the slideShow to display 
function slideShow(id, dirPictures)
{	
	var xmlhttp = ajaxBrowser();
	
	if (xmlhttp)
	{	
		xmlhttp.open("GET", "scripts/php/events_slideshow.php?dir=" + escape(dirPictures));
		xmlhttp.onreadystatechange = function() 
		{
		    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
		    {
				var picString = xmlhttp.responseText;

				// If picString.length == 0 then we have no pictures to view...exit function
				if (picString.length == 0)
				{		
					alert('The author has not included any pictures in this directory');
					return false;
				}
						
				// Gray out the web page
				grayOut(true);
			
				// Split the string that the ajax call returned into array elements
				slideShow_array = picString.split(";");
				// Create a modal dif container where we can place out pictures
				slideShow_id  = id;
				slideShow_num = 0;
				
				slideShow_Progressbar(true, 0);
	
				var slideShow_Pics_Loaded = 0;
				var iNum 	= slideShow_array.length - 1;
				var tmp_img = new Image();
				tmp_img.onload = function() 
				{	
					slideShow_Pics_Loaded++;
					
					var iPercent = (slideShow_Pics_Loaded / iNum) * 100;
					slideShow_UpdateProgress(iPercent);
					tmp_img.src = slideShow_array[slideShow_Pics_Loaded];
					
					if (Math.round(iPercent) == 100)
					{
						var hProgress = document.getElementById('slideShow_Progress');
						slideShow_UpdateProgress(0);
						hProgress.style.display = 'none';
						slideShow_Create("slideShow_Pictures");	
					}
				}

				tmp_img.src = slideShow_array[0];
				
			}
		}
		
		xmlhttp.send(null);
	}
	
	// If the slideShow was created, we need to return true. Otherwise, there was an error
	// and we return false.
	var hSlideShow = document.getElementById(id);
	if (hSlideShow)
		return true;
	else
		return false;
}


//
// grayOut Funtion was taken from www.hunlock.com
// This function is used with the slideShow function
//
function grayOut(vis, options) {
  // Pass true to gray out screen, false to ungray
  // options are optional.  This is a JSON object with the following (optional) properties
  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 
  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out
  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code
  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
  // in any order.  Pass only the properties you need to set.
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#000000';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        //tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';
	//document.body.style.overflow = 'hidden';
	
  } else {
     dark.style.display='none';
  }
}