//---------------------------------------------------------------------------------------------------------
//	DHTML JavaScript (ver 2.3)
//---------------------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------------
//	Show/ Hide menus
//-------------------------------------------------------------------------------------------------------
function show(group,item,imgId,imgBase)
{
	if(document.getElementById)
	{
		menuCount	= eval("m_" + group);
		
		mainMenu	= document.getElementById("m" + group + "0");
		subMenu		= document.getElementById("m" + group + item);

		//	Does object exist?
		if( !subMenu )
		{
			//	No, don't process
			return false;
		}
		
		if( imgId != 'NULL' )
		{
			imgObj	= document.getElementById( imgId );
			imgObj.setAttribute( 'base', imgBase );
			imgObj.setAttribute( 'src', imgBase );
		}
		
		mainMenu.style.visibility	= "visible";
		
		if ((mainMenu != subMenu) && (item != 0))
		{
			subMenu.style.visibility	= "visible";
			for (i = 1; i <= menuCount; i++)
			{
				if (i != item)
				{
					document.getElementById("m" + group + i).style.visibility	= "hidden";
				}
			}
		}
	}
}

//-------------------------------------------------------------------------------------------------------
//	Hide menu
//-------------------------------------------------------------------------------------------------------
function hide(group,item,imgId,imgBase)
{
	if(document.getElementById)
	{
		menuCount	= eval("m_" + group);

		//	Does object exist?
		if( !document.getElementById( "m" + group + menuCount ))
		{
			//	No, don't process
			return false;
		}
		
		if( imgId != 'NULL' )
		{
			imgObj	= document.getElementById( imgId );
			imgObj.setAttribute( 'base', imgBase );
			imgObj.setAttribute( 'src', imgBase );
		}
		
		if (item == 0)
		{
			startFrom	= 0;
		}
		else
		{
			startFrom	= 1;
		}
		for (i = startFrom; i <= menuCount; i++)
		{
			document.getElementById("m" + group + i).style.visibility	= "hidden";
		}
	}
}

//-------------------------------------------------------------------------------------------------------
//	Image swap
//-------------------------------------------------------------------------------------------------------
function swapImg(id,img)
{
	if( document.getElementById)
	{
		obj	= document.getElementById(id);
		obj.setAttribute( 'src', img );
	}
}

//-------------------------------------------------------------------------------------------------------
//	Client_text Selector
//-------------------------------------------------------------------------------------------------------
//	track what Client_text is highlighted in the sponsor a Client_text selector
currentClient_text	= 0;

function showClient_text(what)
{
	Client_textId			= "Client_text" + what;
	
	if(document.getElementById)
	{
		if ( !document.getElementById(Client_textId) )
		{
			return;
		}

		document.getElementById(Client_textId).style.visibility	= "visible";
		if (currentClient_text != what)
		{
			previousClient_textId		= "Client_text" + currentClient_text;
			document.getElementById(previousClient_textId).style.visibility	= "hidden";
		}
	}

	currentClient_text	= what;
}

//-------------------------------------------------------------------------------------------------------
//	Client_image Selector
//-------------------------------------------------------------------------------------------------------
//	track what Client_image is highlighted in the sponsor a Client_image selector
currentClient_image	= 0;

function showClient_image(what)
{
	Client_imageId			= "Client_image" + what;
	
	if(document.getElementById)
	{
		if ( !document.getElementById(Client_imageId) )
		{
			return;
		}

		document.getElementById(Client_imageId).style.visibility	= "visible";
		if (currentClient_image != what)
		{
			previousClient_imageId		= "Client_image" + currentClient_image;
			document.getElementById(previousClient_imageId).style.visibility	= "hidden";
		}
	}

	currentClient_image	= what;
}

//-------------------------------------------------------------------------------------------------------
//	Redirect
//-------------------------------------------------------------------------------------------------------
function redirectTo( nav )
{
	//	Selected a url?
	dropdown	= nav.options;
	value		= dropdown[dropdown.selectedIndex].value;

	if ( value )
	{
		window.location.href = value;	
	}
}

//-------------------------------------------------------------------------------------------------------
//	Gallery functionality
//-------------------------------------------------------------------------------------------------------
function gallerySwap(id)
{
	detailsImage	= document.getElementById('detailsgraphic');
	detailsImage.setAttribute( 'src', gallery[id] );
	
	textElement		= document.getElementById('detailstitle');
	textElement.innerHTML	= gallerytitle[id];
	
	textElement		= document.getElementById('detailstext');
	textElement.innerHTML	= gallerytext[id];
}

