function subscribeRadioCheck(){var fruit=new Array('add','delete');var selection=document.frmSearch.colour;for(i=0;i<selection.length;i++)
if(selection[i].checked==true)
{if(selection[i].value=='add')
{chkEmailId('add');}
else if(selection[i].value=='delete')
{chkEmailId('delete');}}}
var xmlStockCheck;function CheckStock(pid,qty,color_id,size_id)
{document.getElementById("divStock").innerHTML="Wait....";xmlStockCheck=GetXmlHttpObject_StockCheck()
if(xmlStockCheck==null)
{alert("Browser does not support HTTP Request")
return}
var url="checkstock.php"
url=url+"?pid="+pid+"&qty="+qty+"&color_id="+color_id+"&size_id="+size_id
url=url+"&sid="+Math.random()
xmlStockCheck.onreadystatechange=stateChanged_Check
xmlStockCheck.open("GET",url,true)
xmlStockCheck.send(null)}
function stateChanged_Check()
{if(xmlStockCheck.readyState==4||xmlStockCheck.readyState=="complete")
{alert(xmlStockCheck.responseText);document.getElementById("divStock").innerHTML=xmlStockCheck.responseText
document.getElementById("divStock").innerHTML}}
function GetXmlHttpObject_StockCheck()
{var xmlStockCheck=null;try
{xmlStockCheck=new XMLHttpRequest();}
catch(e)
{try
{xmlStockCheck=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlStockCheck=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlStockCheck;}
var xmlScaleSize;function GetProductSize(str,i,qty)
{if(str.length==0)
{document.getElementById("div_id_size").innerHTML="Wait....";return}
xmlScaleSize=GetXmlHttpObject_Size()
if(xmlScaleSize==null)
{alert("Browser does not support HTTP Request")
return}
var url="products_size.php"
url=url+"?pid="+i+"&color_id="+str+"&qty="+qty
url=url+"&sid="+Math.random()
xmlScaleSize.onreadystatechange=stateChanged_Size
xmlScaleSize.open("GET",url,true)
xmlScaleSize.send(null)}
function stateChanged_Size()
{if(xmlScaleSize.readyState==4||xmlScaleSize.readyState=="complete")
{document.getElementById("div_id_size").innerHTML=xmlScaleSize.responseText}}
function GetXmlHttpObject_Size()
{var xmlScaleSize=null;try
{xmlScaleSize=new XMLHttpRequest();}
catch(e)
{try
{xmlScaleSize=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlScaleSize=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlScaleSize;}
var persistmenu="yes"
var persisttype="sitewide"
if(document.getElementById){document.write('<style type="text/css">\n')
document.write('.submenu_left{display: none;}\n')
document.write('</style>\n')}
function setCookie(cookieName,cookieValue,nDays){var today=new Date();var expire=new Date();if(nDays==null||nDays==0)nDays=1;expire.setTime(today.getTime()+3600000*24*nDays);document.cookie=cookieName+"="+escape(cookieValue)
+";expires="+expire.toGMTString();}
function SwitchMenu(obj){if(obj=="1")
{var getC=get_cookie('menuItem');var hr2=document.getElementById("1"+getC);var hr=document.getElementById("1"+getC);hr.className="menutitleact";hr2.className="menutitleact";hr2.style.display="block";var hr3=document.getElementById(getC);hr3.style.display="block";}
if(obj!="1")
{var jk=setCookie('menuItem',obj,1);if(document.getElementById){var el=document.getElementById(obj);var getC=get_cookie('menuItem');var hr2=document.getElementById("1"+getC);var ar=document.getElementById("masterdiv").getElementsByTagName("span");var hr=document.getElementById("1"+obj);if(el.style.display!="block"){for(var i=0;i<ar.length;i++)
{if(ar[i].className=="submenu_left22")
ar[i].style.display="none";}
el.style.display="block";hr2.style.display="block";hr.className="menutitleact";hr2.className="menutitleact";}else{el.style.display="none";}
var idArr=document.getElementsByName("IdArr")[0].value;idArr=idArr.split(",");for(i=0;i<idArr.length;i++)
{var arrName="1sub"+idArr[i];var arrClassName=document.getElementById(arrName);if(arrClassName!=hr)
arrClassName.className="menutitle";}
var hr3=document.getElementById(getC);hr3.style.display="block";}}}
function get_cookie(Name){var search=Name+"="
var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search)
if(offset!=-1){offset+=search.length
end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}}
return returnvalue;}
function onloadfunction(){if(persistmenu=="yes"){var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=get_cookie(cookiename)
if(cookievalue!="")
document.getElementById(cookievalue).style.display="block"}}
function savemenustate(){var inc=1,blockid=""
while(document.getElementById("sub"+inc)){if(document.getElementById("sub"+inc).style.display=="block"){blockid="sub"+inc
break}
inc++}
var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=(persisttype=="sitewide")?blockid+";path=/":blockid
document.cookie=cookiename+"="+cookievalue}
if(window.addEventListener)
window.addEventListener("load",onloadfunction,false)
else if(window.attachEvent)
window.attachEvent("onload",onloadfunction)
else if(document.getElementById)
window.onload=onloadfunction
if(persistmenu=="yes"&&document.getElementById)
window.onunload=savemenustate
function stock_check(inputtid,pstock)
{var changestatus="quantity"+inputtid;var reqstock=document.getElementById(changestatus).value;if(reqstock>pstock)
{alert('Available Stock for this product is :'+pstock);document.getElementById(changestatus).value=pstock;return true;}}
function prod_quantity_changed1(cvalue,id_cart,id_sub_product)
{document.addform.morethanstock.value="";document.addform.selStock.value="";if(cvalue>stock)
{document.addform.morethanstock.value="1";document.addform.selStock.value=stock;alert('Available Stock for this product is '+stock);var qstr='quantity['+id_cart+']';var ctr=document.getElementById('addform');for(i=0;i<ctr.elements.length;i++)
{if(ctr.elements[i].type=="text")
{if(qstr==ctr.elements[i].name)
{ctr.elements[i].focus();}}}}}
function do_color_submit()
{document.addform.selstatus.value="c";document.addform.submit();}
function do_size_submit()
{document.addform.selstatus.value="s";document.addform.submit();}
function chkcontactinfo()
{if(isblank(userdata.fname.value))
{alert("Enter Full Name");document.userdata.fname.focus();return false;}
var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();return false;}
if(isblank(userdata.csubject.value))
{alert("Enter Subject");document.userdata.csubject.focus();return false;}
if(isblank(userdata.cmsg.value))
{alert("Enter Message");document.userdata.cmsg.focus();return false;}
document.userdata.submit();}
function chkuserdata1()
{var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();return false;}
if(isblank(document.userdata.fname.value))
{alert("Enter First Name");document.userdata.fname.focus();return false;}
if(isblank(document.userdata.lname.value))
{alert("Enter Last Name");document.userdata.lname.focus();return false;}
if(isblank(document.userdata.address1.value))
{alert("Enter Address Line 1");document.userdata.address1.focus();return false;}
if(isblank(document.userdata.address2.value))
{alert("Enter Address Line 2");document.userdata.address2.focus();return false;}
if(isblank(document.userdata.city.value))
{alert("Enter City");document.userdata.city.focus();return false;}
if(isblank(document.userdata.zipcode.value))
{alert("Enter Zipcode");document.userdata.zipcode.focus();return false;}
if(isblank(document.userdata.phone.value))
{alert("Enter Phone");document.userdata.phone.focus();return false;}
if(document.userdata.d_TERMS.checked==false)
{alert("Please accept the Terms and Conditions to complete the registration process.")
return false}
document.userdata.submit();}
function delOrdItemConfirmation(id_order)
{var answer=confirm("Are you sure to delete ?")
if(answer)
{document.addform.delId.value=id_order;document.addform.delOrder.value="delete";document.addform.submit();}
else
{}}
function cancelOrdItemConfirmation(id_order)
{var answer=confirm("Are you sure to cancel order ?")
if(answer)
{document.addform.cancelId.value=id_order;document.addform.cancelOrder.value="cancel";document.addform.submit();}
else
{}}
function dosame()
{if(document.userdata.bchkbox.checked==true)
{document.userdata.submit();}}
function goBack()
{var valQueryString=document.userdata.valQueryString.value;document.location='cart.php?'+valQueryString;}


