//************** CMT FUNCTIONS ****************************curMode = "HTML";var normal = new Image();var html = new Image();normal.src="toolimages/normalw.gif";html.src="toolimages/htmlg.gif";delete_pressed=false;function swap(){if (curMode == "HTML") {swapImages();document.frames[0].document.tbContentElement.DOM.body.innerText = document.frames[0].document.tbContentElement.DOM.body.innerHTML;document.frames[0].document.tbContentElement.DOM.body.style.fontFamily = "monospace";document.frames[0].document.tbContentElement.DOM.body.style.fontSize = "8pt";document.frames[0].document.tbContentElement.DOM.body.style.backgroundColor = "#FFFFFF";curMode="Text";} else {swapImages();document.frames[0].document.tbContentElement.DOM.body.innerHTML = document.frames[0].document.tbContentElement.DOM.body.innerText;document.frames[0].document.tbContentElement.DOM.body.style.fontFamily = "";document.frames[0].document.tbContentElement.DOM.body.style.fontSize ="";document.frames[0].document.tbContentElement.DOM.body.style.backgroundColor = "#FFFFFF";curMode="HTML";}}function swapImages(){tmp=normal.src;normal.src=document.img1.src;document.img1.src=tmp;tmp=html.src;html.src=document.img2.src;document.img2.src=tmp;}//*********************************************************function getbrowser(){ 	this.ver=navigator.appVersion	this.agent=navigator.userAgent	this.dom=document.getElementById?1:0	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;	this.ie4=(document.all && !this.dom)?1:0;	this.ie=this.ie4||this.ie5||this.ie6	this.mac=this.agent.indexOf("Mac")>-1	this.opera5=this.agent.indexOf("Opera 5")>-1	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;	this.ns4=(document.layers && !this.dom)?1:0;	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)	return this}var bw=new getbrowser()if (bw.ie4 || bw.ns4)	alert("\t!!! WARNING !!! \t\n\nThis admin panel requires IE5/NS6 or greater");function selectbtn(){var location= new String();location=document.location.href;len=location.lengthvar divid="";while(len > 0)	{	if(location.substr(len,1) == "_")		{		str=location.substr(len+1);		divid=str.split("=")[1];			break;		}	len--;	}if (divid.substr(0,3) =="btn")	{			btn = eval("document.getElementById('" + divid + "')");		btn.className='btnselect';		}}function selectmenu(menu){		if (bw.ns6)		barcount =  document.getElementById("menus").childNodes.length/2 -1;	else		barcount = document.getElementById("menus").childNodes.length - 1;				for (x=0;x<=barcount;x++)	{	 oObject = eval("document.getElementById('menu" + x + "')");	 oObject.childNodes[0].className='menu';	}	if (menu.className != "menuselect") menu.className='menuselect';}//*********************************************************************************function validate_settings(){frm = document.settings;if (frm.pass.value==''){ alert("Password can't be blank"); frm.pass.focus(); return false }if (frm.pass.value != frm.repass.value){ alert("Passwords do not match"); frm.repass.focus();return false }}//*********************************************************************************function isempty(txtvalue){txtvalue=txtvalue.replace(/\s/g,"")if (txtvalue.length > 0)     return false; else return true;}function validate_Email(){		email=frm.email.value;		// This function is used to validate a given e-mail 	// address for the proper syntax		if (email == ""){		alert("Email address can't be left empty.");		frm.email.select();		return false;	}	badStuff = ";:/,' \"\\";	for (i=0; i<badStuff.length; i++){		badCheck = badStuff.charAt(i)		if (email.indexOf(badCheck,0) != -1){			alert("Please enter a valid email address");			frm.email.select();			return false;		}	}	posOfAtSign = email.indexOf("@",1)	if (posOfAtSign == -1){		alert("Please enter a valid email address");			frm.email.select();		return false;	}	if (email.indexOf("@",posOfAtSign+1) != -1){		alert("Please enter a valid email address");			frm.email.select();		return false;	}	posOfPeriod = email.indexOf(".", posOfAtSign)	if (posOfPeriod == -1){		alert("Please enter a valid email address");			frm.email.select();		return false;	}	if (posOfPeriod+2 > email.length){		alert("Please enter a valid email address");			frm.email.select();		return false;	}	return true}   function phoneNumberCheck(ObjectName)			{			var i;			var txt = ObjectName;			var num = "";			if (txt == "") return txt;			for (i=0; i < txt.length; i++)			{			if (isDigit(txt.charAt(i))) 				num = num + txt.charAt(i);			}			return num;			}       function isDigit (c)		{  		 return ((c >= "0") && (c <= "9"))		}		function verify(){	if(confirm("Are You Sure You Want To Delete"))	return true;	else	return false;  }function Chk_Add(e){	if(e.image.value=="")	{		 alert("Please upload image ");		 e.image.select();		 return false;		}	if(e.content.value=="")	{		 alert("Please add description ");		 e.content.select();		 return false;		}}function Chk_Add(e){      if(e.category_name.value=="")      {          alert(" Please enter category name ");           e.category_name.select();          return false;              }}function Chk_AddProduct(e){    if(e.product_name.value=="")      {          alert("Please enter product name ");          e.product_name.select();          return false;            }    if(e.category_id.value=="")      {          alert("Please select category ");          e.category_id.focus();          return false;            }        }function News(e){	var frm;	var i;	var obj;	frm = document.frm;	   for(i=1;i<=frm.Counter.value;i++)   {       obj = document.getElementById("C" + i);	   if(e=="ALL")			obj.checked= true;	   else		   obj.checked= false;   }}