//*********************************************************************************************************
//	Positioning Tools
//*********************************************************************************************************
var positionShown  = false;

//-------------------------------------------------------------------------------------------------------
//	Turn position reporting On/Off
//-------------------------------------------------------------------------------------------------------
function togglePositionReporting()
{
	//	What ctrl key combination was hit
	if ( event.ctrlKey && (event.keyCode == 71) )
	{
		if (!document.getElementById('grid') || !document.getElementById('poslabel'))
		{
			return;
		}
		
		//	Get the tool objects
		gridObj  = document.getElementById('grid');
		labelObj = document.getElementById('poslabel');
		
		//	Turn the monitoring off
		if (positionShown)
		{
			//	Hide the grid
			gridObj.style.display = 'none';
			
			//	Show the position label
			labelObj.style.display = 'none';
			
			//	Stop monitoring
			document.onmousemove = '';
		}

		//	Turn the monitoring on
		else
		{
			//	Show the label
			labelObj.style.display = 'block';
			
			//	Show the grid
			gridObj.style.display	= 'block';
			gridObj.style.height	= document.body.clientHeight + 'px';

			//	Start monitoring
			document.onmousemove = showMousePosition;
		}

		//	Reset the state
		positionShown = positionShown ? false : true;
	}
}

//-------------------------------------------------------------------------------------------------------
//	Show the mouse position
//-------------------------------------------------------------------------------------------------------
function showMousePosition()
{
	//	Get the label
	labelObj = document.getElementById('poslabel');
	
	//	Get the scroll position
	if (document.compatMode && document.compatMode != "BackCompat")
	{
		scroll_left = document.documentElement.scrollLeft;
		scroll_top  = document.documentElement.scrollTop;
	}
	else
	{
		scroll_left = document.body.scrollLeft;
		scroll_top  = document.body.scrollTop;
	}

	//	Get the mouse position
	xMousePos	 = window.event.x + scroll_left - 2;
	yMousePos	 = window.event.y + scroll_top  - 3;
	xMousePosMax = document.body.clientWidth +  scroll_left;
	yMousePosMax = document.body.clientHeight + scroll_top;

	//	Reposition the label in the correct position
	labelObj.style.top  = yMousePos + 5;
	labelObj.style.left = xMousePos + 15;
	
	//	Update the label
	labelObj.innerText = xMousePos + ", " + yMousePos;
}

//----------------------------------//
//  Javascript - popUp 				//	
//  opens large horzonal window		//
//----------------------------------//	

function popUp(url,name,sizeX,sizeY,scroll)
{
	if ( sizeX == 0 )
	{
		//	Top corner
		leftpos	= 10000;
		toppos	= 10000;
		
		//	Define the window size
		heightVar = '';
		widthVar  = '';
	}
	
	else
	{
		//	Center the window
		leftpos	= (screen.width)  ? (screen.width-sizeX)/2 : 100;
		toppos	= (screen.height) ? (screen.height-sizeY)/2 : 100;

		//	Define the window size
		widthVar  = 'width=' + sizeX + ',';
		heightVar = 'height=' + sizeY + ',';
	}

	//	Open the window
	winobject	= window.open(url,name,"menubar=,statusbar=0,scrollbars=" + scroll + ",toolbar=1,location=0," + widthVar + heightVar + "left=" + leftpos + ",top=" + toppos);
	winobject.focus();
}
//----------------------------------//
//  Javascript - scrapbookDetails 	//	
//  opens large horzonal window		//
//----------------------------------//	
	
	function scrapbookDetails(content,target)
{
	window.open(content,target,"menubar=0,statusbar=0,scrollbars=1,toolbar=0,location=0,width=800,height=650");
}

function DoJunc( url )
{
 if ( !opener.closed )
 {
  opener.document.location    = url
 } 
}

//----------------------------------//
//  Javascript - csuiteDetails 	   //	
//  opens large horzonal window		//
//----------------------------------//	
	
	function csuiteDetails(content,target)
{
	window.open(content,target,"resizable=yes,menubar=0,statusbar=0,scrollbars=0,toolbar=0,location=0,width=600,height=470");
}

function DoJunc( url )
{
 if ( !opener.closed )
 {
  opener.document.location    = url
 } 
}

