﻿function mouseover(obj){
	obj.background="images/Button_bgB.gif";
	obj.style.cursor="hand";
}

function mouseout(obj){
	obj.background="images/Button_bg.gif";
	obj.style.cursor="hand";
}

function mouseclick(Bottonid,URL){
	//var curTime = new Date();
    //curTime.setTime(curTime.getTime() + 1000*24*60*60*1000);
	document.cookie="Button="+Bottonid;
	window.location=URL;
}


function getCookie(name)
{											
  var strCookies = document.cookie;
  var cookieName = name + "=";
  var valueBegin, valueEnd, value;
  valueBegin = strCookies.indexOf(cookieName);
  if (valueBegin == -1) return null;
  valueEnd = strCookies.indexOf(";", valueBegin);
  if (valueEnd == -1)
      valueEnd = strCookies.length;
  value = strCookies.substring(valueBegin+cookieName.length,valueEnd);
  return value;
}


function checkCookieExist(name)
{											
  if (getCookie(name))
      return true;
  else
      return false;
}



function settable(){
	if(checkCookieExist("Button")){
		Button[getCookie("Button")].background="images/Button_bgB.gif";
	}else{
		Button[0].background="images/Button_bgB.gif";
	}
}
function CheckUserLogin(){
	if(document.UserLogin.Userid.value==""){
		alert("The user ID can't be empty!");
		document.UserLogin.Userid.focus();
		return false;
	}
	if(document.UserLogin.Password.value==""){
		alert("The Password can't be empty!");
		document.UserLogin.Password.focus();
		return false;
	}
}
function CheckSearch(){
	if(document.Search.K.value==""){
		alert("Please input keywords!");
		document.Search.K.focus();
		return false;
	}
}
function ModThisBgColor(obj,thisobj){
	if(thisobj.checked){
		obj.style.backgroundColor='#FFF7D0';
	}else{
		obj.style.backgroundColor='#FBFBFB';
	}
}