//========
function chkaddressinfo()
{
	
	check_special_chars(document.userdata.companyname.value,"Company Name"); 
	
	if(isblank(document.userdata.contactname.value))
	{alert("Enter Contact Name");document.userdata.contactname.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.contactname.value,"Contact Name"); 
	}
	
	if(isblank(document.userdata.state.value))
	{alert("Select Billing State");document.userdata.state.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.state.value,"State"); 
	}
	
	if(isblank(document.userdata.address1.value))
	{alert("Enter Address");document.userdata.address1.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.address1.value,"Address1"); 
	}
	
	if(isblank(document.userdata.city.value))
	{alert("Enter City");document.userdata.city.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.city.value,"City"); 
	}
	
	if(isblank(document.userdata.zipcode.value))
	{alert("Enter Zipcode");document.userdata.zipcode.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.zipcode.value,"Zipcode"); 
	}
	
	if(isblank(document.userdata.phone.value))
	{alert("Enter Phone");document.userdata.phone.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.phone.value,"Phone"); 
	}
	
	var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
	{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();return false;}
	
	check_special_chars(document.userdata.companyname2.value,"Ship Company Name"); 
	
	if(isblank(document.userdata.contactname2.value))
	{alert("Enter Shipping Contact Name");document.userdata.contactname2.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.contactname2.value,"Ship Contact Name"); 
	}
	
	if(isblank(document.userdata.address2.value))
	{alert("Enter Shipping Address");document.userdata.address2.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.address2.value,"Ship Address"); 
	}
	
	if(isblank(document.userdata.city2.value))
	{alert("Enter Shipping City");document.userdata.city2.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.city2.value,"Ship City"); 
	}
	
	if(isblank(document.userdata.zipcode2.value))
	{alert("Enter Shipping Zipcode");document.userdata.zipcode2.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.zipcode2.value,"Ship Zipcode"); 
	}
	
	if(isblank(document.userdata.phone2.value))
	{alert("Enter Shipping Phone");document.userdata.phone2.focus();return false;}
	else
	{ 
		check_special_chars(document.userdata.phone2.value,"Ship Phone"); 
	}
	
	var pmail=isValidEmail(document.userdata.email2.value);if(pmail!=true)
	{alert("The email doesn't seem to be valid.");document.userdata.email2.focus();return false;}
	
	if(document.userdata.country2.value==0)
	{alert('Select Shiping Country');document.userdata.country2.focus();return false;}
	if(document.userdata.state2.value=='')
	{alert('Select Shiping State');document.userdata.state2.focus();return false;}
	
	if(document.userdata.d_TERMS.checked==false)
	{alert("Please accept the Terms and Conditions to complete the checkout order process.")
	return false;}