//----------------------------------//
//  Javascript - luxDetails 	   //	
//  opens large horzonal window		//
//----------------------------------//	
	
	function luxDetails(content,target)
{
	window.open(content,target,"resizable=yes,menubar=0,statusbar=0,scrollbars=1,toolbar=0,location=0,width=600,height=650");
}

function DoJunc( url )
{
 if ( !opener.closed )
 {
  opener.document.location    = url
 } 
}

//----------------------------------//
//  Javascript - purlDetails 	    //	
//  opens smaller horzonal window   //
//----------------------------------//	
	
	function purlDetails(content,target)
{
	window.open(content,target,"resizable=no,menubar=0,statusbar=0,scrollbars=0,toolbar=0,location=0,width=750,height=570");
}

function DoJunc( url )
{
 if ( !opener.closed )
 {
  opener.document.location    = url
 } 
}

//----------------------------------------------------------//
//  Javascript - Dropdown  									//	
//  enables dropdown functionality on case study page		//
//----------------------------------------------------------//
function go(form) {
     cat = (form.Category.options[form.Category.selectedIndex].value);
    if (cat != "")
      location = ""+cat;

 else
  alert("Please select a page.");
}


//---------------------------------------------------------------------------------------------------------
//	Show arrow (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showarrow(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hidearrow();	
	}
	
	arrowobject							= document.getElementById('arrow' + what);
	arrowobject.style.display			= ''; 
	selectedID							= what;
}

function hidearrow()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('arrow' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Show close (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showclose(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideclose();	
	}
	
	closeobject							= document.getElementById('close' + what);
	closeobject.style.display			= ''; 
	selectedID							= what;
}

function hideclose()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('close' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}

//---------------------------------------------------------------------------------------------------------
//	Show images (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showimg(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideimg();	
	}
	
	imgobject							= document.getElementById('img' + what);
	imgobject.style.display				= ''; 
	selectedID							= what;
}

function hideimg()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('img' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Show work (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showwork(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hidework();	
	}
	
	workobject							= document.getElementById('work' + what);
	workobject.style.display			= ''; 
	selectedID							= what;
}

function hidework()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('work' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}

//---------------------------------------------------------------------------------------------------------
//	Show right shade selections (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showright(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideright();	
	}
	
	rightobject							= document.getElementById('right' + what);
	rightobject.style.display			= ''; 
	selectedID							= what;
}

function hideright()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('right' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Show additional images (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showadditional(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideadditional();	
	}
	
	additionalobject							= document.getElementById('additional' + what);
	additionalobject.style.display			= ''; 
	selectedID							= what;
}

function hideadditional()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('additional' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Show services (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showservice(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideservice();	
	}
	
	serviceobject							= document.getElementById('service' + what);
	serviceobject.style.display			= ''; 
	selectedID							= what;
}

function hideservice()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('service' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Show map (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showclient(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hideclient();	
	}
	
	clientobject							= document.getElementById('client' + what);
	clientobject.style.display				= 'block'; 
	selectedID							= what;
}

function hideclient()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('client' + selectedID);
		clientobject.style.display			= 'none'; 
		selectedID						= 0;
	}
}

function setdisplay(id,value)
{
	if( document.getElementById)
	{
		obj	= document.getElementById(id);
		obj.style.display	= value;
	}
}



//---------------------------------------------------------------------------------------------------------
//	Show bios (on click shows div layer)
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showbio(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hidebio();	
	}
	
	bioobject							= document.getElementById('bio' + what);
	bioobject.style.display			= ''; 
	selectedID							= what;
}

function hidebio()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('bio' + selectedID);
		selectedobject.style.display = 'none'; 
		selectedID						= 0;
	}
}

//---------------------------------------------------------------------------------------------------------
//	link details
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showlink(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hidelink();	
	}
	
	detailobject							= document.getElementById('link' + what);
	detailobject.style.visibility			= 'visible'; 
	selectedID							= what;
}

function hidelink()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('link' + selectedID);
		selectedobject.style.visibility = 'hidden'; 
		selectedID						= 0;
	}
}
//---------------------------------------------------------------------------------------------------------
//	Show and Hide Client
//---------------------------------------------------------------------------------------------------------
function showHideClient(id, show)
  {
    var elem = document.getElementById(id);
    if (elem) 
    {
      if (show) 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
      }
    }
  }   


