function OpenCertDetails() 
{ 
  thewindow = window.open('https://www.ewebcart.com/sslverify/', 'anew', config='height=580,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes'); 
}

function bookmark(){
txt = "Bookmark this Page";
url = document.location;
who = document.title;
ver = navigator.appName
num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
   document.write('<A HREF="javascript:window.external.AddFavorite(url,who);"  ');
   document.write('onMouseOver=" window.status=')
   document.write("txt; return true ")
   document.write('"onMouseOut=" window.status=')
   document.write("' '; return true ")
   document.write('">'+ txt + '</')
   document.write('a>')
}else{
   txt += "  (Ctrl+D)"
   document.write(txt)
} 
}
//<input type="checkbox" name="item1" value="NAME|DESC|PRICE|SHIP|IMAGE">
//<input type="text" name="item1|quantity" value="1" size="3">

function d2h(d) {return Number(d).toString(24);}
function h2d(h) {return parseInt(h,16);}

function sendme2(titl,pricepoints){
if(document.getElementById && document.all) {a = document.getElementById('tset').elements;}
else{a = document.forms['tset'].elements;}
var p2=new Array();
// here we parse the price points
p1=pricepoints.split(",");
for(var p=0;p < p1.length; p++){
p2[p]=p1[p].split(":");
}
// now we need to count up the total number ordered
sum=0;pric=0;
for (i=0;i<a.length;i++){if(a[i].type=='text'&&Number(a[i].value)!='NaN'){sum=sum+Number(a[i].value);}}
//sum=Math.ceil(100*sum)/100;
// now we need the total price for this item
for(i=0;i<p2.length;i++) { if(eval(sum+p2[i][0])){pric=sum*p2[i][1];pric=Math.round(100*pric)/100;priceper=p2[i][1];}}
// now we need to echo the cost for testing
//alert("Count: "+sum+"nPricePer: "+priceper);
//a = document.forms["tset"].elements;
k=0;str="";
for (i=0;i<a.length;i++){
if(a[i].type=='text' && Number(a[i].value)!='NaN' && Number(a[i].value)!=0)
{
k++;
br = ((k % 5)==0)?"<br>":", ";
//str+=a[i].title.replace(/ concealer/gi,"").replace(/ color corrector/gi,"") + ":" + a[i].value+ "<br>";
if(titl == 'PETITES') str += d2h(a[i].name.replace(/i-/gi,"")) + ":" + a[i].value + br;
else str+=a[i].title.replace(/ concealer/gi,"").replace(/ color corrector/gi,"") + ":" + a[i].value+"<br>" ;
}

}
//if(k>cnt){alert("You are only allowed "+cnt+" choices.n You have "+k+".n  Please adjust."); return false}
if(!confirm("You have selected "+sum+" Items at a price of "+priceper+" each for a total of $"+pric+"\n\nClick OK to add to cart.\n\nClick Cancel to make changes.\n\n"+str.length)){return false;}
fm = '<html>Adding to Cart...<form action="http://www.ewebcart.com/cgi-bin/cart.pl" method="POST" name="tform">';
fm +='<input type="hidden" name="merchant" value="17092">';
fm +='<input type="hidden" name="add" value="Add to Cart">';

fm +='<input type="hidden" name="description" value="'+str+'">';
fm +='<input type="hidden" name="name" value="-'+titl+'-[#NOVOL#]">';
fm +='<input type="hidden" name="price" value="'+pric+'">';
fm +='<input type="hidden" name="quantity" value="1">';

fm +='</form></html>';
document.write(fm);document.forms["tform"].submit();
return false;
}







function sendme3(titl,pricepoints){
if(document.getElementById && document.all) {a = document.getElementById('tset').elements;}
else{a = document.forms['tset'].elements;}
var p2=new Array();
// here we parse the price points
p1=pricepoints.split(",");
for(var p=0;p < p1.length; p++){
p2[p]=p1[p].split(":");
}
// now we need to count up the total number ordered
sum=0;pric=0;
for (i=0;i<a.length;i++){if(a[i].type=='text'&&Number(a[i].value)!='NaN'){sum=sum+Number(a[i].value);}}
//sum=Math.ceil(100*sum)/100;
// now we need the total price for this item
for(i=0;i<p2.length;i++) { if(eval(sum+p2[i][0])){pric=sum*p2[i][1];pric=Math.round(100*pric)/100;priceper=p2[i][1];}}
// now we need to echo the cost for testing
//alert("Count: "+sum+"nPricePer: "+priceper);
//a = document.forms["tset"].elements;
k=0;str="";
for (i=0;i<a.length;i++){if(a[i].type=='text' && Number(a[i].value)!='NaN' && Number(a[i].value)!=0){k++;str+=a[i].title.replace(/ concealer/gi,"").replace(/ color corrector/gi,"") + ":" + a[i].value+ "<br>";}}
//if(k>cnt){alert("You are only allowed "+cnt+" choices.n You have "+k+".n  Please adjust."); return false}
if(!confirm("You have selected "+sum+" Items at a price of "+priceper+" each for a total of $"+pric+"\n\nClick OK to add to cart.\n\nClick Cancel to make changes.\n\n"+str.length)){return false;}
fm = '<html>Adding to Cart...<form action="http://www.ewebcart.com/cgi-bin/cart.pl" method="POST" name="tform">';
fm +='<input type="hidden" name="merchant" value="17092">';
fm +='<input type="hidden" name="add" value="Add to Cart">';
fm +='<input type="hidden" name="description" value="'+str+'">';
fm +='<input type="hidden" name="name" value="-'+titl+'-[#NOVOL#][#NOPROMO#]">';
fm +='<input type="hidden" name="price" value="'+pric+'">';
fm +='<input type="hidden" name="quantity" value="1">';
fm +='</form></html>';
document.write(fm);document.forms["tform"].submit();
return false;
}


function sendme(cnt,titl,pric){
if(document.getElementById && document.all) {a = document.getElementById('tset').elements;}
else{a = document.forms['tset'].elements;}
//a = document.forms["tset"].elements;
k=0;str="";
for (i=0;i<a.length;i++){if(a[i].type=='checkbox'&&a[i].checked==true){k++;str+=a[i].value + "<br>";}}
if(k>cnt){alert("You are only allowed "+cnt+" choices.n You have "+k+".n  Please adjust."); return false}
if(k<cnt && !confirm("You are allowed up to "+cnt+" choices.n You only have "+k+".n  Are you sure this is all you want to add?")){return false;}
fm = '<html>Adding to Cart...<form action="http://www.ewebcart.com/cgi-bin/cart.pl" method="POST" name="tform">';
fm +='<input type="hidden" name="merchant" value="17092">';
fm +='<input type="hidden" name="add" value="Add to Cart">';
fm +='<input type="hidden" name="description" value="'+str+'">';
fm +='<input type="hidden" name="name" value="-'+titl+'-[#MAXQTY:1#]">';
fm +='<input type="hidden" name="price" value="'+pric+'">';
fm +='<input type="hidden" name="quantity" value="1">';
fm +='</form></html>';
document.write(fm);document.forms["tform"].submit();
return false;
}


