function popup(loc,win_name,height,width,scrollbars,resizable){var has_win_name='1'
if(loc==''){has_win_name='0'}
if(!win_name){win_name='biz_new'}
if(!height){height='800'}
if(!width){width='600'}
if(!scrollbars){scrollbars='no'}
if(!resizable){resizable='no'}
if(has_win_name==1){newWin=window.open(loc,win_name,"height="+height+",width="+width+",scrollbars="+scrollbars+",resizable="+resizable+",screenx=1,screeny=1,top=1,left=1");newWin.focus();}}
function check_mer()
{f=document.merchant;var illegalChars=/[^a-zA-Z0-9_.'\s]/;var itsADigit=/[0-9.]/;var HTMLtags=/<(a|b|u|i|table|tr|td|tbody|thead|ul|li|ol)|>/;var com=/([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/;var ValidEmail=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;var Email=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.([a-zA-Z]){2,4})$/;var www=/www./;var http=/http:/;var httpwww=/http:\/\/www./;if(f.username.value=="")
{alert("You must enter username");f.username.focus();return false;}
if(f.username.value.match(illegalChars)){alert('Username contains invalid characters.');f.username.focus();return false;}
if(f.sname.value=="")
{alert("You must enter store name");f.sname.focus();return false;}
if(f.sname.value.match(illegalChars)){alert('Store name contains invalid characters.');f.sname.focus();return false;}
if(f.surl.value=="")
{alert("You must enter store URL");f.surl.focus();return false;}
if(f.surl.value.match(HTMLtags))
{alert('Store URL must be valid.');f.surl.focus();return false;}
if(!(f.surl.value.match(com)))
{alert('Store URL must be valid.');f.surl.focus();return false;}
if(f.email.value=="")
{alert("You must enter email");f.email.focus();return false;}
if(!(f.email.value.match(Email)))
{alert('Email must be valid.');f.email.focus();return false;}
if(f.cname.value=="")
{alert("You must enter contact name");f.cname.focus();return false;}
if(f.cname.value.match(illegalChars))
{alert('Contact name contains invalid characters.');f.cname.focus();return false;}
if(f.cid.value=="No"||f.cid.value==0)
{alert("You must select category id ");f.cid.focus();return false;}
if(f.csubid.value=="No"||f.csubid.value==0)
{alert("You must select sub category id");f.csubid.focus();return false;}
if(f.fcat.value=="No"||f.fcat.value==0)
{alert("You must select final category ");f.fcat.focus();return false;}
else
{return true;}}
function check_cat()
{f=document.category;if(f.cname.value=="")
{alert("Enter category name");f.cname.focus();return false;}
if(f.desc.value=="")
{alert("Enter description");f.desc.focus();return false;}
else
{return true;}}
function check_seal()
{f=document.seal;if(f.cid.value=="No"||f.cid.value==0)
{alert("You must select category id ");f.cid.focus();return false;}
if(f.csubid.value=="No"||f.csubid.value==0)
{alert("You must select sub category id ");f.csubid.focus();return false;}
if(f.fcat.value=="No"||f.fcat.value==0)
{alert("You must select final category ");f.fcat.focus();return false;}
if(f.alt.value=="")
{alert("You must enter alt tag name");f.alt.focus();return false;}
if(f.seals.value=="")
{alert("You must enter seals");f.seals.focus();return false;}
if(f.google.value=="")
{alert("You must enter google seals");f.google.focus();return false;}
if(f.yahoo.value=="")
{alert("You must enter yahoo seals");f.yahoo.focus();return false;}
if(f.msn.value=="")
{alert("You must enter msn seals");f.msn.focus();return false;}
else
{return true;}}
function check_csv()
{f=document.csv;if(f.file.value=="")
{alert("You must select csv file");f.file.focus();return false;}
else
{return true;}}
function sFormSubmit(sForm)
{alert(sForm);return document.sForm.submit();}
function m_CheckAll(sFormName)
{alert(sFormName);f=document.sFormName;alert(f);for(i=0;i<document.sFormName.elements.length;i++)
{if(document.sFormName.elements[i].type=="checkbox")
document.sFormName.elements[i].checked=document.sFormName.tickall.checked;}}
function bulkEdit_pro(){f=document.products;var illegalChars=/[^a-zA-Z0-9_\s]/;var itsADigit=/[0-9.]/;var te=/([a-zA-Z]|\s)/;if(f.price.value==""){alert("You must enter Price.");f.price.focus();return false;}
if(f.price.value!=''){if(!(f.price.value.match(itsADigit))){alert('Price not a digit');f.price.focus();return false;}}
if(f.shippingprice.value==""){alert("You must enter Shipping Price.");f.shippingprice.focus();return false;}
if(f.shippingprice.value!=''){if(!(f.shippingprice.value.match(itsADigit))){alert('Shipping price not a digit');return false;}}
if(f.mcat.value=="No")
{alert("You must select main category ");f.mcat.focus();return false;}
if(f.scat.value=="No"||f.scat.value==0)
{alert("You must select sub category ");f.scat.focus();return false;}
if(f.fcat.value=="No"||f.fcat.value==0)
{alert("You must select final category ");f.fcat.focus();return false;}
else
{return true;}}
function check_admin_pro()
{f=document.products;var illegalChars=/[^a-zA-Z0-9_\s]/;var itsADigit=/[0-9.]/;var te=/([a-zA-Z]|\s)/;if(f.price.value==""){alert("You must enter Price.");f.price.focus();return false;}
if(f.price.value!=''){if(!(f.price.value.match(itsADigit))){alert('Price not a digit');f.price.focus();return false;}}
if(f.shippingprice.value==""){alert("You must enter Shipping Price.");f.shippingprice.focus();return false;}
if(f.shippingprice.value!=''){if(!(f.shippingprice.value.match(itsADigit))){alert('Shipping price not a digit');return false;}}
if(f.mcat.value!="No")
{if(f.scat.value=="No"||f.scat.value==0){alert("You must select sub category ");f.scat.focus();return false;}
if(f.fcat.value=="No"||f.fcat.value==0){alert("You must select final category ");f.fcat.focus();return false;}}
else
{return true;}}
function check_pro()
{f=document.products;var illegalChars=/[^a-zA-Z0-9_.\-+()\s]/;var com=/([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/;var itsADigit=/[0-9.,$]+/;var HTMLtags=/<(a|b|u|i|table|tr|td|tbody|thead|ul|li|ol)/;if(f.title.value=="")
{alert("Title cannot be empty. Please enter a valid title.");f.title.focus();return false;}
if(f.title.value.match(illegalChars)){alert('Title contains invalid characters.');f.title.focus();return false;}
if(f.stitle.value!="")
{if(f.stitle.value.match(illegalChars)){alert('Sub Title has a invalid characters, even html tags are not allowed, remove them.');f.stitle.focus();return false;}}
if(f.desc.value.match('<a href')){alert('Description has hyperlinks, remove them.');f.desc.focus();return false;}
if(f.desc.value.match('</a')){alert('Description has invalid text, remove them.');f.desc.focus();return false;}
if(f.price.value=="")
{alert("You must enter price");f.price.focus();return false;}
if(f.price.value==0)
{alert("Price cannot be ZERO");f.price.focus();return false;}
if(!(f.price.value.match(itsADigit))){alert('Price not a digit');f.price.focus();return false;}
if(f.shippingprice.value=="")
{alert("You must enter shipping price");f.shippingprice.focus();return false;}
if(isNaN(f.shippingprice.value)){alert('Shipping price is not in digits');f.shippingprice.focus();return false;}
if(f.shippingprice.value==0)
{alert("Shipping price cannot be ZERO");f.shippingprice.focus();return false;}
if(!(f.shippingprice.value.match(itsADigit))){alert('Shipping price is not in digits');f.shippingprice.focus();return false;}
if(f.url.value.match('<a href')){alert('Enter the url.');f.url.focus();return false;}
if(f.purl.value=="")
{alert("You must enter Product URL.");f.purl.focus();return false;}
var urlRegExp=/^(((ht|f)tp(s?))\:\/\/){0,1}([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/;if(!(f.purl.value.match(urlRegExp))){alert('Enter a valid URL.');f.purl.focus();return false;}
if(f.mcat.value=="No")
{alert("You must select main category ");f.mcat.focus();return false;}
if(f.scat.value=="No"||f.scat.value==0)
{alert("You must select sub category ");f.scat.focus();return false;}
if(f.fcat.value=="No"||f.fcat.value==0)
{alert("You must select final category ");f.fcat.focus();return false;}
if(f.ppcbid.value!=""){if(isNaN(f.ppcbid.value)){alert('Product per click bid price is not a digit. Enter proper value.');f.ppcbid.focus();return false;}
if(!(f.ppcbid.value.match(itsADigit))){alert('Product per click bid price is not a digit. Enter proper value.');f.ppcbid.focus();return false;}}
else
{return true;}}