//---------------------------------------------------------------------------------------------------------
//	Show and Hide Work
//---------------------------------------------------------------------------------------------------------
function showHideWork(id, show)
  {
    var elem = document.getElementById(id);
    if (elem) 
    {
      if (show) 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
      }
    }
  }   

//---------------------------------------------------------------------------------------------------------
//	Show and Hide Select
//---------------------------------------------------------------------------------------------------------
function showHideSelect(id, show)
  {
    var elem = document.getElementById(id);
    if (elem) 
    {
      if (show) 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
      }
    }
  }   

//---------------------------------------------------------------------------------------------------------
//	VCA
//---------------------------------------------------------------------------------------------------------
var selectedID = 0;

function showvca(what)
{
	//	Hide existing one
	if (selectedID)
	{
		hidebar();	
	}
	
	barobject							= document.getElementById('vca' + what);
	barobject.style.visibility			= 'visible'; 
	selectedID							= what;
}

function hidevca()
{
	if (selectedID)
	{
		selectedobject					= document.getElementById('vca' + selectedID);
		selectedobject.style.visibility = 'hidden'; 
		selectedID						= 0;
	}
}


//---------------------------------------------------------------------------------------------------------
//	Email form validation
//---------------------------------------------------------------------------------------------------------
function IsEmail( string ) 
{
	return (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1);
}



//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	Make Flash 
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================

