function calculateDisc(retailPrice, ourPrice, elemID) {
	try {
		if (retailPrice > 0) {
			percentDec = ourPrice / retailPrice;
			saved = retailPrice - ourPrice;
			prcnt = 100 -(percentDec*100);
			domObj = document.getElementById('savedPercent' + elemID);
			domObj.innerHTML=Math.floor(prcnt) + "% off";
			//document.getElementById('savedAmt' + elemID).innerHTML="$" + Math.round(saved*100)/100;
		}
	} catch(err) {
		document.getElementById('savedPercent').innerHTML="";
		//document.getElementById('savedAmt').innerHTML="";
	}
}

function play(media){
  media = "http://www.clockway.com/video/" + media.substring(1, media.length-1);
  objVar = document.getElementById('mediaplayer')
  objVar.style.visibility='visible';
  objVar.innerHTML='<object id="thePlayer" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'+
  'type="application/x-oleobject" width="320" height="285">'+
  '<param name="showControls" value="true">'+
  '<param name="fileName" value="'+media+'">'+
  '<embed type="application/x-mplayer2" width="320" height="285"'+
  'showcontrols="true" src="'+media+'"><\/embed><\/object>'
}


function newWindow(popupUrl, popupTitle, winHeight, winWidth, winScroll, winMenu, winToolbar, showLocation, winLeft, winTop) {
	if(winHeight = 'screen') {
		winHeight= (screen.height-(screen.height*.15))
	}

	windowsArgs = "status=no,scrollbars=" + winScroll + 
				   ",width=" + winWidth + 
				   ",height=" + winHeight +
				   ",menubar=" + winMenu +
				   ",toolbar=" + winToolbar +
				   ",location=" + showLocation + 
				   ",left=" + winLeft + 
				   ",top=" + winTop;

	var aWindow = window.open(popupUrl, popupTitle, windowsArgs);

	if (window.focus) {aWindow.focus()}
 }