// Draw Clockfunction switchLanguage(){
	document.SwitchLanguage.submit();}function GoTo(p){
	document.content.page.value=p; 
	document.content.submit();
}function menuAction(Action,SectionID){
	document.MenuForm.action = Action;
	document.MenuForm.SectionID.value = SectionID;
	document.MenuForm.submit();}
function trim(str){
   return str.replace(/^\s*|\s*$/g,"");
}function popUp(URL,WindowName,resizable,scrollbars,width,height){
	return window.open (URL,WindowName,"tollbar=0,resizable="+resizable+",scrollbars="+scrollbars+",width="+width+",height="+height+",left="+(screen.width-width)/2+",top="+(screen.height-height)/2+"");}
function dialog(URL,WindowName,resizable,scrollbars,width,height){
	return window.showModelessDialog(URL, WindowName, "dialogHeight: "+height+"px; dialogWidth: "+width+"px; dialogTop: "+(screen.height-height)/2+"px; dialogLeft: "+(screen.width-width)/2+"px; edge: Sunken; center: Yes; help: No; resizable: "+resizable+"; status: No;");	
}function textDialogFromID (id){	var D = popUp('','_blank',1,1,500,400);}function show_full(pict, w, h, title) 
{
   var new_wind= window.open('','NewWind','scrollbars=1, height='+h+', width='+w+'');
   with(new_wind.document)
  { 
      open();
	  write("<html><head><title>"+title+"</title></head>");
	  write("<body bgcolor=ffffff leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>");
      write("<table align=center width=100%><tr><td>");
	  write("<A HREF='#' onClick='window.close(self)'><img src=");
	  write(pict);
	  write(" border=0></a>");
	  write("</td></tr></table>");
	  write("</body></html>");
	  close();    
   }
}
function selectAll(SelectAll,fields){
	if(fields!=null){
		var i=0;
		while(fields[i]!=null){
			fields[i].checked=SelectAll.checked;
			i++;
		}
		if(i==0)
			fields.checked=SelectAll.checked;
	}
}
function validateRequired(field,Msg){
	if(field==null)
		return true;
	try{
		if(trim(field.value)==""){
			alert(Msg);
			field.focus();
			return false;
		}
	}catch(e){
		try{
			if(field.options.selectedIndex==0){
				alert(Msg);
				field.focus();
				return false;
			}
		}
		catch(ee){return false;}
	}
	return true;
}
function validateInt(field,Msg){
	if(field.value!="" && (isNaN(field.value) || (field.value!=parseInt(field.value)) )){
		alert(Msg);
		field.focus();
		return false;
	}
	return true;
}

function validateNumeric(field,Msg){
	if(field.value!="" && isNaN(field.value)){
		alert(Msg);
		field.focus();
		return false;
	}
	return true;
}

function ValidateEmail(field,Msg) {
	var strEmail=field.value;
	if (strEmail=="")return;
	var blnValid;
	var goodEmail = strEmail.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	if (!goodEmail){
		alert(Msg);
		field.focus();
		return false;
	}
	return goodEmail;
}

function logOut(){
	document.login .submit ();
}

function Upload(ImagesPath,TableName,IDColumnName,IDColumnValue,ImageColumn){
	popUp(up+"admin/UploadImage.asp?ImagesPath="+ImagesPath+"&TableName="+TableName+"&IDColumnName="+IDColumnName+"&IDColumnValue="+IDColumnValue+"&ImageColumn="+ImageColumn,"_blank",0,0,250,40);
}

function rowColor(id,ON){
	if(ON)
		document.getElementById(id).style.backgroundColor ='#D6E1EB';
	else
		document.getElementById(id).style.backgroundColor ='';
}
function isAdded(combo,value){
	for(i=0;i<combo.length;i++){
		if(combo.options[i].value==value){
			return true;
			break;
		}
	}
	return false;
}
function setSelectedIDs(catlist,hiddenField){
	var cats="";
	for(i=0;i<catlist.length;i++){
		cats += catlist.options[i].value;
		if (i<catlist.length-1)
		cats += ","
	}
	hiddenField.value=cats;
}