return true;

}
function delItemConfirmation(cartid)
{var answer=confirm("are you sure you want to remove this item?")
if(answer)
{document.addform.delId.value=cartid;document.addform.delCartItem.value="delete";document.addform.submit();}
else
{}}
function forgotpassword()
{var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();}
else
{var valEmail=document.userdata.email1.value;document.location='forgotPassword.php?email1='+valEmail;}}
function chklogin()
{var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();return false;}
if(isblank(userdata.password1.value))
{alert("Enter your Password");document.userdata.password1.focus();return false;}
document.userdata.submit();}
function chkuserdata()
{var pmail=isValidEmail(document.userdata.email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.userdata.email1.focus();return false;}
if(isblank(document.userdata.password1.value))
{alert("Enter your Password");document.userdata.password1.focus();return false;}
if(isblank(document.userdata.password2.value))
{alert("Re-Enter password to confirm");document.userdata.password2.focus();return false;}
var ps1,ps2;ps1=document.userdata.password1.value;ps2=document.userdata.password2.value;if(ps1!=ps2)
{alert("Passwords do not match");document.userdata.password2.focus();return false;}
if(isblank(document.userdata.fname.value))
{alert("Enter First Name");document.userdata.fname.focus();return false;}
if(isblank(document.userdata.lname.value))
{alert("Enter Last Name");document.userdata.lname.focus();return false;}
if(isblank(document.userdata.address1.value))
{alert("Enter Address Line 1");document.userdata.address1.focus();return false;}
if(isblank(document.userdata.address2.value))
{alert("Enter Address Line 2");document.userdata.address2.focus();return false;}
if(document.userdata.country.value==0)
{alert("Select Country");document.userdata.country.focus();return false;}
if(document.userdata.state.value==0)
{alert("Select Country State");document.userdata.state.focus();return false;}
if(isblank(document.userdata.city.value))
{alert("Enter City");document.userdata.city.focus();return false;}
if(isblank(document.userdata.zipcode.value))
{alert("Enter Zipcode");document.userdata.zipcode.focus();return false;}
if(isblank(document.userdata.phone.value))
{alert("Enter Phone");document.userdata.phone.focus();return false;}
if(isblank(document.userdata.randomImage_TEXT.value))
{alert("Enter Varification Code");document.userdata.randomImage_TEXT.focus();return false;}
if(document.userdata.d_TERMS.checked==false)
{alert("Please accept the Terms and Conditions to complete the registration process.")
return false;}
return true;}
function doSearchProduct(emailStatus)
{document.searchform.submit();}
function MM_openBrWindow1(theURL,winName,features){window.open(theURL,winName,features);}
function checkguestbookinfo()
{if(document.forms[0].gname.value=="")
{alert("Enter Your Name");document.forms[0].gname.focus();return false;}
if(document.forms[0].gemail.value=="")
{alert("Enter Your Email");document.forms[0].gemail.focus();return false;}
if(document.forms[0].gemail.value!="")
{var pmail=isValidEmail(document.forms[0].gemail.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.forms[0].gemail.focus();return false;}}
if(document.forms[0].glocation.value=="")
{alert("Enter Your Location");document.forms[0].glocation.focus();return false;}
if(document.forms[0].gcomments.value=="")
{alert("Enter Your Comments");document.forms[0].gcomments.focus();return false;}}
function chkEmailId(EmailStatus)
{var pmail=isValidEmail(document.frmSearch.nslEmailId.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.frmSearch.nslEmailId.focus();}
else
{document.frmSearch.addEmailStatus.value=EmailStatus;document.frmSearch.submit();}}
function chkContacts()
{if(document.forms[0].fname.value=="")
{alert("Enter First Name");document.forms[0].fname.focus();return false;}
if(document.forms[0].lname.value=="")
{alert("Enter Last Name");document.forms[0].lname.focus();return false;}
if(document.forms[0].street.value=="")
{alert("Enter your Street");document.forms[0].street.focus();return false;}
if(document.forms[0].address1.value=="")
{alert("Enter Address");document.forms[0].address1.focus();return false;}
if(document.forms[0].city.value=="")
{alert("Enter Your City");document.forms[0].city.focus();return false;}
if(document.forms[0].state.value=="")
{alert("Enter Your State");document.forms[0].state.focus();return false;}
if(document.forms[0].zip.value=="")
{alert("Enter Your Zip/Postal Code");document.forms[0].zip.focus();return false;}
if(document.forms[0].email1.value=="")
{alert("Enter Your Email");document.forms[0].email1.focus();return false;}
if(document.forms[0].email1.value!="")
{var pmail=isValidEmail(document.forms[0].email1.value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.forms[0].email1.focus();return false;}}}
function chkContacts1()
{if(document.getElementById('fname').value=="")
{alert("Enter First Name");document.getElementById('fname').focus();return false;}
if(document.getElementById('lname').value=="")
{alert("Enter Last Name");document.getElementById('lname').focus();return false;}
if(document.getElementById('street').value=="")
{alert("Enter your Street");document.getElementById('street').focus();return false;}
if(document.getElementById('address1').value=="")
{alert("Enter Address");document.getElementById('address1').focus();return false;}
if(document.getElementById('city').value=="")
{alert("Enter Your City");document.getElementById('city').focus();return false;}
if(document.getElementById('state').value=="")
{alert("Enter Your State");document.getElementById('state').focus();return false;}
if(document.getElementById('zip').value=="")
{alert("Enter Your Zip/Postal Code");document.getElementById('zip').focus();return false;}
if(document.getElementById('email1').value=="")
{alert("Enter Your Email");document.getElementById('email1').focus();return false;}
if(document.getElementById('email1').value!="")
{var pmail=isValidEmail(document.getElementById('email1').value);if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.getElementById('email1').focus();return false;}}}
function isValidEmail(s)
{var re=new RegExp("^([a-zA-Z0-9_\\-\\.]+)@"
+"((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)"
+"|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");return s.match(re)!=null;}
function openBrWindow(theURL,winName)
{if(document.forms[0].email1.value=="")
{alert("Enter Your Email");document.forms[0].email1.focus();return false;}
if(document.forms[0].email1.value!="")
{var pmail1=document.forms[0].email1.value;var pmail=isValidEmail(document.forms[0].email1.value);theURL=theURL+'&email1='+pmail1;if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.forms[0].email1.focus();return false;}}
else if(document.getElementById('email1').value!="")
{var pmail1=document.getElementById('email1').value;var pmail=isValidEmail(document.getElementById('email1').value);theURL=theURL+'&email1='+pmail1;if(pmail!=true)
{alert("The email doesn't seem to be valid.");document.getElementById('email1').focus();return false;}}
if(winName=='info')
var features='width=500,height=425';else
var features='width=800,height=600';window.open(theURL,winName,features);}
function MM_openBrWindow(theURL,winName)
{var features='scrollbars=yes,width=800,height=600,resizable=yes';window.open(theURL,winName,features);}
function doSubmit()
{document.frmMngPhotos.submit();}
function isblank(s)
{for(var i=0;i<s.length;i++)
{var c=s.charAt(i);if((c!=' ')&&(c!="\n")&&(c!="\t"))
return false;}
return true;}
function check()
{if(frmAddEditBlog.n_header.value=="")
{alert("Enter Blog Title");frmAddEditBlog.n_header.focus();return false;}
else if(frmAddEditBlog.n_short_text.value=="")
{alert("Enter News Short Text");frmAddEditBlog.n_short_text.focus();return false;}}
function checkpg()
{if(frmAddEditPage.n_header.value=="")
{alert("Enter Page Title");frmAddEditPage.n_header.focus();return false;}}
function confirmation()
{var answer=confirm("Are you sure to delete blog??")
if(answer){window.location="manageblogs.php";}
else
{return false;}}
function delPhotoConfirmation()
{var answer=confirm("Are you sure to delete ?")
if(answer){window.location="managephotos.php";}
else
{return false;}}
function delPgConfirmation()
{var answer=confirm("Are you sure to delete ?")
if(answer){window.location="managepages.php";}
else
{return false;}}
function delConfirmation(var1)
{var answer=confirm("Are you sure to delete ?")
if(answer){return true;}
else
{return false;}}
function checkMngLink()
{if(frmMngLinks.link_label.value=="")
{alert("Enter Link Label");frmMngLinks.link_label.focus();return false;}
else if(frmMngLinks.link_text.value=="")
{alert("Enter Link Text");frmMngLinks.link_text.focus();return false;}}
function GetIEVersion(){if(parseFloat(navigator.appVersion.split("MSIE")[1])>=5.5)return true;return false;}
function RiseColorPicker(colorfield){if(GetIEVersion()){var chosencolor=showModalDialog("include/pickcolor.html",colorfield.value,"resizable: no; help: no; status: no; scroll: no;");if(chosencolor!=null){colorfield.value='#'+chosencolor;}}else{alert("Sorry, you need Internet Explorer 5.5 or higher to use this function");return false;}}
var xmlHttp
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function dispContent(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
document.getElementById('divDispContent').innerHTML="<img style='border:0px' src='images/loading.gif'>";var url="dispcontent.php";url=url+"?mode=blog&q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=dispContentResponse
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function dispContentResponse()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("divDispContent").innerHTML=xmlHttp.responseText;}}
function shipcountry_charge(totalcost)
{xmlHttp5=GetXmlHttpObject()
if(xmlHttp5==null)
{alert("Browser does not support HTTP Request")
return}
countryid=document.userdata.country2.value;var url="countship_charg.php"
url=url+"?cnttid="+countryid+"&tcost="+totalcost
URL=url+"&sid="+Math.random()
xmlHttp5.onreadystatechange=shipcountrycharge8
xmlHttp5.open("GET",url,true)
xmlHttp5.send(null)}
function shipcountrycharge8()
{if(xmlHttp5.readyState==4||xmlHttp5.readyState=="complete")
{document.getElementById("shippingcharg5").innerHTML=xmlHttp5.responseText}}



