buttonLeftUp = new Image();

buttonLeftUp.src = "images/buttonLeftUp.png";

buttonCenterUp = new Image();

buttonCenterUp.src = "images/buttonCenterUp.png";

buttonRightUp = new Image();

buttonRightUp.src = "images/buttonRightUp.png";



buttonLeftDown = new Image();

buttonLeftDown.src = "images/buttonLeftDown.png";

buttonCenterDown = new Image();

buttonCenterDown.src = "images/buttonCenterDown.png";

buttonRightDown = new Image();

buttonRightDown.src = "images/buttonRightDown.png";



buttonUp=new Image();

buttonUp.src="images/buttonUp.png";

buttonDown=new Image();

buttonDown.src="images/buttonDown.png";



loginDown=new Image();

loginDown.src="images/loginDown.png";

loginUp=new Image();

loginUp.src="images/loginUp.png";



logoutDown=new Image();

logoutDown.src="images/logoutDown.png";

logoutUp=new Image();

logoutUp.src="images/logoutUp.png";



loginForgotPassDown=new Image();

loginForgotPassDown.src="images/loginForgotPassDown.png";

loginForgotPassUp=new Image();

loginForgotPassUp.src="images/loginForgotPassUp.png";



loginChangePassDown=new Image();

loginChangePassDown.src="images/loginChangePassDown.png";

loginChangePassUp=new Image();

loginChangePassUp.src="images/loginChangePassUp.png";

nextPageDown=new Image();

nextPageDown.src="images/nextPageDown.png";

nextPageUp=new Image();

nextPageUp.src="images/nextPageUp.png";



backPageDown=new Image();

backPageDown.src="images/backPageDown.png";

backPageUp=new Image();

backPageUp.src="images/backPageUp.png";

ID1=window.setTimeout("UpdateStatusBar()",10);

function UpdateStatusBar()

{

 window.status=" ";

 ID1=window.setTimeout("UpdateStatusBar()",10);

}

function setBgUp(id,pageButtonTop)

{

if(pageButtonTop!=id)

 {

 document.getElementById('buttonLeft'+id).background=buttonLeftUp.src;

 document.getElementById('buttonCenter'+id).background=buttonCenterUp.src;

 document.getElementById('buttonRight'+id).background=buttonRightUp.src;

 if(pageButtonTop!=0)

  {

  document.getElementById('buttonLeft'+pageButtonTop).background=buttonLeftDown.src;

  document.getElementById('buttonCenter'+pageButtonTop).background=buttonCenterDown.src;

  document.getElementById('buttonRight'+pageButtonTop).background=buttonRightDown.src;

  }

 }

}



function setBgDown(id,pageButtonTop)

{

if(pageButtonTop!=id)

 {

 document.getElementById('buttonLeft'+id).background=buttonLeftDown.src;

 document.getElementById('buttonCenter'+id).background=buttonCenterDown.src;

 document.getElementById('buttonRight'+id).background=buttonRightDown.src;

 if(pageButtonTop!=0)

  {

  document.getElementById('buttonLeft'+pageButtonTop).background=buttonLeftUp.src;

  document.getElementById('buttonCenter'+pageButtonTop).background=buttonCenterUp.src;

  document.getElementById('buttonRight'+pageButtonTop).background=buttonRightUp.src;

  }

 }

}



function setButtonUp(id,pageButtonLeft)

{

if(pageButtonLeft!=id)

 {

 document.getElementById('button'+id).background=buttonUp.src;

 if(pageButtonLeft!=0)

  {

  document.getElementById('button'+pageButtonLeft).background=buttonDown.src;

  }

 }

}



function setButtonDown(id,pageButtonLeft)

{

if(pageButtonLeft!=id)

{

 document.getElementById('button'+id).background=buttonDown.src;

 if(pageButtonLeft!=0)

  {

  document.getElementById('button'+pageButtonLeft).background=buttonUp.src;

  }

 }

}



function changeLoginUp()

{

document.getElementById('loginButton').src=loginUp.src;

}



function changeLoginDown()

{

document.getElementById('loginButton').src=loginDown.src;

}



function changeLogoutUp()

{

document.getElementById('logoutButton').src=logoutUp.src;

}



function changeLogoutDown()

{

document.getElementById('logoutButton').src=logoutDown.src;

}



function changeLoginForgotPassDown()

{

document.getElementById('loginForgotPassButton').src=loginForgotPassDown.src;

}



function changeLoginForgotPassUp()

{

document.getElementById('loginForgotPassButton').src=loginForgotPassUp.src;

}



function changeLoginChangePassDown()

{

document.getElementById('loginChangePassButton').src=loginChangePassDown.src;

}



function changeLoginChangePassUp()

{

document.getElementById('loginChangePassButton').src=loginChangePassUp.src;

}



function setFocus(focusType)

{

if(focusType==1)

 {

 if(document.getElementById('userid') != null) document.getElementById('userid').focus();

 }

else

 {

 if(document.getElementById('userid') != null && document.getElementById('userid').value!='')

  {

	if (document.getElementById('password') != null) document.getElementById('password').focus();

	}

 }

}



function changeSearchButtonUp()

{

document.getElementById('searchButton').src=searchButtonUp.src;

}



function changeSearchButtonDown()

{

document.getElementById('searchButton').src=searchButtonDown.src;

}



function changeNextPageUp()

{

document.getElementById('nextPage').src=nextPageUp.src;

}



function changeNextPageDown()

{

document.getElementById('nextPage').src=nextPageDown.src;

}



function changeBackPageUp()

{

document.getElementById('backPage').src=backPageUp.src;

}



function changeBackPageDown()

{

document.getElementById('backPage').src=backPageDown.src;

}



function popUp(file,link,width,height)

{

if(screen.height < height)

 {

 nheight=600;

 nwidth=width*nheight/height;

 width=nwidth;

 height=nheight;

 }

NewWin=window.open(file+'.php'+'?picture='+link+'&height='+height,'NewWin','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,menubar=0,screenX=0,screenY=0,width='+width+',height='+height);

NewWin.moveTo(0,0);

NewWin.focus();

}

function getCookie( name ) {

	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function deleteCookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function testCookie()
{
var cookieEnabled=(navigator.cookieEnabled)? true : false
//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
   {
   document.cookie="testcookie"
   cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false
   }
return cookieEnabled;
}