function makescrollflash()
{
	document.write('<object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('		width="650" ');
	document.write('		height="155">');
	document.write('		<param name="movie" value="/fla/exp_lux.swf">');
	document.write('		<param name="quality" value="high">');
	document.write('		<param name="wmode" value="transparent">');
	document.write('		<embed src="/fla/exp_lux.swf" ');
	document.write('		quality="high" ');
	document.write('		width="650" ');
	document.write('		height="155"');
	document.write('		wmode="transparent"');
	document.write('		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('	</embed></object>');
}

function makegenscrollflash()
{
	document.write('<object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('		width="650" ');
	document.write('		height="155">');
	document.write('		<param name="movie" value="/fla/exp_gen.swf">');
	document.write('		<param name="quality" value="high">');
	document.write('		<param name="wmode" value="transparent">');
	document.write('		<embed src="/fla/exp_gen.swf" ');
	document.write('		quality="high" ');
	document.write('		width="650" ');
	document.write('		height="155"');
	document.write('		wmode="transparent"');
	document.write('		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('	</embed></object>');
}

function makeb2bscrollflash()
{
	document.write('<object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('		width="650" ');
	document.write('		height="155">');
	document.write('		<param name="movie" value="/fla/exp_b2b.swf">');
	document.write('		<param name="quality" value="high">');
	document.write('		<param name="wmode" value="transparent">');
	document.write('		<embed src="/fla/exp_b2b.swf" ');
	document.write('		quality="high" ');
	document.write('		width="650" ');
	document.write('		height="155"');
	document.write('		wmode="transparent"');
	document.write('		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('	</embed></object>');
}


function makehomeflash()
{
	document.write('<object  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write('		width="573" ');
	document.write('		height="444">');
	document.write('		<param name="movie" value="/fla/main_home.swf">');
	document.write('		<param name="quality" value="high">');
	document.write('		<param name="wmode" value="transparent">');
	document.write('		<embed src="/fla/main_home.swf" ');
	document.write('		quality="high" ');
	document.write('		width="573" ');
	document.write('		height="444"');
	document.write('		wmode="transparent"');
	document.write('		type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('	</embed></object>');
}

function makeFlash(swf,w,h,bg) 
{
	document.write("<center><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + w + "\" height=\"" + h + "\" id=\"pr\" align=\"middle\">")
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />")
	document.write("<param name=\"movie\" value=\"" + swf + "\" />")
	document.write("<param name=\"quality\" value=\"high\" />")
	document.write("<param name=\"bgcolor\" value=\"" + bg + "\" />")
	document.write("<embed src=\"" + swf + "\" quality=\"high\" bgcolor=\"" + bg + "\" width=\"" + w + "\" height=\"" + h + "\" name=\"pr\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />")
	document.write("</object></center>")
}



//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	Make Accordion nav 
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================

	jQuery().ready(function(){
		// simple Accordion
		jQuery('#list1').Accordion();
		
		// second simple Accordion with special markup
		jQuery('#navigation').Accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'click',
			autoheight: true,
			animated: 'easeslide'
		});
		
		// highly customized Accordion
		jQuery('#list2').Accordion({
			event: 'click',
			active: '.selected',
			selectedClass: 'active',
			animated: "bounceslide"
		}).change(function(event, newHeader, oldHeader, newContent, oldContent) {
			jQuery('<div>' + oldHeader.text() + ' hidden, ' + newHeader.text() + ' shown</div>').appendTo('#log');
		});
		
		// first simple Accordion with special markup
		jQuery('#list3').Accordion({
			header: 'div.title',
			active: false,
			alwaysOpen: false,
			animated: false
		});
		
		var wizard = $("#wizard").Accordion({
			header: '.title',
			event: false
		});
		
		$("div.title", wizard).each(function(index) {
			$(this)
			.next()
			.children(":button")
			.filter(".next, .previous")
			.click(function() {
				wizard.activate(index + ($(this).is(".next") ? 1 : -1))
			});
		});
		
		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		jQuery('#switch select').change(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate( this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate(-1);
		});
		jQuery('#switch2').change(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate(this.value);
		});
		
	});

	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, October 2005
	
	Version 1.2: Updated, November 12th. 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/		
	var panelWidth = 425;	// Width of help panel	
	var slideSpeed = 45;		// Higher = quicker slide
	var slideTimer = 10;	// Lower = quicker slide
	var slideActive = true;	// Slide active ?
	var initBodyMargin = 0;	// Left or top margin of your <body> tag (left if panel is at the left, top if panel is on the top)
	var pushMainContentOnSlide = false;	// Push your main content to the right when sliding
	var panelPosition = 0; 	// 0 = left , 1 = top
	
	/*	Don't change these values */
	var slideLeftPanelObj=false;
	var slideInProgress = false;	
	var startScrollPos = false;
	var panelVisible = false;
	function initSlideLeftPanel(expandOnly)
	{
		if(slideInProgress)return;
		if(!slideLeftPanelObj){
			if(document.getElementById('dhtmlgoodies_leftPanel')){	// Object exists in HTML code?
				slideLeftPanelObj = document.getElementById('dhtmlgoodies_leftPanel');
				if(panelPosition == 1)slideLeftPanelObj.style.width = '100%';
			}else{	// Object doesn't exist -> Create <div> dynamically
				slideLeftPanelObj = document.createElement('DIV');
				slideLeftPanelObj.id = 'dhtmlgoodies_leftPanel';
				slideLeftPanelObj.style.display='none';
				document.body.appendChild(slideLeftPanelObj);
			}
			
			if(panelPosition == 1){
				slideLeftPanelObj.style.top = "-" + panelWidth + 'px';
				slideLeftPanelObj.style.left = '0px';	
				slideLeftPanelObj.style.height = panelWidth + 'px';			
			}else{
				slideLeftPanelObj.style.left = "-" + panelWidth + 'px';
				slideLeftPanelObj.style.top = '0px';
				slideLeftPanelObj.style.width = panelWidth + 'px';
			}
			

			if(!document.all || navigator.userAgent.indexOf('Opera')>=0)slideLeftPanelObj.style.position = 'fixed';;
		}	
		
		if(panelPosition == 0){
			if(document.documentElement.clientHeight){
				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
			}else if(document.body.clientHeight){
				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
			}
			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
		}else{
			if(document.documentElement.clientWidth){
				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
			}else if(document.body.clientHeight){
				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
			}
			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;			
			
			
		}
		slideLeftPanelObj.style.display='block';
		
		if(panelPosition==1)
			startScrollPos = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		else
			startScrollPos = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
		if(leftPos<(0+startScrollPos)){
			if(slideActive){
				slideLeftPanel(slideSpeed);	
			
			}else{
				document.body.style.marginLeft = panelWidth + 'px';
				slideLeftPanelObj.style.left = '0px';
			}
		}else{
			if(expandOnly)return;
			if(slideActive){		
				slideLeftPanel(slideSpeed*-1);
			}else{
				if(panelPosition == 0){
					if(pushMainContentOnSlide)document.body.style.marginLeft =  initBodyMargin - 'px';
					slideLeftPanelObj.style.left = (panelWidth*-1) + 'px';	
				}else{
					if(pushMainContentOnSlide)document.body.style.marginTop =  initBodyMargin - 'px';
					slideLeftPanelObj.style.top = (panelWidth*-1) + 'px';						
				}			
			}
		}	
		
		if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0){
			window.onscroll = repositionHelpDiv;
		
			repositionHelpDiv();
		}
		window.onresize = resizeLeftPanel;
		
	}
	
	function resizeLeftPanel()
	{
		if(panelPosition == 0){
			if(document.documentElement.clientHeight){
				slideLeftPanelObj.style.height = document.documentElement.clientHeight + 'px';
			}else if(document.body.clientHeight){
				slideLeftPanelObj.style.height = document.body.clientHeight + 'px';
			}		
		}else{
			if(document.documentElement.clientWidth){
				slideLeftPanelObj.style.width = document.documentElement.clientWidth + 'px';
			}else if(document.body.clientWidth){
				slideLeftPanelObj.style.width = document.body.clientWidth + 'px';
			}	
		}
	}
	
	function slideLeftPanel(slideSpeed){
		slideInProgress =true;
		var scrollValue = 0;
		if(panelPosition==1)
			var leftPos = slideLeftPanelObj.style.top.replace(/[^0-9\-]/g,'')/1;
		else
			var leftPos = slideLeftPanelObj.style.left.replace(/[^0-9\-]/g,'')/1;
			
		leftPos+=slideSpeed;
		okToSlide = true;
		if(slideSpeed<0){
			if(leftPos < ((panelWidth*-1) + startScrollPos)){
				leftPos = (panelWidth*-1) + startScrollPos;	
				okToSlide=false;
			}
		}
		if(slideSpeed>0){
			if(leftPos > (0 + startScrollPos)){
				leftPos = 0 + startScrollPos;
				okToSlide = false;
			}			
		}
		
		
		if(panelPosition==0){
			slideLeftPanelObj.style.left = leftPos + startScrollPos + 'px';
			if(pushMainContentOnSlide)document.body.style.marginLeft = leftPos - startScrollPos + panelWidth + 'px';
		}else{
			slideLeftPanelObj.style.top = leftPos + 'px';
			if(pushMainContentOnSlide)document.body.style.marginTop = leftPos - startScrollPos + panelWidth + 'px';			
			
		}
		if(okToSlide)setTimeout('slideLeftPanel(' + slideSpeed + ')',slideTimer); else {
			slideInProgress = false;
			if(slideSpeed>0)panelVisible=true; else panelVisible = false;
		}
		
	}
	
	
	function repositionHelpDiv()
	{
		if(panelPosition==0){
			var maxValue = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			slideLeftPanelObj.style.top = maxValue;
		}else{
			var maxValue = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
			slideLeftPanelObj.style.left = maxValue;	
			var maxTop = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(!slideInProgress)slideLeftPanelObj.style.top = (maxTop - (panelVisible?0:panelWidth)) + 'px'; 		
		}
	}
	
	function cancelEvent()
	{
		return false;
	}
	function keyboardShowLeftPanel()
	{
			initSlideLeftPanel();
			return false;	
	
	}
	
	function leftPanelKeyboardEvent(e)
	{
		if(document.all)return;
		
		if(e.keyCode==112){
			initSlideLeftPanel();
			return false;
		}		
	}
	
	function setLeftPanelContent(text)
	{
		document.getElementById('leftPanelContent').innerHTML = text;
		initSlideLeftPanel(true);
		
	}
	if(!document.all)document.documentElement.onkeypress = leftPanelKeyboardEvent;
	document.documentElement.onhelp  = keyboardShowLeftPanel;
//

//-------------------------------------------------------------------------------------------------------
//	Custom Javascript functions
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================
function knowpopUp(url,name,sizeX,sizeY,scroll)
{
	if ( sizeX == 0 )
	{
		//	Top corner
		leftpos	= 10000;
		toppos	= 10000;
		
		//	Define the window size
		heightVar = '';
		widthVar  = '';
	}
	
	else
	{
		//	Center the window
		leftpos	= (screen.width)  ? (screen.width-sizeX)/2 : 100;
		toppos	= (screen.height) ? (screen.height-sizeY)/2 : 100;

		//	Define the window size
		widthVar  = 'width=' + sizeX + ',';
		heightVar = 'height=' + sizeY + ',';
	}

	//	Open the window
	winobject	= window.open(url,name,"menubar=0,statusbar=0,scrollbars=" + scroll + ",toolbar=0,location=0," + widthVar + heightVar + "left=" + leftpos + ",top=" + toppos);
	winobject.focus();
}