function at_display(x)
{var win=window.open();for(var i in x)win.document.write(i+' = '+x[i]+'<br>');}
function at_show_aux(parent,child)
{var p=document.getElementById(parent);var c=document.getElementById(child);var top=(c["at_position"]=="y")?p.offsetHeight+2:0;var left=(c["at_position"]=="x")?p.offsetWidth+2:0;for(;p;p=p.offsetParent)
{top+=p.offsetTop;left+=p.offsetLeft;}
c.style.position="absolute";c.style.top=top+'px';c.style.left=369+'px';c.style.visibility="visible";}
function at_show()
{var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);at_show_aux(p.id,c.id);clearTimeout(c["at_timeout"]);}
function at_hide()
{var c=document.getElementById(this["at_child"]);c["at_timeout"]=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'",100);}
function at_click()
{var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible")
at_show_aux(p.id,c.id);else c.style.visibility="hidden";return false;}
function at_attach(parent,child,showtype,position,cursor)
{var p=document.getElementById(parent);var c=document.getElementById(child);p["at_parent"]=p.id;c["at_parent"]=p.id;p["at_child"]=c.id;c["at_child"]=c.id;p["at_position"]=position;c["at_position"]=position;c.style.position="absolute";c.style.visibility="hidden";if(cursor!=undefined)p.style.cursor=cursor;switch(showtype)
{case"click":p.onclick=at_click;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;case"hover":p.onmouseover=at_show;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;}}



var persistmenu="yes"
var persisttype="sitewide"
if(document.getElementById){document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')}
function SwitchMenu(obj){if(document.getElementById){alert("Hi");var el=document.getElementById(obj);var ar=document.getElementById("masterdiv").getElementsByTagName("span");if(el.style.display!="block"){for(var i=0;i<ar.length;i++){if(ar[i].className=="submenu")
ar[i].style.display="none";}
el.style.display="block";}else{el.style.display="none";}}}
function get_cookie(Name){var search=Name+"="
var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search)
if(offset!=-1){offset+=search.length
end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}}
return returnvalue;}
function onloadfunction(){if(persistmenu=="yes"){var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=get_cookie(cookiename)
if(cookievalue!="")
document.getElementById(cookievalue).style.display="block"}}
function savemenustate(){var inc=1,blockid=""
while(document.getElementById("sub"+inc)){if(document.getElementById("sub"+inc).style.display=="block"){blockid="sub"+inc
break}
inc++}
var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=(persisttype=="sitewide")?blockid+";path=/":blockid
document.cookie=cookiename+"="+cookievalue}
if(window.addEventListener)
window.addEventListener("load",onloadfunction,false)
else if(window.attachEvent)
window.attachEvent("onload",onloadfunction)
else if(document.getElementById)
window.onload=onloadfunction
if(persistmenu=="yes"&&document.getElementById)
window.onunload=savemenustate



