function isArray(a){return Object.prototype.toString.apply(a)==='[object Array]';}
function Toggle(prefix,obj){var doc=document;for(i=1;i<=doc.getElementById(prefix+'_Links').childNodes.length;i++){var el=doc.getElementById(prefix+'_Table_'+i);if(prefix+'_Tab_'+i==obj.id){el.style.display='block';el.className='Add_Table_Active';}
else{el.style.display='none';el.className='';}}}
function Deal_Date(obj,menu){var doc=document;var id=doc.getElementById(obj.id);var menu=doc.getElementById(menu);if(id.checked==true){menu.style.display='block';}
else{menu.style.display='none';}}
function Deal_Type(id){var doc=document;switch(doc.getElementById(id).value){case'Deal':doc.getElementById('AddDeal_Deal_L_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_L_CashOff').style.display='block';doc.getElementById('AddDeal_Deal_CashOff').style.display='block';doc.getElementById('AddDeal_Deal_L_Shipping').style.display='block';doc.getElementById('AddDeal_Deal_Shipping').style.display='block';break;case'PerOff':doc.getElementById('AddDeal_Deal_L_PercentOff').style.display='block';doc.getElementById('AddDeal_Deal_PercentOff').style.display='block';doc.getElementById('AddDeal_Deal_CashOff').style.display='none';doc.getElementById('AddDeal_Deal_L_CashOff').style.display='none';doc.getElementById('AddDeal_Deal_L_Shipping').style.display='block';doc.getElementById('AddDeal_Deal_Shipping').style.display='block';break;case'CashOff':doc.getElementById('AddDeal_Deal_L_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_L_CashOff').style.display='block';doc.getElementById('AddDeal_Deal_CashOff').style.display='block';doc.getElementById('AddDeal_Deal_L_Shipping').style.display='block';doc.getElementById('AddDeal_Deal_Shipping').style.display='block';break;default:doc.getElementById('AddDeal_Deal_L_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_PercentOff').style.display='none';doc.getElementById('AddDeal_Deal_L_CashOff').style.display='none';doc.getElementById('AddDeal_Deal_CashOff').style.display='none';doc.getElementById('AddDeal_Deal_L_Shipping').style.display='none';doc.getElementById('AddDeal_Deal_Shipping').style.display='none';break;}}
function AddrBook(){var doc=document;if(doc.getElementById('To').style.display=='none'){doc.getElementById('To').style.display='block';doc.getElementById('AddrBook').style.display='none';doc.getElementById('AddrBookTog').innerHTML='Address Book';}
else{doc.getElementById('To').style.display='none';doc.getElementById('AddrBook').style.display='block';doc.getElementById('AddrBookTog').innerHTML='Address';}}
function OpenClose(id){var el=document.getElementById(id);if(el.style.display=='block'){el.setAttribute('style','display:none;');}
else{el.setAttribute('style','display:block;');}}
function OpenCloseHelp(obj,id){var el=document.getElementById(id);if(el.style.display=='block'){el.setAttribute('style','display:none;');document.getElementById(obj.id).className='HelpOpen';}
else{el.setAttribute('style','display:block;');document.getElementById(obj.id).className='HelpClose';}}
function AvControl(buttonid,id){var doc=document;var el=doc.getElementById(id);if(el.style.display=='block'){doc.getElementById(buttonid).innerHTML='change';doc.getElementById(buttonid+'_L').setAttribute('style','display:block');el.setAttribute('style','display:none;');}
else{doc.getElementById(buttonid).innerHTML='cancel';doc.getElementById(buttonid+'_L').setAttribute('style','display:none');el.setAttribute('style','display:block;');}}
function Flag(id){if(document.getElementById(id).style.display=='none'){document.getElementById(id).style.display='block';document.getElementById('Com_'+id).style.display='none';}
else{document.getElementById(id).style.display='none'
document.getElementById('Com_'+id).style.display='block';}}
function AddInlineCheck(id){var doc=document;doc.getElementById(id).setAttribute("onmousemove","InlineCheck(id);");doc.getElementById(id).setAttribute("onblur","InlineCheck(id);");}
function RemoveInlineCheck(id){document.getElementById(id).removeAttribute("onmousemove");}
function InlineCheck(id){val=document.getElementById(id).value;switch(id){case"user_name":CheckUserName(val);break;case"email":CheckEmail(val);break;case"captcha_code":CheckCaptcha(val);break;case"pass":CheckPass(val,'passMSG');break;case"Confirm_Pass":CheckPass(val,'Confirm_PassMSG');break;case"country":CheckCountry(val);break;}}
function CheckUserName(val){inlineMSG=document.getElementById('user_nameMSG');if(val!=''){if(val.search(/^[A-Za-z0-9]{1}[A-Za-z_0-9]{4,14}$/)!=-1){inlineMSG.style.display='block';inlineMSG.setAttribute('class','MSGList Check');document.getElementById('SubmitLogin').style.display='inline';document.getElementById('userunlength').style.color='';document.getElementById('userunderscore').style.color='';document.getElementById('userunchars').style.color='';document.getElementById('userunlength').style.display='none';document.getElementById('userunderscore').style.display='none';document.getElementById('userunchars').style.display='none';document.getElementById('user_nameMSGTitle').style.display='none';}
else{if(val.length<5){document.getElementById('userunlength').style.color='#FF0000';}
if(val.search(/^(_)[A-Za-z_0-9]*$/)!=-1){document.getElementById('userunderscore').style.color='#FF0000';}
if(val.search(/^[A-Za-z0-9_]+$/)==-1){document.getElementById('userunchars').style.color='#FF0000';}
inlineMSG.style.display='block';inlineMSG.setAttribute('class','MSGList X');document.getElementById('SubmitLogin').style.display='none';}}}
function CheckPass(val,MSG){inlineMSG=document.getElementById(MSG);if(val!=''){if(val.search(/^[A-Za-z0-9_!?]{5,15}$/)!=-1){inlineMSG.style.display='block';inlineMSG.innerHTML='';inlineMSG.setAttribute('class','MSGList Check');document.getElementById('SubmitLogin').style.display='inline';document.getElementById('passunlength').style.color='';document.getElementById('passunchars').style.color='';document.getElementById('passMSGTitle').style.display='none';document.getElementById('passunlength').style.display='none';document.getElementById('passunchars').style.display='none';}
else{if(val.length<5){document.getElementById('passunlength').style.color='#FF0000';}
if(val.search(/^[A-Za-z0-9_!?]+$/)==-1){document.getElementById('passunchars').style.color='#FF0000';}
inlineMSG.style.display='block';inlineMSG.setAttribute('class','MSGList X');document.getElementById('SubmitLogin').style.display='none';}}}
function CheckEmail(val){inlineMSG=document.getElementById('emailMSG');if(val!=''){if(val.search(/^[a-z0-9._%-]+@[a-z0-9.-]+\.[a-z]{2,4}$/)!=-1){inlineMSG.style.display='block';inlineMSG.innerHTML='';inlineMSG.setAttribute('class','MSGList Check');document.getElementById('SubmitLogin').style.display='inline';}
else{inlineMSG.style.display='block';inlineMSG.setAttribute('class','MSGList X');document.getElementById('SubmitLogin').style.display='none';}}}
function AddListMenu(prepend,id,linkid,formid){Formid=formid+id;if(document.getElementById(id).style.display=="none"){document.getElementById(id).style.display="";document.getElementById(linkid).style.display="none";document.getElementById(prepend+id).style.display="none";}
else{document.getElementById(id).style.display="none";document.getElementById(linkid).style.display="";document.getElementById(prepend+id).style.display="block";}}
function ShowSave(id){if(document.getElementById(id).style.display=="none"){document.getElementById(id).style.display="";}
else{document.getElementById(id).style.display="none";}}
function CloseSelectList(prepend,id,linkid){if(document.getElementById(id).style.display=="none"){document.getElementById(id).style.display="";document.getElementById(prepend+id).style.display="none";}
else{document.getElementById(id).style.display="none";document.getElementById(linkid).style.display="";document.getElementById(prepend+id).style.display="block";}}
function ListOptions(id){if(document.getElementById('CreateList'+id).style.display=='none'){document.getElementById('SelectListLabel'+id).style.display="none";document.getElementById('SelectList'+id).style.display="none";document.getElementById('SelectListLink'+id).style.display="inline";document.getElementById('CreateListLabel'+id).style.display="";document.getElementById('CreateList'+id).style.display="";document.getElementById('NewListLink'+id).style.display="none";document.getElementById('Save'+id).style.display="none";}
else{document.getElementById('SelectListLabel'+id).style.display="";document.getElementById('SelectList'+id).style.display="";document.getElementById('SelectListLink'+id).style.display="none";document.getElementById('SubmitCreateList'+id).style.display="none";document.getElementById('CreateListLabel'+id).style.display="none";document.getElementById('CreateList'+id).style.display="none";document.getElementById('NewListLink'+id).style.display="inline";}}
function CheckForSelect(id){if(!document.getElementById('SelectList'+id)){document.getElementById('SubmitCreateList'+id).style.display="none";document.getElementById('CreateListLabel'+id).style.display="";document.getElementById('CreateList'+id).style.display="";}}
function addEvent(){var doc=document;if(doc.getElementById('InputListName')){var InputListName=doc.getElementById('InputListName');InputListName.setAttribute("onblur","replaceInput(this,'InputListName'); CloseEditListName('ListForm','ListName','EditListName')");InputListName.setAttribute("onfocus","clearInput(this,'InputListName');");}
if(doc.getElementById('ListEditLink')){doc.getElementById('ListEditLink').setAttribute('href','javascript:void(0)');}
if(doc.getElementById('ListName')){var listname=doc.getElementById('ListName');listname.setAttribute("onclick","EditListName('ListName','EditListName');");}
if(doc.getElementById('SaveClose')){var SaveClose=doc.getElementById('SaveClose');SaveClose.setAttribute("onclick","CloseEditListName('ListForm','ListName','EditListName');");}}
function ShowButton(){if(document.getElementById('CloseButton')){x=document.getElementById('CloseButton');x.className=x.className.replace("Hide","Show");}}
function CloseMessage(){if(document.getElementById("MessageCenter")!=null){document.getElementById("MessageCenter").style.display="none";}}
function TimedCloseMessage(){if(document.getElementById("MessageCenter")!=null){setTimeout('document.getElementById("MessageCenter").style.display = "none"',15000);}}
function ReturnPath(Path){setTimeout("location.href=Path",500);}
function ListLink(id){if(document.getElementById(id)){Link=document.getElementById(id);Link.setAttribute('href','javascript:void(0)');}}
function EditListName(id1,id2){if(document.getElementById(id2).style.display=="none"){document.getElementById(id2).style.display="";document.getElementById(id1).style.display="none";}
else{document.getElementById(id2).style.display="none";document.getElementById(id1).style.display="";}}
function CloseEditListName(formid,id1,id2){if(document.getElementById(id1)){document.getElementById(id2).style.display="none";document.getElementById(id1).style.display="";SubmitForm(formid);}}
function AddCheckListName(id){document.getElementById('CreateList'+id).setAttribute("onmousemove","CheckListName("+id+");");document.getElementById('CreateList'+id).setAttribute("onblur","CheckListName("+id+");");}
function CheckListName(id){val=document.getElementById('CreateList'+id).value;if(val!=''){if(val.search(/^[a-zA-Z0-9'-()!?., ]{0,58}[a-zA-Z0-9!?.]$/)!=-1){document.getElementById('CreateListLabel'+id).innerHTML='New list';document.getElementById('CreateListLabel'+id).style.color='';document.getElementById('SubmitCreateList'+id).style.display='';}
else{document.getElementById('CreateListLabel'+id).innerHTML='Invalid list name';document.getElementById('CreateListLabel'+id).style.color='#FF0000';}}}
function SubmitForm(id){if(document.getElementById(id)){document.getElementById(id).submit();}}
function getHTTPObject(){var xmlhttp=false;if(typeof ActiveXObject!='undefined'){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(E){xmlhttp=false;}}}
else if(XMLHttpRequest){try{xmlhttp=new XMLHttpRequest();}
catch(e){xmlhttp=false;}}
return xmlhttp;}
function Rate(Obj,Rating,data){var doc=document;var a=Obj.id.split("_");Send(Obj,a[0],doc,data);Deactivate(Obj,Rating);}
function Send(Obj,id,doc,data){var xmlhttp=getHTTPObject();if(xmlhttp){var url="../General/HandleRatings.php";xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",Obj.title.length);xmlhttp.setRequestHeader("Connection","close");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){doc.getElementById(a[0]+"_Votes").innerHTML='Thanks!';}}
var a=Obj.id.split("_");xmlhttp.send(data+Obj.title);doc.getElementById(a[0]+"_Votes").innerHTML='Thanks!';}}
function Deactivate(Obj,Rating){var doc=document;var a=Obj.id.split("_");for(l=1;l<=5;l++){var el=doc.getElementById(a[0]+"_"+l+'_'+a[2]+'_'+a[3]);el.onclick="";el.onmouseover="";el.onmouseout="";if(Rating==0){Rating=a[1];}
if(l<=Rating){el.className="on";}
else{el.className="";}}}
function Rating(Obj){var doc=document;var x=Obj.id.split("_");var a=0;for(i=1;i<=5;i++){if(i<=x[1]){doc.getElementById(x[0]+"_"+i+'_'+x[2]+'_'+x[3]).className="on";var holder=a+1;a++;}
else{doc.getElementById(x[0]+"_"+i+'_'+x[2]+'_'+x[3]).className="";}}}
function RatingOff(Obj,Rating){var Rating=Rating;var doc=document;var a=Obj.id.split("_");for(i=1;i<=5;i++){var el=doc.getElementById(a[0]+"_"+i+'_'+a[2]+'_'+a[3]);if(i<=Rating){el.className="on";}
else{el.className="off";}}}
function Menu(obj){var doc=document;var xmlhttp=getHTTPObject();var id=obj.id.split('_');var MenuType=id[0];id=id[1];if(MenuType=='alias'){var url="http://bargaincrew.com/General/Handle_Alias_Menu.php";var prefix='Alias';var MyFunction=Alias;}
else if(MenuType=='merchant'){var url="http://bargaincrew.com/General/Handle_Merchant_Menu.php";var prefix='Merchant';var MyFunction=Merchant;}
if(xmlhttp){xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==1){doc.getElementById(prefix+'_Manage_Table_1').setAttribute('style','display:none;');doc.getElementById('loading').setAttribute('style','display:block;');}
else if(xmlhttp.readyState==4&&xmlhttp.status==200){if(window.DOMParser){parser=new DOMParser();xmlDoc=parser.parseFromString(xmlhttp.responseText,"text/xml");}
else{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(xmlhttp.responseText);}
MyFunction(doc,xmlDoc);}}
xmlhttp.send(MenuType+'='+obj.id);}}
function SendToPHP(data,MyFunction,url){var doc=document;var xmlhttp=getHTTPObject();if(xmlhttp){xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==1){}
else if(xmlhttp.readyState==4&&xmlhttp.status==200){if(window.DOMParser){parser=new DOMParser();xmlDoc=parser.parseFromString(xmlhttp.responseText,"text/xml");}
else{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(xmlhttp.responseText);}
if(MyFunction!=false){MyFunction(doc,xmlDoc);}}}
xmlhttp.send(data);}}
function Vote(doc,xmlDoc){var votes=xmlDoc.getElementsByTagName('votes');var id=xmlDoc.getElementsByTagName("id");doc.getElementById('Tup_'+id[0].childNodes[0].nodeValue).setAttribute('style','display:none;');doc.getElementById('Tdown_'+id[0].childNodes[0].nodeValue).setAttribute('style','display:none;');doc.getElementById('Votes_'+id[0].childNodes[0].nodeValue).innerHTML='Thank you! ('+votes[0].childNodes[0].nodeValue+') votes';}
function Alias(doc,xmlDoc){alias=xmlDoc.getElementsByTagName('alias');id=xmlDoc.getElementsByTagName("id");userid=xmlDoc.getElementsByTagName("userid");username=xmlDoc.getElementsByTagName("username");email=xmlDoc.getElementsByTagName('email');active=xmlDoc.getElementsByTagName("active");auth=xmlDoc.getElementsByTagName("auth");doc.getElementById('Alias_ID').innerHTML='<em>ID:</em>'+id[0].childNodes[0].nodeValue;doc.getElementById('Alias_UserID').innerHTML='<em>UserID:</em>'+userid[0].childNodes[0].nodeValue;doc.getElementById('Alias_UserName').innerHTML='<em>UserName:</em>'+username[0].childNodes[0].nodeValue;doc.getElementById('Alias_Email').innerHTML='<em>Email:</em>'+email[0].childNodes[0].nodeValue;doc.getElementById('Alias_Active').innerHTML='<em>Active:</em>'+username[0].childNodes[0].nodeValue;doc.getElementById('Alias_Auth').innerHTML='<em>Auth:</em>'+auth[0].childNodes[0].nodeValue;doc.getElementById('loading').setAttribute('style','display:none');doc.getElementById('Alias_Manage_Table_1').setAttribute('style','display:block;');doc.getElementById('Alias_Manage_Delete').setAttribute('value',id[0].childNodes[0].nodeValue);}
function Merchant(doc,xmlDoc){merchant=xmlDoc.getElementsByTagName('merchant');id=xmlDoc.getElementsByTagName("id");name=xmlDoc.getElementsByTagName("name");mer_url=xmlDoc.getElementsByTagName("url");logo=xmlDoc.getElementsByTagName("logo");doc.getElementById('Merchant_Logo').setAttribute('src',logo[0].childNodes[0].nodeValue);doc.getElementById('Merchant_Logo').style.maxHeight='50px';doc.getElementById('Merchant_Logo').style.maxWidth='50px';doc.getElementById('Merchant_ID').innerHTML='<em>ID:</em>'+id[0].childNodes[0].nodeValue;doc.getElementById('Merchant_Name').innerHTML='<em>Merchant:</em>'+name[0].childNodes[0].nodeValue;doc.getElementById('Merchant_url').innerHTML='<em>URL:</em>'+mer_url[0].childNodes[0].nodeValue;doc.getElementById('loading').style.display='none';doc.getElementById('Merchant_Manage_Table_1').style.display='block';}
var clearInputValue=Array();function clearInput(thisObj,id){if(!clearInputValue[thisObj]){document.getElementById(id).style.color="#EEE";clearInputValue[thisObj]=thisObj.value;thisObj.value="";}}
function replaceInput(thisObj,id){if(thisObj.value==""){document.getElementById(id).style.color="";thisObj.value=clearInputValue[thisObj];clearInputValue[thisObj]=false;}}
function MarkRead(id){var doc=document;var xmlhttp=getHTTPObject();if(xmlhttp){var url="http://bargaincrew.com/General/MarkRead.php";xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==1){doc.getElementById('Mark_'+id).setAttribute('style','display:none;');}
else if(xmlhttp.readyState==4&&xmlhttp.status==200){doc.getElementById('Comment_'+id).setAttribute('style','display:none;');}}
xmlhttp.send('markread='+id);}}
function SubmitDeal(obj){var doc=document;SubmitForm(id);doc.getElementById('Add_Msg').innerHTML='Deal added!';doc.getElementById('Add_Msg').style.display='block';}
function parseXML(data){if(window.DOMParser){parser=new DOMParser();xmlDoc=parser.parseFromString(data,"text/xml");}
else{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(data);}
return xmlDoc;}
function Preview(id){var doc=document;if(id=='Add_Deal_Preview'){Deal_Preview(doc);}
else{Coupon_Preview(doc);}}
function Deal_Preview(doc){var deal=new Array();deal[0]=doc.getElementById('Add_Alias').value;deal[1]=doc.getElementById('Add_Merchant').value;deal[2]=doc.getElementById('Add_Title').value;deal[3]=doc.getElementById('Add_URL').value;deal[4]=doc.getElementById('Add_Image').value;deal[5]=doc.getElementById('Add_Price').value;deal[6]=doc.getElementById('Add_Shipping').value;deal[7]='20'+doc.getElementById('From_Year').value+'-'+doc.getElementById('From_Month').value+'-'+doc.getElementById('From_Day').value+' '+doc.getElementById('From_Hour').value+':00';deal[8]='20'+doc.getElementById('To_Year').value+'-'+doc.getElementById('To_Month').value+'-'+doc.getElementById('To_Day').value+' '+doc.getElementById('To_Hour').value+':00';deal[9]=doc.getElementById('Add_Descr').value;doc.getElementById('Title_Link').setAttribute('href',deal[3]);doc.getElementById('Deal_Image').setAttribute('src',deal[4]);doc.getElementById('Add_Deal_Preview').setAttribute('style','display:block;');Resize_Image('Deal_Image',130);doc.getElementById('Title_Link').innerHTML=deal[2];doc.getElementById('Merchant_Link').innerHTML=deal[1];doc.getElementById('RetailPrice').innerHTML='<span id="RetialPrice_span" class="SalePrice">$'+deal[5]+'</span>';doc.getElementById('Shipping').innerHTML='$'+deal[6]+' shipping';doc.getElementById('Descr').innerHTML=deal[9];doc.getElementById('Add_UserID').innerHTML=deal[0];}
function Coupon_Preview(doc){var deal=new Array();deal[0]=doc.getElementById('Add_Alias').value;deal[1]=doc.getElementById('Add_Merchant').value;deal[2]=doc.getElementById('Add_Title').value;deal[3]=doc.getElementById('Add_URL').value;deal[4]=doc.getElementById('Add_Image').value;deal[7]='20'+doc.getElementById('From_Year').value+'-'+doc.getElementById('From_Month').value+'-'+doc.getElementById('From_Day').value+' '+doc.getElementById('From_Hour').value+':00';deal[8]='20'+doc.getElementById('To_Year').value+'-'+doc.getElementById('To_Month').value+'-'+doc.getElementById('To_Day').value+' '+doc.getElementById('To_Hour').value+':00';doc.getElementById('Title_Link').setAttribute('href',deal[3]);doc.getElementById('Deal_Image').setAttribute('src',deal[4]);doc.getElementById('Add_Coupon_Preview').setAttribute('style','display:block;');Resize_Image('Deal_Image',130);doc.getElementById('Title_Link').innerHTML=deal[2];doc.getElementById('Merchant_Link').innerHTML=deal[1];doc.getElementById('Add_UserID').innerHTML=deal[0];}
function Reset_Deal(){var doc=document;var check=confirm("Reset?");if(check==true){doc.getElementById('Add_Deal_Preview').setAttribute('style','display:none;');doc.getElementById('Add_Alias').value='';doc.getElementById('Add_Merchant').value='';doc.getElementById('Add_Title').value='';doc.getElementById('Add_URL').value='';doc.getElementById('Add_Image').value='';doc.getElementById('Add_Price').value='';doc.getElementById('Add_Shipping').value='';doc.getElementById('From_Year').value='';doc.getElementById('From_Month').value='';doc.getElementById('From_Day').value='';doc.getElementById('From_Hour').value='';doc.getElementById('To_Year').value='';doc.getElementById('To_Month').value='';doc.getElementById('To_Day').value='';doc.getElementById('To_Hour').value='';doc.getElementById('Add_Descr').value='';}}
function Reset_Coupon(){var doc=document;var check=confirm("Reset?");if(check==true){doc.getElementById('Add_Coupon_Preview').setAttribute('style','display:none;');doc.getElementById('Add_Alias').value='';doc.getElementById('Add_Merchant').value='';doc.getElementById('Add_Title').value='';doc.getElementById('Add_URL').value='';doc.getElementById('Add_Image').value='';doc.getElementById('Add_Price').value='';doc.getElementById('Add_Shipping').value='';doc.getElementById('From_Year').value='';doc.getElementById('From_Month').value='';doc.getElementById('From_Day').value='';doc.getElementById('From_Hour').value='';doc.getElementById('To_Year').value='';doc.getElementById('To_Month').value='';doc.getElementById('To_Day').value='';doc.getElementById('To_Hour').value='';doc.getElementById('Add_Descr').value='';}}
function Resize_Image(id,imax){var doc=document;var img=doc.getElementById(id);if(img.width>img.height){var per=(imax/img.width);}
else{var per=(imax/img.height);}
var newWidth=Math.round(img.width*per);var newHeight=Math.round(img.width*per);img.setAttribute('width',newWidth);img.setAttribute('height',newHeight);}
function Remove(id,type){var doc=document;var check=confirm("Delete "+type+"?");if(check==true){SendToPHP('delete='+type+'&id='+id,false,'http://bargaincrew.com/General/Remove.php');}}