function mediapopup(mediafile)
{
	var sStr = ",scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no";
	if (window.screen)
	{
		sStr = "width=300,height=300,left=200,top=100";
	}
	window_handle = window.open("popup_media.asp?item="+mediafile,"mnmmedia",sStr);
	window_handle.focus();
	
}
function mnmpopup(winname)
{
	var sStr = ",scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no";
	var a = winname;
	if (window.screen)
	{
		var aw = screen.availWidth;
		var ah = screen.availHeight - 50;
		var height = 430;
		var width = 600;
		if (ah > 480) height = 500;
		if (ah > 600) height = 557;
		if (ah > 800) height = 557;
		if (aw < 641) width = 600;
		sStr = "width=" + width + ",height=" + height + sStr;
		sStr += ",left=" + ( (aw - width) / 2 );
//alert( sStr );
		var nTop = (ah - height) / 2;
		if ( nTop < 0 )
			nTop = 0;
		sStr += ",top=" + nTop;
	}
	window.open(a,"mnmpopup",sStr);
}

function discountterms()
{
	var sStr = ",scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no";
	if (window.screen)
	{
		var aw = screen.availWidth;
		var ah = screen.availHeight - 50;
		var height = 430;
		var width = 600;
		if (ah > 480) height = 500;
		if (ah > 600) height = 557;
		if (ah > 800) height = 557;
		if (aw < 641) width = 600;
		sStr = "width=" + width + ",height=" + height + sStr;
		sStr += ",left=" + ( (aw - width) / 2 );
//alert( sStr );
		var nTop = (ah - height) / 2;
		if ( nTop < 0 )
			nTop = 0;
		sStr += ",top=" + nTop;
	}
	window.open("terms_discount.asp","terms",sStr);
}

function clonebillinfo()
 {document.ccentry.shiptoname.value=document.ccentry.sjname.value;
  document.ccentry.shiptostreetaddress.value=document.ccentry.streetaddress.value;
  document.ccentry.shiptostreetaddress2.value=document.ccentry.streetaddress2.value;
  document.ccentry.shiptocity.value=document.ccentry.city.value;
  document.ccentry.shiptostate.value=document.ccentry.state.value;
  document.ccentry.shiptozipcode.value=document.ccentry.zipcode.value;
  document.ccentry.shiptophone.value=document.ccentry.phone.value;
  billinfoshadedbg();
  }

function unclonebillinfo()
{document.ccentry.shiptoname.value='';
document.ccentry.shiptostreetaddress.value='';
document.ccentry.shiptostreetaddress2.value='';
document.ccentry.shiptocity.value='';
document.ccentry.shiptostate.value='';
document.ccentry.shiptozipcode.value='';
document.ccentry.shiptophone.value='';
billinfowhitebg();
}

function billinfowhitebg()
{document.ccentry.shiptoname.style.background='white';
document.ccentry.shiptostreetaddress.style.background='white';
document.ccentry.shiptostreetaddress2.style.background='white';
document.ccentry.shiptocity.style.background='white';
document.ccentry.shiptostate.style.background='white';
document.ccentry.shiptozipcode.style.background='white';
document.ccentry.shiptophone.style.background='white';
}

function billinfoshadedbg()
{document.ccentry.shiptoname.style.background='#dddddd';
document.ccentry.shiptostreetaddress.style.background='#dddddd';
document.ccentry.shiptostreetaddress2.style.background='#dddddd';
document.ccentry.shiptocity.style.background='#dddddd';
document.ccentry.shiptostate.style.background='#dddddd';
document.ccentry.shiptozipcode.style.background='#dddddd';
document.ccentry.shiptophone.style.background='#dddddd';
}

function resetshipping()
 {if (document.ccentry.shipbillsame.checked)
 {
  document.ccentry.shipbillsame.checked = false;
  billinfowhitebg();
 }
  }

function submitonce(theform)
{
  //--- Only used if the browser is IE 4+ or NS 6+
  if (document.all || document.getElementById)
  {
    //-- Look at all elements - and locate the "submit" and "reset" button types
    for (i=0; i < theform.length; i++)
    {
      var tempobj = theform.elements[i]
      if ( ( tempobj.type.toLowerCase() == "submit" ) || 
           ( tempobj.type.toLowerCase() == "reset"  ) )
      { tempobj.disabled = true }
    }
  }
}

function EvalSound(soundobj) {
  var thissound=document.getElementById(soundobj);
	
  try {
	  thissound.DoPlay();
  }
  catch (e) {
	thissound.Play();
	}
}

function embedcartsound() 
{
	document.write ('<embed src="media/chimes.wav" type="audio/wav" autostart="FALSE" loop="false" playcount="1" height="0" width="0" id="cartsound" enablejavascript="true">');
}