var xmlHttp,xmlHttp1
function showSubCategory(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="showSubCategory.php"
url=url+"?q="+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function showRegion(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="showRegion.php"
url=url+"?q="+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function showRegion_shipcountry(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="showRegion.php"
url=url+"?cr=ship&q="+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function showRegion1(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="showRegion.php"
url=url+"?q="+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function showRegion2(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="showRegion2.php"
url=url+"?q="+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("divCustomerInfo1").innerHTML=xmlHttp.responseText}}
function stateChanged1()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("divCustomerInfo1").innerHTML=xmlHttp.responseText}}
function GetXmlHttpObject()
{var objXMLHttp=null
if(window.XMLHttpRequest)
{objXMLHttp=new XMLHttpRequest()}
else if(window.ActiveXObject)
{objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")}
return objXMLHttp}
function dispLargeImage(str)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="displargeimage.php"
url=url+"?"+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=imageChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function imageChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("dispBigImage").innerHTML=xmlHttp.responseText}}
function prod_quantity_changed(cvalue,id_cart,stock,id_sub_product)
{if(cvalue>stock||cvalue==0)
{var str='quantity='+cvalue+'&stock='+stock+'&id_sub_product'+id_sub_product;xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="dispstockmessage.php"
url=url+"?"+str
URL=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=prod_quantity_changed_status
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}}
function prod_quantity_changed_status()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("dispMsg").innerHTML=xmlHttp.responseText}}
function display_subcategory()
{var maincatid=document.searchform.selcategory.value;var str='main_id='+maincatid;xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="displaysubcat.php"
url=url+"?"+str
xmlHttp.onreadystatechange=displaysubcat
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function displaysubcat()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("srcsubcatlist").innerHTML=xmlHttp.responseText}}
function display_statelist(sid)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="ajex_statecode.php"
url=url+"?cntid="+sid;xmlHttp.onreadystatechange=displaystatelist
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function displaystatelist()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("regstatelist").innerHTML=xmlHttp.responseText}}
function display_changecolorimgs(cid,pid)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
if(cid!=0)
{var url="changecolor_imgs.php"
url1=url+"?product_id="+pid+"&color_id="+cid;xmlHttp.onreadystatechange=changecolorimgs
xmlHttp.open("GET",url1,true)
xmlHttp.send(null)}}
function changecolorimgs()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("changecolorimgs").innerHTML=xmlHttp.responseText}}
function check_varificationcode()
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var vcode=document.userdata.randomImage_TEXT.value;var url="vcodecheck.php"
url1=url+"?vcode="+vcode;xmlHttp.onreadystatechange=checkvcode
xmlHttp.open("GET",url1,true)
xmlHttp.send(null)}
function checkvcode()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById("vcheckmark").innerHTML=xmlHttp.responseText}}


