﻿// JScript File

function NewWindow(mypage, myname, x, y) {
var winl = (screen.width - x) / 2;
var wint = (screen.height - y) / 2;
winprops = 'height='+y+',width='+x+',top='+wint+',left='+winl+',scrollbars=yes,resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindowRef(mypage, myname, x, y) {
var winl = (screen.width - x) / 2;
var wint = (screen.height - y) / 2;
winprops = 'height='+y+',width='+x+',top='+wint+',left='+winl+',scrollbars=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function NewWindowLAMPS(mypage, myname, x, y) {
var winl = (screen.width - x) / 2;
var wint = (screen.height - y) / 2;
winprops = 'height='+y+',width='+x+',top='+wint+',left='+winl
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// JScript File


//function openmenu(){
//	var slide_horiz = new Spry.Effect.Slide('slideItHorizontal', {horizontal: true, toggle: true});
//    slide_horiz.start();
//}

	//var slide_hidden = new Spry.Effect.Slide('example5', {duration: 2000, from: '0%', to: '100%', toggle: true});



function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	
	document.cookie = name + "=" +escape( value ) +
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}


function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}				
				
function Delete_Cookie( name, path, domain ) {
//alert("js:Delete_Cookie");
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
		
		
function setMenu(){
 var cookie_name="showmenu";
        var results = Get_Cookie("showmenu");
        
        if ( results )
            { if (results=='no')
                {
                slide_horiz.start();
                 }
                 else if (results=='yes')
                 {
                    document.getElementById("menu").className='';
                 }
            }
            
        if (!results )
            {
              slide_horiz.start();
                Set_Cookie('showmenu','no',1,'/','','');
            
            setTimeout('document.getElementById("menu").className=""',3500);
            setTimeout('slide_horiz.start()',4000);
                Set_Cookie('showmenu','yes',1,'/','','');
            }
}

function setcookie()
{
	//alert("js:setcookie");
	var results = Get_Cookie("showmenu");
	//alert(results);
	var current_date = new Date;
	var cookie_date=current_date.getDate ( ) + 1;
	
	
	if (results=='no')   
	{
	
		Set_Cookie('showmenu','yes',1,'/','','');
		document.getElementById("menu").className='';
		 slide_horiz.start();
		 
	} else {
		
		Set_Cookie('showmenu','no',1,'/','','');
		 slide_horiz.start();
		//document.getElementById("menu").className='hideInitially';
		
	}
	
}


function Callcookie(){
        
        var cookie_name="showmenu";
        var results = Get_Cookie("showmenu");
        if ( results )
            { if (results=='no')
                {
                  slide_horiz.start();
                    document.getElementById("menu").className='hideInitially';
                     //document.getElementById("menu").style.visibility = 'hidden';
                 }
                 else if (results=='yes')
                 {
                    document.getElementById("menu").className='';
                 //document.getElementById("menu").style.visibility = 'visible';
                 }
            }
        if (!results )
            {
                Set_Cookie('showmenu','no',1,'/','','');
                slide_horiz.start();
               document.getElementById("menu").className='hideInitially';
                  //document.getElementById("menu").style.visibility = 'hidden';
            }
}

			
//Treemenu

function expandDiv(what) {
  table_contract = new Image(0,0);
  //table_contract.src = "/images/plus.gif";
  table_expand = new Image(0,0);
  //table_expand.src = "/images/minus.gif";
 
  if (document.getElementById(what).style.display == "none") {
    document.getElementById(what).style.display = "";
  } else {
    document.getElementById(what).style.display = "none";
    where.src = table_contract.src;
  }
}

function collapseDiv(what) {
  table_contract = new Image(0,0);
  //table_contract.src = "/images/plus.gif";
  table_expand = new Image(0,0);
  //table_expand.src = "/images/minus.gif";
  document.getElementById(what).style.display = "none";
}

//*Treemenu//	


