 var hdract
 function hvdis(x,y){
	 if(x=='all')
	 	{document.getElementById('stb1').className='stbb'
	 	 document.getElementById('stb2').className='stbb'
	 	 document.getElementById('stb3').className='stbb'
	 	 document.getElementById('stb4').className='stbb'
	 	}
	 else
	 	{if(y=='1'){document.getElementById(x).className='stba'}
	 	 else{document.getElementById(x).className='stbb'}}
		 			}

	function hdrmvr(d){
		document.getElementById('hd0'+d).className='hdbck2'
				 	}
	function hdrout(d){
		if(d==hdract){document.getElementById('hd0'+d).className='hdbck2'}
		else{document.getElementById('hd0'+d).className='hdbck'}
					  }
						
//------[ newsletter mm010c ]-----
	m010cx=1
	function mvwimg(x){
		document.getElementById('m010cimg'+m010cx).style.display='none'
		document.getElementById('m010ctab'+m010cx).style.background='none'
		document.getElementById('m010cimg'+x).style.display=''
		document.getElementById('m010ctab'+x).style.background='#BBEAC6'
		m010cx=x
					  }
//------[ cart.asp ]-----
	function vrfymax(x){
		if(Number(document.getElementById('po2qty'+x).value) > Number(document.getElementById('po2qtymax'+x).value))
			{alert('Quantity Exceeded!')
			 document.getElementById('po2qty'+x).value=Number(document.getElementById('po2qtymax'+x).value)}
		else
			{cmpute()}}
			
	function verform(){
		var emal=document.getElementById('csemal').value
			if (emal.indexOf('@')>=0 && emal.indexOf('.')>=0)
 				{if(emal.indexOf(',')>=0)
 					{alert('Error: Invalid email!')}
 				 else
 				 	{document.getElementById('cartform1').action='cart-ext.asp?wat=sbmitdis&fina=y'
	 				 savedis()
 				 	}	
 				}
			else
	 			{alert('Error: Invalid email!')}
	 			
		
					  }
		
	function savedis(){
		document.getElementById('cartform1').submit()
		}
		
	function remov(xctr,pono){
		document.getElementById(pono + 'tr'+xctr).style.display='none'
		document.getElementById(pono + 'del'+ xctr).value='y'
		cmpute()
		updtectr(pono)
		}
	
	function updtectr(pono2){
		po1ctr=document.getElementById(pono2 + 'alctr').value
		x1=1
		for(ii=1;ii<=po1ctr;ii++)
			{ if(document.getElementById(pono2 + 'tr' +ii).style.display=='')
				{ document.getElementById(pono2 + 't1d' +ii).innerHTML=x1 + '.'
				  x1=x1+1
				}
			}
		}		
		
	function cmpute(){
	vx=0
	for(iix=1;iix<3;iix++)
	    {
		 if(document.getElementById('po' + String(iix) +'alctr'))
		 	{
		 		tamt=0
		 		alpo1ctr=document.getElementById('po' + String(iix) +'alctr').value
		 		for(ii=1;ii<=alpo1ctr;ii++)
			 		{
						if(document.getElementById('po' + String(iix) +'tr'+ii).style.display=='')
							{
								document.getElementById('po' + String(iix) +'amt'+ii).value=CurrencyFormatted(document.getElementById('po' + String(iix) +'qty'+ii).value*document.getElementById('po' + String(iix) +'sel'+ii).value)
			 					tamt=tamt + Number(document.getElementById('po' + String(iix) +'amt'+ii).value)
		 					}	
			 		}
		 		vx = vx+ Number(CurrencyFormatted(tamt))
		 		document.getElementById('po' + String(iix) +'altamt').value=CurrencyFormatted(tamt)
			}
		}	
		document.getElementById('altotal').innerHTML='$ '+ CurrencyFormatted(vx)
		document.getElementById('savchn').disabled=false
		
					}
						
	
	function CurrencyFormatted(amount){
		var i = parseFloat(amount);
		if(isNaN(i)) { i = 0.00; }
		var minus = '';
		if(i < 0) { minus = '-'; }
		i = Math.abs(i);
		i = parseInt((i + .005) * 100);
		i = i / 100;
		s = new String(i);
		if(s.indexOf('.') < 0) { s += '.00'; }
		if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
		s = minus + s;
		return s;
									}


				