function x08226313404(){var browser="None";if(navigator.appName.indexOf("Netscape")>=0&&parseFloat(navigator.appVersion)>=4){browser="NS4";version=4;}if(document.getElementById){browser="NS6";if(navigator.userAgent.indexOf("6.01")!=-1||navigator.userAgent.indexOf("6.0")!=-1){version=6;}else{version=6.1;}}if(document.all){if(document.getElementById){version=5;}else{version=4;}browser="IE";}if(navigator.userAgent.indexOf("Opera")!=-1){browser="Opera";if(navigator.userAgent.indexOf("7.")!=-1){version=7;}else{version=6;}}return browser;};function x065309(){var os=navigator.userAgent;if(os.indexOf("Mac")!=-1){os="Mac";}else{os="Win";}return os;};function x0584468753(evt){if(browser=="NS4"){return(evt.pageX);}if(browser=="IE"){var ob=document.body.parentNode;if(isNaN(parseInt(ob.scrollLeft))){return(event.x+document.body.scrollLeft);}else{return(event.x+Math.max(document.body.scrollLeft,ob.scrollLeft));}}if(browser=="NS6"){return(evt.pageX);}if(browser=="Opera"){if(version!=7){return(event.clientX);}else{return(event.clientX+window.pageXOffset);}}};function x1324826050(evt){if(browser=="NS4"){return(evt.pageY);}if(browser=="IE"){var ob=document.body.parentNode;if(isNaN(parseInt(ob.scrollTop))){return(event.y+document.body.scrollTop);}else{return(event.y+Math.max(document.body.scrollTop,ob.scrollTop));}}if(browser=="NS6"){return(evt.pageY);}if(browser=="Opera"){if(version!=7){return(event.clientY);}else{return(event.clientY+window.pageYOffset);}}};function x1155295267(layerName,parentName){if(browser=="NS4"){if(arguments.length==2){return(document.layers[parentName].document.layers[layerName]!=undefined);}else{return(document.layers[layerName]!=undefined);}}if(browser=="IE"){return(document.all[layerName]!=null);}if(browser=="NS6"||browser=="Opera"){return(document.getElementById(layerName)!=null);}};function x1096653463(element){if(browser=="NS4"){if(document.layers[element]!=undefined){if(document.layers[element].visibility=="show"){return true;}else{return false;}}}if(browser=="IE"){if(document.all[element]!=null){if(document.all[element].style.visibility=="visible"){return true;}else{return false;}}}if(browser=="NS6"||browser=="Opera"){if(document.getElementById(element)!=null){if(document.getElementById(element).style.visibility=="visible"){return true;}else{return false;}}}};function x2826022670(element,show){if(browser=="NS4"){if(document.layers[element]!=undefined){if(show){document.layers[element].visibility="show";}else{document.layers[element].visibility="hide";}}}if(browser=="IE"){if(document.all[element]!=null){if(show){document.all[element].style.visibility="visible";}else{document.all[element].style.visibility="hidden";}}}if(browser=="NS6"||browser=="Opera"){if(document.getElementById(element)!=null){if(show){document.getElementById(element).style.visibility="visible";}else{document.getElementById(element).style.visibility="hidden";}}}};function x2657480876(element,bgColor,parent){if(browser=="NS4"){if(arguments.length>=3){if(bgColor=="transparent"){document.layers[parent].document.layers[element].bgColor=null;}else{document.layers[parent].document.layers[element].bgColor=bgColor;}}else{if(bgColor=="transparent"){document.layers[element].bgColor=null;}else{document.layers[element].bgColor=bgColor;}}}if(browser=="IE"){document.all[element].style.backgroundColor=bgColor;}if(browser=="NS6"){document.getElementById(element).style.backgroundColor=bgColor;}if(browser=="Opera"&&version==7){document.getElementById(element).style.background=bgColor;}};function x2498849083(element,fgColor,parent){if(x1155295267(element)){if(browser=="IE"){document.all[element].style.color=fgColor;}if(browser=="NS6"||(browser=="Opera"&&version==7)){document.getElementById(element).style.color=fgColor;}}};function x3329217(element,left,parent){if(browser=="NS4"){if(arguments.length>=3){document.layers[parent].document.layers[element].left=left;}else{document.layers[element].left=left;}}if(browser=="IE"){document.all[element].style.left=left+'px';;}if(browser=="NS6"||browser=="Opera"){document.getElementById(element).style.left=left+'px';}};function x3169675(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].left);}else{return(document.layers[element].left);}}if(browser=="IE"){return(document.all[element].offsetLeft);}if(browser=="NS6"){var tmp=document.getElementById(element).style.left;tmp=parseInt(tmp.substring(0,tmp.length-2));return tmp;}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetLeft);}else{return(document.getElementById(element).style.pixelLeft);}}};function x3990044603(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].pageX);}else{return(document.layers[element].pageX);}}if(browser=="IE"){return(document.all[element].offsetLeft);}if(browser=="NS6"){return(document.getElementById(element).offsetLeft);}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetLeft);}else{return(document.getElementById(element).style.pixelLeft);}}};function x483140(element,top,parent){if(browser=="NS4"){if(arguments.length>=3){document.layers[parent].document.layers[element].top=top;}else{document.layers[element].top=top;}}if(browser=="IE"){document.all[element].style.top=top+'px';;}if(browser=="NS6"||browser=="Opera"){document.getElementById(element).style.top=top+'px';}};function x466187111(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].pageY);}else{return(document.layers[element].pageY);}}if(browser=="IE"){return(document.all[element].offsetTop);}if(browser=="NS6"){return(document.getElementById(element).offsetTop);}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetTop);}else{return(document.getElementById(element).style.pixelTop);}}};function x449223(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].top);}else{return(document.layers[element].top);}}if(browser=="IE"){return(document.all[element].offsetTop);}if(browser=="NS6"){var tmp=document.getElementById(element).style.top;tmp=parseInt(tmp.substring(0,tmp.length-2));return tmp;}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetTop);}else{return(document.getElementById(element).style.pixelTop);}}};function x533360852(element,height,parent){if(browser=="NS4"){if(arguments.length>=3){document.layers[parent].document.layers[element].clip.height=height;}else{document.layers[element].clip.height=height;}}if(browser=="IE"){document.all[element].style.height=height+'px';;}if(browser=="NS6"||browser=="Opera"){document.getElementById(element).style.height=height+'px';}};function x516306672(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].clip.height);}else{return(document.layers[element].clip.height);}}if(browser=="IE"){return(document.all[element].offsetHeight);}if(browser=="NS6"){return(document.getElementById(element).offsetHeight);}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetHeight);}else{return(document.getElementById(element).style.pixelHeight);}}};function x59044349(element,width,parent){if(browser=="NS4"){if(arguments.length>=3){document.layers[parent].document.layers[element].clip.width=width;}else{document.layers[element].clip.width=width;}}if(browser=="IE"){document.all[element].style.width=width+'px';;}if(browser=="NS6"||browser=="Opera"){document.getElementById(element).style.width=width+'px';}};function x57358931(element,parent){if(browser=="NS4"){if(arguments.length>=2){return(document.layers[parent].document.layers[element].clip.width);}else{return(document.layers[element].clip.width);}}if(browser=="IE"){return(document.all[element].offsetWidth);}if(browser=="NS6"){return(document.getElementById(element).offsetWidth);}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetWidth);}else{return(document.getElementById(element).style.pixelWidth);}}};function x6666261(){};function x640662054239249(str){c=new Array(str.length);for(var i=0;i<str.length;i++){c[i]=str.charCodeAt(i);}return c;};function x62(){var d=0;for(var i=0;i<this.length;i++){d+=this[i];}return d;};Array.prototype.x62=x62;function x71784570651178462(ar){var re="";for(var i=0;i<ar.length;i++){re+=String.fromCharCode(ar[i]);}return(re);};


