function selectedchannel(self,color){
	self.style.borderTop = "2px solid " + color ;
	self.style.borderLeft = "2px solid " + color ;
	self.style.borderRight = "2px solid " + color ;
}
function unselectedchannel(self){
	self.style.borderTop = "0px" ;
	self.style.borderLeft = "0px" ;
	self.style.borderRight = "0px" ;
}
function validateForm(theform)
{
	pass = 1; //assume everything is ok
	msg = "";
		
	if ( theform.username.value=='' )
	{
		msg = msg + "- User Name cannot be empty\n- 用戶名稱欄不能空置\n\n";
		pass = 0;
	}
	
	if ( theform.password.value=='' )
	{
		msg = msg + "- Enter password cannot be empty\n- 輸入密碼欄不能空置\n\n";
		pass = 0;
	}
		
	if (pass == 1)
	{
		return true;
	}
	else
	{
		alert(msg);
		return false;
	}
	
}

function setCookie(c_name,value,exdays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

$(function(){
	$('.Over').mouseover(function() {
		$(this).css("background","url(./images/main_tab.png) 0 -47px");
	});
	$('.Over').mouseout(function() {
		$(this).css("background","url(./images/main_tab.png) 0 0px");	 
	});
	$("a.zoonin").fancybox();
	$('.Over').click(function(){
		var eid = $(this).attr('eid') ;
		if( eid>0 ){
			window.location.href = './?id=' + eid ;
		}else{
			window.location.href = './' ;
		}
	});								  
});
