var errors = ""; var validworld = ""; var formobj = ""; function valid(naform){ form=document.getElementById(naform); for (i = 0; i < form.elements.length; i++) { elm=form.elements[i]; if (elm.value == "" && elm.name.indexOf("CAMPO_")>-1) { get_nom(elm); } else if(elm.name=="CAMPO_E-mail" || elm.name=="CAMPO_Email"){ if(!checkmail(elm.value)) get_nom(elm); } else if(elm.name=="CAMPO_Security" || elm.name=="Campo_Security" || elm.name=="CAMPO_Security_Image"){ //alert(validworld); if(elm.value!=validworld) get_nom(elm); } else if(elm.name=="CAMPO_Password"){ Passcheck=elm.value; } else if(elm.name=="CAMPO_Confirm_Password"){ if(elm.value!=Passcheck) get_nom(elm); } } if (errors) { alert("Please check the following fields:\n"+errors+"\nWhich are required to send your information:"); errors = ""; alerts = ""; return false; } else { return true; } } function checkmail(elmto){ tempo=true; if(elmto.indexOf("@")==-1 || elmto.charAt(0) == "." || elmto.charAt(0) == "@" || elmto.indexOf(".") == -1 || elmto.charAt(elmto.indexOf("@")+1) == "." || elmto.charAt(elmto.indexOf("@")-1) == "."){ tempo=false; } return tempo; } function get_nom(elmto){ sali="-) "; if(elmto.name.indexOf("_")>0){ /*temps=elmto.name.split("_"); for(e=0;e\n
\nFrom: (Email address) '+alert2+'
\n
\nMessage: (Optional)
\n
\n  \n'; } } } ajax.send("to="+to+"&from="+from+"&msg"+msg+"&pag="+window.location.href); } else{ elm.innerHTML= '
Email a Friend
\n
To: (Email address) '+alert1+'
\n
\nFrom: (Email address) '+alert2+'
\n
\nMessage: (Optional)
\n
\n  \n
'; } }; /** Shopping Cart **/ var nptShop_Add_ = function(){ if(arguments.length>0){ var id="id="+arguments[0]; var q="q="+arguments[1]; var size="size="+arguments[2]; var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); WinFloShow('The Cosmedic Coach Bag',response.message,"acept"); if(response.update!=""){ var elm = document.getElementById("paycont"); elm.innerHTML=response.update; } }catch(e){} } } ajax.send("addprod=true&"+id+"&"+q+"&"+size); } }; var nptShop_AddP = function(){ if(arguments.length>0){ var id=arguments[0]; var elm = document.getElementById(arguments[1]); var q=elm.value; elm = document.getElementById(arguments[2]); var size=elm.value; nptShop_Add_(id,q,size); } }; var nptShop_show = function(){ var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); alert(response.message); }catch(e){} } } ajax.send("viewprod=true"); }; var nptShop_Update = function(nump,prop,idobj){ var elm = document.getElementById(idobj); var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); //alert(response.message); //location.reload(); window.location.href=window.location.href; }catch(e){} } } ajax.send("editprod=true&nump="+nump+"&prop="+prop+"&val="+elm.value); }; var nptShop_Del = function(){ //Do you really want to delete the selected products to the car? var message = 'Are you sure you want to delete the selected products to the car?'; WinFloShow('The Cosmedic Coach Bag',message,['cancel-continue','nptShop_goDel()']); } var nptShop_goDel = function(){ var elm=document.getElementsByTagName('input'); var ids=''; var cont=0; for(var i in elm){ if(elm[i].type=="checkbox" && elm[i].checked){ if(cont>0)ids+=','; ids+=elm[i].value; cont++; } } var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); //alert(response.message); WinFloShow('The Cosmedic Coach Bag',response.message,['contunue','location.reload()']); //location.reload(); }catch(e){} } } ajax.send("delprod=true&ids="+ids); }; var WinFloClose = function(){ var bk=document.getElementById('WinFloBk'); var wind=document.getElementById('WinFlo'); bk.style.display='none'; wind.style.display='none'; }; var WinFloShow = function(tit,cont,bots){ var bk=document.getElementById('WinFloBk'); var wind=document.getElementById('WinFlo'); bk.style.display='block'; wind.style.display='block'; var title=document.getElementById('WinFloTit'); title.innerHTML = tit; var conte=document.getElementById('WinFloCont'); conte.innerHTML = cont; var butons=document.getElementById('WinFloBots'); if(typeof(bots)=="string" && bots=='acept'){ butons.innerHTML = ''; } else{ if(bots[0]=='cancel-continue'){ butons.innerHTML = '    '; } if(bots[0]=='contunue'){ butons.innerHTML = ''; } } }; //On Flas sites var nptShop_Add = function(){ if(arguments.length>0){ var id="id="+arguments[0]; var q="q="+arguments[1]; var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); WinFloShow('The Cosmedic Coach Bag',response.message,"acept"); }catch(e){} } } ajax.send("addprod=true&"+id+"&"+q); } }; var nptShop_UpdateFL = function(nump,prop,val){ var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); WinFloShow('The Cosmedic Coach Bag',response.message,"acept"); }catch(e){} } } ajax.send("editprod=true&nump="+nump+"&prop="+prop+"&val="+val+"&FlasEv=Updated"); }; var nptShop_DelF = function(ids){ ids=ids+''; //Do you really want to delete the selected products to the car? var message = 'Are you sure you want to delete the selected products to the car?'; WinFloShow('The Cosmedic Coach Bag',message,['cancel-continue','nptShop_goDelF("'+ids+'");']); } var nptShop_goDelF = function(ids){ WinFloClose(); var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); WinFloShow('The Cosmedic Coach Bag',response.message,"acept"); }catch(e){} } } ajax.send("delprod=true&ids="+ids+"&FlasEv=Deleted"); }; var npt_checkout = function(){ var ajax=nuevoAjax(); ajax.open("POST", "inc/npt_shopping.php", true); ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); ajax.onreadystatechange=function(){ if (ajax.readyState==4){ try{ var response=''; eval("response="+ajax.responseText+";"); if(response.redir=="") WinFloShow('The Cosmedic Coach Bag',''+response.message+'',"acept"); else window.location.href=response.redir; }catch(e){} } } ajax.send("checkOut=true"); };