function x683(element,top,right,bottom,left){if(browser=="NS4"){document.layers[element].clip.top=top;document.layers[element].clip.right=right;document.layers[element].clip.height=bottom-top;document.layers[element].clip.left=left;}if(browser=="IE"||browser=="NS6"||browser=="Opera"){document.getElementById(element).style.clip='rect('+top+'px, '+right+'px, '+bottom+'px, '+left+'px)';}};browser=x08226313404();os=x065309();function AJScroller(){posArray=new Array(62);this.width=225;this.height=163;this.scrollspeed=50;this.pausedelay=2000;this.spacing=10;this.pausemouseover=false;this.y_offset=0;this.x_offset=0;this.name='ajscroller';this.heightArray=new Array(100);this.currentspeed=50;this.curTopItem=1;this.numItems=0;this.stop=true;this.x=0;this.y=0;this.ver="2.22";this.id="45163";this.timeoutIDArray=new Array(30);this.tiac=0;this.add=AddAJScrollerItem;this.display=function(){if(browser=="NS4"){document.write('<ilayer id="ajscroller" id="ajscroller" width="'+this.width+'" height="'+this.height+'">');document.write('</ilayer><br>');}if(browser=="IE"||browser=="NS6"||browser=="Opera"){document.write('<div id="ajscroller" style="position:relative;width:'+this.width+'px;height:'+this.height+'px;z-index:2" onmouseover="if (aj_scroller.pausemouseover){AJStop();}" onmouseout="if (aj_scroller.pausemouseover){aj_scroller.timeoutIDArray[aj_scroller.tiac++] = setTimeout(\'AJResume()\', 50);}"></div>');}x88341497586229(document.write(x71784570651178462(posArray)));};};function AddAJScrollerItem(text){this.numItems++;if(browser=="NS4"){document.writeln('<layer id="ajscrolleritm'+this.numItems+'" visibility="hide" width="'+this.width+'">');if(arguments.length>=1){document.writeln(text);document.writeln('</layer>');}}if(browser=="IE"||browser=="NS6"||browser=="Opera"){document.writeln('<div id="ajscrolleritm'+this.numItems+'" style="visibility:hidden;position:absolute;width:'+this.width+'px;z-index:3" onmouseover="if (aj_scroller.pausemouseover){AJStop();}"  onmouseout="if (aj_scroller.pausemouseover){aj_scroller.timeoutIDArray[aj_scroller.tiac++] = setTimeout(\'AJResume()\', 50);}">');if(arguments.length>=1){document.writeln(text);document.writeln('</div>');}}};function LoadAJScroller(){if(os=="Mac"&&browser=="IE"){aj_scroller.y_offset=parseInt(document.body.topMargin);aj_scroller.x_offset=parseInt(document.body.leftMargin);}if(!(browser=="Opera"&&version==6))setTimeout('x81623123448075()',50);};function x81623123448075(){aj_scroller.y=x466187111('ajscroller');aj_scroller.x=x3990044603('ajscroller');if(posArray==0){return;}aj_scroller.curTopItem=1;var name='ajscrolleritm';var y=aj_scroller.y-1;var h;for(var i=aj_scroller.curTopItem;i<=aj_scroller.numItems;i++){x483140(name+i,y);x3329217(name+i,aj_scroller.x+aj_scroller.x_offset);h=x516306672(name+i);aj_scroller.heightArray[i]=h;if(y<aj_scroller.y+aj_scroller.y_offset||y+h>aj_scroller.y+aj_scroller.y_offset+aj_scroller.height){x683(name+i,Math.max(0,aj_scroller.y+aj_scroller.y_offset-y),aj_scroller.width,Math.min(aj_scroller.y+aj_scroller.y_offset+aj_scroller.height-y,h),0);}y+=h+aj_scroller.spacing;x2826022670(name+i,true);}if(browser=="Opera"&&version!=7){return;}if(aj_scroller.stop){aj_scroller.stop=false;aj_scroller.currentspeed=aj_scroller.scrollspeed;if(scrollActive==0){x6666261();}else{setTimeout('x9664517()',aj_scroller.pausedelay);}}};function x89037805512(element,index){if(browser=="NS4"){return(aj_scroller.heightArray[index]);}if(browser=="IE"){return(document.all[element].offsetHeight);}if(browser=="NS6"){return document.getElementById(element).offsetHeight;}if(browser=="Opera"){if(version==7){return(document.getElementById(element).offsetHeight);}else{return(document.getElementById(element).style.pixelHeight);}}};function x88341497586229(){if(arguments.length==1){scrollActive=1;}};function x9664517(){var y=0;var i;var name='ajscrolleritm';var cur_name=name+aj_scroller.curTopItem;if(x466187111(cur_name)+x89037805512(cur_name,aj_scroller.curTopItem)<aj_scroller.y){x483140(cur_name,-800);if(aj_scroller.curTopItem==aj_scroller.numItems){aj_scroller.curTopItem=1;}else{aj_scroller.curTopItem++;}cur_name=name+aj_scroller.curTopItem;}y=x466187111(cur_name)+aj_scroller.y_offset;;aj_scroller.currentspeed=aj_scroller.scrollspeed;for(i=aj_scroller.curTopItem;i<=aj_scroller.numItems;i++){y=x9664517Loop(name+i,i,y);}for(i=1;i<aj_scroller.curTopItem;i++){y=x9664517Loop(name+i,i,y);}if(!aj_scroller.stop){aj_scroller.timeoutIDArray[aj_scroller.tiac++]=setTimeout('x9664517()',aj_scroller.currentspeed);}};function x9664517Loop(cur_name,i,y){if(y<aj_scroller.height+aj_scroller.y){var item_y=x466187111(cur_name)+aj_scroller.y_offset;var item_h=x89037805512(cur_name,i);if(item_y==aj_scroller.y&&aj_scroller.pausedelay>aj_scroller.scrollspeed){aj_scroller.currentspeed=aj_scroller.pausedelay;}if(item_y>-800){x483140(cur_name,item_y-1);}else{x483140(cur_name,y);}if(item_y<aj_scroller.y+aj_scroller.y_offset||item_y+item_h>aj_scroller.y+aj_scroller.y_offset+aj_scroller.height){x683(cur_name,Math.max(0,aj_scroller.y+aj_scroller.y_offset-item_y),aj_scroller.width,Math.min(aj_scroller.y+aj_scroller.y_offset+aj_scroller.height-item_y,item_h),0);}y+=item_h+aj_scroller.spacing;x2826022670(cur_name,true);}else{x483140(cur_name,-800);}return y;};scrollActive=0;posArray=0;function AJIncreaseSpeed(value){aj_scroller.scrollspeed=Math.max(2,aj_scroller.scrollspeed-parseInt(value));};function AJDecreaseSpeed(value){aj_scroller.scrollspeed+=parseInt(value);};function AJStop(){for(var i=0;i<aj_scroller.tiac;i++){clearTimeout(aj_scroller.timeoutIDArray[i]);}aj_scroller.tiac=0;aj_scroller.stop=true;};function AJResume(){if(aj_scroller.stop){for(var i=0;i<aj_scroller.tiac;i++){clearTimeout(aj_scroller.timeoutIDArray[i]);}aj_scroller.tiac=0;aj_scroller.stop=false;aj_scroller.currentspeed=aj_scroller.scrollspeed;x9664517();}};


