var zxcBlankImg='images/space.gif';
var zxcOOPCnt=0;
function zxcZoomText(zxcobj,zxcssz,zxcfsz,zxcspd){
 if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(obj); }
 if (!zxcobj.oopct){
  zxcspd=zxcspd||100;
  if (zxcBlankImg){ zxcobj.style.backgroundImage='url('+zxcBlankImg+')'; }
  zxcobj.oopct=new zxcOOPTxtZoom(zxcobj,zxcssz,zxcfsz,zxcspd);
 }
 clearTimeout(zxcobj.oopct.to);
 zxcobj.oopct.minmax[4]*=-1;
 zxcobj.oopct.cngtxt();
}
function zxcOOPTxtZoom(zxcobj,zxcssz,zxcfsz,zxcspd){
 this.obj=zxcobj;
 if (zxcobj.style.position){
  if (zxcobj.style.position='absolute'){
   this.abs=[zxcobj.offsetLeft,zxcobj.offsetWidth];
  }
 }
 this.ref='zxcoopct'+zxcOOPCnt++;
 window[this.ref]=this;
 this.minmax=[zxcssz,Math.min(zxcssz,zxcfsz),Math.max(zxcssz,zxcfsz),zxcspd,(zxcssz<zxcfsz)?-1:1];
 this.to=null;
}
zxcOOPTxtZoom.prototype.cngtxt=function(){
 if ((this.minmax[4]>0&&this.minmax[0]<this.minmax[2])||(this.minmax[4]<0&&this.minmax[0]>this.minmax[1])){
  this.obj.style.fontSize=(this.minmax[0]+=this.minmax[4])+'px';
  if (this.abs){
   this.obj.parentNode.style.width=(this.obj.offsetWidth+parseInt(this.obj.style.fontSize))+'px';
   this.obj.parentNode.style.left=(parseInt(this.obj.style.fontSize)/2)+'px';
  }
  this.to=this.setTimeOut('cngtxt();',this.minmax[3]);
 }
}

zxcOOPTxtZoom.prototype.setTimeOut=function(zxcf,zxcd){
 this.to=setTimeout('window.'+this.ref+'.'+zxcf,zxcd);
}
//-->

function open_this() {
	window.open('http://www.iwantmeds.com/abt_gen.php','','width=620 height=450 top=100 left=200 scrollbars=1 statusbar=0 toolbars=0 resizable=yes');
}

function open_win() {
	window.open('http://www.iwantmeds.com/whycheap.php','','width=550 height=200 top=100 left=200 scrollbars=1 statusbar=0 toolbars=0 resizable=yes');
}

function open_win1() {
	window.open('http://www.iwantmeds.com/garauntee.php','','width=420 height=100 top=50 left=200 scrollbars=1 statusbar=0 toolbars=0 resizable=yes');
}

function validate_form() {
	d=document.form1

	if(d.txtemail.value=="") {
		alert("Please Enter Email");
		d.txtemail.focus();
		return false;
	}
	
	if(d.txtpwd.value=="") {
		alert("Please Enter Password");
		d.txtpwd.focus();
		return false;
	}
}

function validate() {
	if(document.pass.hint.value=="") {
		alert("please enter Hint");
		document.pass.hint.focus();
		return false;
	}

	if((!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.pass.email.value)))) {
		alert ("Please Enter Your Email address in abc@xyz.com");
		document.pass.email.focus;
		return(false);
	}
}

var xx
var j
j=0

function myfun() {
	var agree;
	for(i=0;i<document.del.length;++i) {
		if (document.del.elements[i].value == "1") {
			if (document.del.elements[i].checked) {
				j=j+1;
				agree = true;
				
				if (j == 1)
					xx =document.del.elements[i].name;
				else
					xx = xx + "," + document.del.elements[i].name ;
			}
		}
	}
	document.del.delvalue.value=xx;
	if (agree) return confirm("Are You sure you want to delete this items?");
	return false ;
}

function checkall() {
	for(i=0;i<document.del.elements.length;i++) document.del.elements[i].checked=document.del.chk.checked; //check or uncheck the checkboxes
}

function myfun1() {
	var agree;
	for(i=0;i<document.del1.length;++i) {
		if (document.del1.elements[i].value == "1") {
			if (document.del1.elements[i].checked) {
				j=j+1;
				agree = true;
	
				if (j == 1)
					xx =document.del1.elements[i].name;
				else
					xx = xx + "," + document.del1.elements[i].name ;
			}
		}
	}
	document.del1.delvalue.value=xx;
	if (agree) return confirm("Are You sure you want to delete this items?");
	return false ;
}

function checkall1() {
    //check or uncheck the checkboxes
     for(i=0;i<document.del1.elements.length;i++) document.del1.elements[i].checked=document.del1.chk.checked;
}

function chk_valid(id_del) {
	get_conf=confirm("Are you sure you want to REMOVE this product from your cart");
	if(get_conf)
		location.href="http://www.iwantmeds.com/remove_cart.php?id_del="+id_del;
}

function cl() {
	//alert (document.del.txt_qty_1.value);
	if((document.del.txt_qty_1.value)<=0) {
	alert("Prodeuct Quantity Cannot Be Zero");
	document.del.txt_qty_1.value = 1;
	}
}

function chkship(vals) {
	var ss
	ss = vals.split("--")
	
	if(ss[2] == "Y")
		document.del.final_amt.value = parseFloat(document.del.totamt.value) + parseFloat(ss[0]) 
	else
		document.del.final_amt.value = parseFloat(document.del.totamt.value) + parseFloat(ss[0])

	if(document.del.hidship_handling.value != "")
		document.del.final_amt.value = parseFloat(document.del.final_amt.value) + parseFloat(document.del.hidship_handling.value)
	
	txtval = document.del.final_amt.value
	
	if(txtval.indexOf('.') > 0) {
		pos = txtval.indexOf('.')
		pos1 = eval(pos+1)
		txtnewval1 = txtval.substr(0,pos)
		txtnewval2 = txtval.substr(pos1,2)
		txtnewval = txtnewval1 +"."+ txtnewval2
	}
	else
		txtnewval = document.del.final_amt.value + ".00"
	
	document.del.final_amt.value = txtnewval
	document.del.total_amt.value=document.del.final_amt.value;
}

function openwinnew() {
	window.open('http://www.iwantmeds.com/term.php','TERMS','toolbar=0, statusbar=0, scrollbars=yes, menubar=0, resizable=0, width=780 height=500 top=10, left=10');
}

function replicate(v) {
	document.getElementById("final_amt").value=v; 
}

function pop_up(page) {
	window.open(page,"More",'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=600,left = 262,top = 134');
}

function openwin (url) {
	window.open(url,"Iwantmeds","resizable=yes,scrollbars=yes,toolbar=no,width=750,height=400,top=50");	
}