
function addToCart(prdId)
{			
	var quant = document.frmMain.quant[ document.frmMain.quant.selectedIndex ].value;
	var variation;
	var sv = ""
	
	if(document.frmMain.varcount.value=='1')
	{
		variation = document.frmMain.variation.value;
		
		// ----------------------------------------------------
		// check for simple variations
		// ----------------------------------------------------
		
		if(document.frmMain.sv_lab_1.value != "")		
			sv += document.frmMain.sv_sel_1[ document.frmMain.sv_sel_1.selectedIndex ].value;
		
		if(document.frmMain.sv_lab_2.value != "")		
			sv += "," + document.frmMain.sv_sel_2[ document.frmMain.sv_sel_2.selectedIndex ].value;
		
		if(document.frmMain.sv_lab_3.value != "")		
			sv += "," + document.frmMain.sv_sel_3[ document.frmMain.sv_sel_3.selectedIndex ].value;
		
		if(document.frmMain.sv_lab_4.value != "")		
			sv += "," + document.frmMain.sv_sel_4[ document.frmMain.sv_sel_4.selectedIndex ].value;
		
		
		
	}
	else
	{
		variation = document.frmMain.variation[ document.frmMain.variation.selectedIndex ].value;
	}
	
	
	if(variation=='xx')
	{
		alert('Please select a style');
	}
	else
	{
		if(variation=='out')
		{
			alert('The current style is out-of-stock please select another.');
		}
		else
		{	
			var url = 'http://' + mt_subdomainuri + '/store/cart.aspx?PrdVarId=' + variation + '&quant=' + quant + "&sv=" + sv;
			//alert( url );
			window.location.href = url;
		}
	}
		
}


function addToCartCat(prdId)
{					
	var url = 'http://' + mt_subdomainuri + '/store/cart.aspx?PrdId=' + prdId;
	window.location.href = url;		
}




function zoomProduct(prdId)
{
	window.open('/store/productZoom.aspx?prdId=' + prdId,'prdzoom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=550');
}


function zoomProductOpw(prdId)
{
	window.open('/store/productZoom.aspx?opw=1&prdId=' + prdId,'prdzoom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=550');
}


function zoomProductOpwEx(prdId, opwSitId)
{
	window.open('/store/productZoom.aspx?opw=1&prdId=' + prdId + '&aux=' + opwSitId ,'prdzoom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=550');
}



// --------------------------------------------------------------------
function submitEx(cmd)
{
	document.frmMain.cmd.value = cmd;	
	document.frmMain.submit();
}



function nextStep()
{
	document.frmMain.cmd.value="N";
	document.frmMain.submit();
}



//	----------------------------------------------------------------------------------------
function windowopen(url) {	window.open(url); }
function linknew(url) {	window.open(url); }


//	----------------------------------------------------------------------------------------
function openUrl(url) {	window.location.href = url; }
function link(url) {	window.location.href = url; }



//	----------------------------------------------------------------------------------------
function copyFromShipTo()
{
	document.frmMain.CopyShipTo.value = '1';
	document.frmMain.submit();
}




function handleCopyFromShipTo()
{
	if( document.frmMain.cpsh.checked )
		document.frmMain.CopyShipTo.value = 'copy';
	else
		document.frmMain.CopyShipTo.value = 'del';
	
	
	document.frmMain.submit();
	
}

function openCvv2Info()
{
	window.open('store/cvv2Info.htm','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=400');
}



//	----------------------------------------------------------------------------------------
//	OnClick() Event for global check box
//	----------------------------------------------------------------------------------------
function globalcheckbox_onclick(ctrl)
{
	// insert this:  <input type=checkbox name=globalcheckbox name=globalcheckbox checked=false onclick="globalcheckbox_onclick(this)">
	for(i=0; i<frmMain.length; i++)			
		if(frmMain[i].type == 'checkbox')				
			frmMain[i].checked = ctrl.checked;														
}