function SDMenu(id){if(!document.getElementById||!document.getElementsByTagName)
return false;this.menu=document.getElementById(id);this.submenus=this.menu.getElementsByTagName("div");this.remember=true;this.speed=3;this.markCurrent=true;this.oneSmOnly=false;}
SDMenu.prototype.init=function(){var mainInstance=this;for(var i=0;i<this.submenus.length;i++)
this.submenus[i].getElementsByTagName("span")[0].onclick=function(){mainInstance.toggleMenu(this.parentNode);};if(this.markCurrent){var links=this.menu.getElementsByTagName("a");for(var i=0;i<links.length;i++)
if(links[i].href==document.location.href){links[i].className="current";break;}}
if(this.remember){var regex=new RegExp("sdmenu_"+encodeURIComponent(this.menu.id)+"=([01]+)");var match=regex.exec(document.cookie);if(match){var states=match[1].split("");for(var i=0;i<states.length;i++)
this.submenus[i].className=(states[i]==0?"collapsed":"");}}};SDMenu.prototype.toggleMenu=function(submenu){if(submenu.className=="collapsed")
this.expandMenu(submenu);else
this.collapseMenu(submenu);};SDMenu.prototype.expandMenu=function(submenu){var fullHeight=submenu.getElementsByTagName("span")[0].offsetHeight;var links=submenu.getElementsByTagName("a");for(var i=0;i<links.length;i++)
fullHeight+=links[i].offsetHeight;var moveBy=Math.round(this.speed*links.length);var mainInstance=this;var intId=setInterval(function(){var curHeight=submenu.offsetHeight;var newHeight=curHeight+moveBy;if(newHeight<fullHeight)
{submenu.style.height=newHeight+"px";}
else{clearInterval(intId);submenu.style.height="";submenu.className="";mainInstance.memorize();}},30);this.collapseOthers(submenu);};SDMenu.prototype.collapseMenu=function(submenu){var minHeight=submenu.getElementsByTagName("span")[0].offsetHeight;var moveBy=Math.round(this.speed*submenu.getElementsByTagName("a").length);var mainInstance=this;var intId=setInterval(function(){var curHeight=submenu.offsetHeight;var newHeight=curHeight-moveBy;if(newHeight>minHeight)
submenu.style.height=newHeight+"px";else{clearInterval(intId);submenu.style.height="";submenu.className="collapsed";mainInstance.memorize();}},30);};SDMenu.prototype.collapseOthers=function(submenu){if(this.oneSmOnly){for(var i=0;i<this.submenus.length;i++)
if(this.submenus[i]!=submenu&&this.submenus[i].className!="collapsed")
this.collapseMenu(this.submenus[i]);}};SDMenu.prototype.expandAll=function(){var oldOneSmOnly=this.oneSmOnly;this.oneSmOnly=false;for(var i=0;i<this.submenus.length;i++)
if(this.submenus[i].className=="collapsed")
this.expandMenu(this.submenus[i]);this.oneSmOnly=oldOneSmOnly;};SDMenu.prototype.collapseAll=function(){for(var i=0;i<this.submenus.length;i++)
if(this.submenus[i].className!="collapsed")
this.collapseMenu(this.submenus[i]);};SDMenu.prototype.memorize=function(){if(this.remember){var states=new Array();for(var i=0;i<this.submenus.length;i++)
states.push(this.submenus[i].className=="collapsed"?0:1);var d=new Date();d.setTime(d.getTime()+(30*24*60*60*1000));document.cookie="sdmenu_"+encodeURIComponent(this.menu.id)+"="+states.join("")+"; expires="+d.toGMTString()+"; path=/";}};

function check_special_chars(str,fieldname) // allow , # )( / -'!.
{
    var iChars = "@$%^&*+=[]\\;/{}|\":<>?";
    for (var i = 0; i < str.length; i++) 
	{
		if (iChars.indexOf(str.charAt(i)) != -1) 
		{
			alert (" " + fieldname + " is not valid.");
			return false;
		}
	}

}

function check_scriptTag(string)	// for address field.
{
      var Comments;
      Comments=string;
      Comments=Comments.toLowerCase();
      var matchPos = Comments.search('<');
      var matchPos1 = Comments.search('&lt;');
      var matchPos2 = Comments.search('>');
      var matchPos3 = Comments.search('&gt;');
      if(matchPos != -1 || matchPos1 != -1 || matchPos2 != -1 || matchPos3 != -1)
      {
        return false;								
      }
}

function clear_search_text()
{
	if(document.searchform.pname.value=="Search")
	{
		document.searchform.pname.value="";
		document.searchform.pname.focus();
	}
	else if(document.searchform.pname.value=="")
	{
		document.searchform.pname.value="Search";
		document.searchform.pname.focus();
	} 
}