function checkValues() {
	var greatDealsPromo = document.singupPromosNewsletters.greatDealsPromo.checked;
	var greatDealsNewsletter = document.singupPromosNewsletters.greatDealsNewsletter.checked;
	var email = document.singupPromosNewsletters.emailAddress.value;
	
	var $errorFlag = false;
	var	$errorMsg = '';	
	
	if(greatDealsPromo==false && greatDealsNewsletter==false) {
		$errorFlag = true;
		$errorMsg += 'Please select which newsletter you would like to subscribe\n';	
	}
	
	if(!email) {
		$errorFlag = true;
		$errorMsg += 'Please provide your email address\n';	
	}
	
	if($errorFlag==true) {
		alert($errorMsg);
		return false;
	} else {
		return true;
	}
}

var newwindow = '';
function popitupImage(url) {
	newwindow=window.open(url,'htmlname','width=504,height=416,resizable=1,scrollbars=yes');   
}

function hideDropMenu() {
	if(document.getElementById('divCartPopHidden')) {
		document.getElementById('divCartPopHidden').className = 'divCartPopHidden';
	}
}

function popUp(strURL,strType,strHeight,strWidth) {
	var strOptions="";
	if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="custom") strOptions="scrollbars,status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	window.open(strURL, 'newWin', strOptions);
}

function submitQuote() {
	var myForm = document.orderPageForm;
	var product_id = myForm.product_id.value;
	var total_price = myForm.total_price.value;
	myForm.submit_quote_btn_x.value = '1';
	myForm.submit();	
}

// ------------------------------------------------------------------ //
// if ($current_page!='catalog_newdb_calendars') { 
// ------------------------------------------------------------------ //
function spinLoader() {
	if(document.getElementById('zip_code').value!='' && document.getElementById('zip_code').value!='Enter' && document.getElementById('zip_code').value!='Enter Zip Code') {	
		document.getElementById('shipping_zipcode').value = document.getElementById('zip_code').value;		
		document.getElementById('shippingZipLink').innerHTML = document.getElementById('zip_code').value;		
		document.getElementById('calculateLink').style.display = 'none';
		document.getElementById('spinImg').style.display = '';
		
		computePrice(document.orderPageForm);
	} else {
		document.getElementById('shipping_zipcode').value = '';
		alert('Please enter zipcode to calculate shipping.');
	}
	return false;
}

function showShippingZipcode() {
	document.getElementById('calculateLink').style.display = '';
	document.getElementById('spinImg').style.display = 'none';
	document.getElementById('shippingZipcode').style.display = '';
	document.getElementById('shippingResult').style.display = 'none';	
	
	showReviews('10');
	animateInitialReviews();
}

function selectThis(elemId) {
	var upsShipping = ['upsCustomFreight','upsGround','ups2DayAir','ups1DayAir'];
	for (var i=0; i<=upsShipping.length; i++)  {
		if (upsShipping[i]==elemId) {
			if(document.getElementById(elemId)) {
				document.getElementById(elemId).className = 'selected';	
			}
		} else {
			if(document.getElementById(upsShipping[i])) {
				document.getElementById(upsShipping[i]).className = '';	
			}
		}
	}
}

function setVisibility(value) {
	if(value==true) {
		if(document.getElementById('zipCodeSet'))
			document.getElementById('zipCodeSet').className = 'shippingCalculatorTDHidden';					
		if(document.getElementById('divSpinLoader'))
			document.getElementById('divSpinLoader').innerHTML = '<a href="javascript:;" onClick="spinLoader(); return false;">Calculate</a>';
		if(document.getElementById('shipMethodSet'))
			document.getElementById('shipMethodSet').className = '';																										
		if(document.getElementById('shippingTitle'))
			document.getElementById('shippingTitle').innerHTML = '<strong>SHIPPING TO <a href="javascript:setVisibility(false);" class="txtBlue">'+document.getElementById('zip_code').value+'</a></strong>';
		if(document.getElementById('printArrival'))
			document.getElementById('printArrival').style.display = '';	
	} else {
		if(document.getElementById('zipCodeSet'))
			document.getElementById('zipCodeSet').className = '';																			
		if(document.getElementById('divSpinLoader'))
			document.getElementById('divSpinLoader').innerHTML = '<a href="javascript:;" class="elemFloatL" onclick="spinLoader(); return false;">Calculate</a>';
		if(document.getElementById('shipMethodSet'))
			document.getElementById('shipMethodSet').className = 'shippingCalculatorTDHidden';																										
		if(document.getElementById('shippingTitle'))
			document.getElementById('shippingTitle').innerHTML = 'SHIPPING RATES & TRANSIT TIMES';
		if(document.getElementById('printArrival'))
			document.getElementById('printArrival').style.display = 'none';	
		
		if(document.URL!=HTTP_SERVER+REQUEST_URI) {
			addTopHeight(-160);
		}
	}
}

function highLightLabels(valLength,valName,valNode) {
	if(valName=='radioTurn') {
		for(i=0;i<valLength;i++) {
			if(i==valNode) {
				document.getElementById(valName+valNode).className='selected';
			} else {
				document.getElementById(valName+i).className='';
			}
		}
	} else if(valName=='radioMail') {
		//alert(valLength+'-'+valName+'-'+valNode);
		for(i=0;i<valLength;i++) {
			if(i==valNode) {
				document.getElementById(valName+valNode).className='selected';
			} else {
				document.getElementById(valName+i).className='';
			}
		}
	} else if(valName=='radioShip') {
		for(i=0;i<valLength;i++) {
			if(i==valNode) {
				document.getElementById(valName+valNode).className='selected';
			} else {
				document.getElementById(valName+i).className='';
			}
		}
		if(valNode!='CF') {
			if(document.getElementById('radioShipCF')) {
				document.getElementById('radioShipCF').className='';
			}
		} else {
			if(document.getElementById('radioShipCF')) {
				document.getElementById('radioShipCF').className='selected';
			}
		}
	}
}

function highLightDiscount(divId) {
	document.getElementById(divId).className='upsDiscountHighLight';
}

function highLightDiscountOff(divId) {
	if(document.getElementById(divId)) {
		document.getElementById(divId).className='upsDiscount';
	}
}
// ------------------------------------------------------------------ //
// } 
// ------------------------------------------------------------------ //

function hitEnter (field, event) {
  var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (keyCode == 13)
    return true;
  else
    return false;
}

function moveFocus(fieldId, buttonId) {
	var field = document.getElementById(fieldId);
	var button = document.getElementById(buttonId);
	
	if(field.value.length==5) {
		button.focus();
	}
}

function updatePricingDisplay(upsRate) {
	var totalPrice = parseFloat(document.orderPageForm.total_price.value);
	if(document.getElementById('disp_discount_price')) {
		if(document.getElementById('disp_discount_price').innerHTML) {
			var discountPrice = parseFloat(document.getElementById('disp_discount_price').innerHTML);		
			var subtotalPrice = parseFloat(totalPrice) - parseFloat(discountPrice) + parseFloat(upsRate);
		} else {
			var subtotalPrice = parseFloat(totalPrice) + parseFloat(upsRate);
		}
	} else {
		var subtotalPrice = parseFloat(totalPrice) + parseFloat(upsRate);
	}
	
	nf = new NumberFormat(subtotalPrice);
	nf.setPlaces(2);
	subtotalPrice = nf.toFormatted();
	nf = null; 		
	
	document.getElementById('disp_total_price').innerHTML = subtotalPrice;
	document.getElementById('disp_shipping_price').innerHTML = upsRate;	
}

function showShippingOptions() {
	if(!document.getElementById('disp_total_price').innerHTML || document.getElementById('disp_total_price').innerHTML==0) {
		alert('Please select a product to calculate shipping.');
	} else {
		if(document.getElementById('shippingOptionsTd'))
			document.getElementById('shippingOptionsTd').className = 'shippingCalculatorTDVisible';
		if(document.getElementById('shippingCalculatorTD'))
			document.getElementById('shippingCalculatorTD').className = 'shippingCalculatorTDVisible';
		if(document.getElementById('textCalculate'))
			document.getElementById('textCalculate').className = 'shippingCalculatorTDHidden';
		if(document.getElementById('priceCalculate'))
			document.getElementById('priceCalculate').className = 'shippingCalculatorTDVisible';
	}
}

function displayShippingOptions() {
	if(!document.getElementById('disp_total_price').innerHTML || document.getElementById('disp_total_price').innerHTML==0) {
		alert('Please select a product to calculate shipping.');
	} else {
		if(document.getElementById('shippingTitle'))
			document.getElementById('shippingTitle').className = 'shippingCalculatorTDVisible';	
		if(document.getElementById('shippingCalculatorTD'))
			document.getElementById('shippingCalculatorTD').className = 'shippingCalculatorTDVisible';
		if(document.getElementById('shippingCalculatorRes'))
			document.getElementById('shippingCalculatorRes').className = 'shippingCalculatorTDVisible';
		if(document.getElementById('calculateShippingRate'))
			document.getElementById('calculateShippingRate').className = 'shippingCalculatorTDHidden';
		
		if(document.URL!=HTTP_SERVER+REQUEST_URI) {			
			addTopHeight(60);
		}
	}
}

function computeMailing(mailingRate, qty, mailingServiceFee) {
	var printingRate = parseFloat(document.orderPageForm.total_price.value);
	var mailingServiceFee = parseFloat(mailingServiceFee);
	var mailingPostageEstimate = parseFloat(mailingRate*qty);
	var totalRateMailing = printingRate+mailingServiceFee+mailingPostageEstimate;
	var discountPrice = 0;
	
	var promo = PROMO;
	var promo_code_percentage = PROMO_CODE_PERCENTAGE;
	var promo_code_amount = PROMO_CODE_AMOUNT;
	var promo_code_max = PROMO_CODE_MAX;
	var coupon_field_code = parseFloat(document.orderPageForm.coupon_field_code.value);
	var coupon_field_discount_percentage = parseFloat(document.orderPageForm.coupon_field_discount_percentage.value);
	var coupon_field_discount_amount = parseFloat(document.orderPageForm.coupon_field_discount_amount.value);
	var coupon_field_max_discount = parseFloat(document.orderPageForm.coupon_field_max_discount.value);
	
	if(coupon_field_code){
		if(
				(!promo_code_percentage && !isNaN(coupon_field_discount_percentage) && coupon_field_discount_percentage ) || 
				(promo_code_percentage && !isNaN(coupon_field_discount_percentage) && coupon_field_discount_percentage > promo_code_percentage) || 
				(!promo_code_amount && !isNaN(coupon_field_discount_amount) && coupon_field_discount_amount) || 
				(promo_code_amount && !isNaN(coupon_field_discount_amount) && coupon_field_discount_percentage > promo_code_amount)){
			promo = 'y';
			promo_code_percentage = coupon_field_discount_percentage;
			promo_code_amount = coupon_field_discount_amount;
			promo_code_max = coupon_field_max_discount;
		}
	}
	
	if(promo && promo=='y') {
		if(promo_code_percentage && promo_code_percentage!='') {
			nf = new NumberFormat(promo_code_percentage/100);
			nf.setCommas(false);
			nf.setPlaces(2);
			var promo_code_percent = nf.toFormatted();
			nf = null;
		
			nf = new NumberFormat(printingRate*promo_code_percent);
			nf.setCommas(false);
			nf.setPlaces(2);
			var discountPrice = nf.toFormatted();
			nf = null;
			
		} else if(promo_code_amount && promo_code_amount!='') {
			nf = new NumberFormat(promo_code_amount);
			nf.setCommas(false);
			nf.setPlaces(2);
			var discountPrice = nf.toFormatted();
			nf = null;
		}

		if(promo_code_max && promo_code_max!='') {
			if(discountPrice>promo_code_max) {
				nf = new NumberFormat(promo_code_max);
				nf.setCommas(false);
				nf.setPlaces(2);
				var discountPrice = -nf.toFormatted();
				nf = null;
			}
		}
	}
	
	nf = new NumberFormat(mailingPostageEstimate);
	nf.setCommas(false);
	nf.setPlaces(2);
	var mailingPostageEstimate = nf.toFormatted();
	nf = null; 

	nf = new NumberFormat(totalRateMailing-discountPrice);
	nf.setCommas(false);
	nf.setPlaces(2);
	var totalRateMailing = nf.toFormatted();
	nf = null; 

	//alert(typeof(printingRate));
	//alert(typeof(mailingServiceFee));
	//alert(typeof(mailingPostageEstimate));
	
	if(document.getElementById('disp_mailing_postage_estimate'))
		document.getElementById('disp_mailing_postage_estimate').innerHTML = mailingPostageEstimate;			
	if(document.getElementById('disp_total_price'))
		document.getElementById('disp_total_price').innerHTML = totalRateMailing;			
}

// ------------------------------------------------------------------ //
// if(isset($_GET['mailing']) && $_GET['mailing']==1) {
// ------------------------------------------------------------------ //
function switchMailingTab(tabName) {
	var tabOutput = '';
	var tabContent = '';	

	switch (tabName) {
		case 'pm':
			tabOutput += '<li id="currentFixed"><a href="javascript:;" onclick="switchMailingTab(\'pm\');">Postcard Mailing</a></li>\n';
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'usps\'); return false;">USPS Postage</a></li>\n';
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'ls\'); return false;">List Services</a></li>\n';

			tabContent += '<strong>Mailing Service Includes</strong>\n';
			tabContent += '<ul>\n';
			tabContent += '	<li>List Preparation (single file)</li>\n';
			tabContent += '	<li>CASS Certification</li>\n';
			tabContent += '	<li>Address Ink Jetting</li>\n';
			tabContent += '	<li>Postal Pre-sorting</li>\n';
			tabContent += '	<li>Drop-off at Local USPS Office</li>\n';
			tabContent += '</ul>\n';
			tabContent += '<strong>Mailing Turnaround</strong>\n';
			tabContent += '<p>Mailing preparation is an additional 2-3 Business Days.<br/>Estimated USPS Delivery Time is based on Postage selected. </p>\n';
		break;
		case 'usps':
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'pm\');">Postcard Mailing</a></li>\n';
			tabOutput += '<li id="currentFixed"><a href="javascript:;" onclick="switchMailingTab(\'usps\'); return false;">USPS Postage</a></li>\n';
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'ls\'); return false;">List Services</a></li>\n';

			tabContent += '<table bgcolor="#4f81bd" border="0" class="quoteSmall" cellspacing="1" cellpadding="10" width="100%" style="white-space:normal;">\n';
			tabContent += '	<tr>\n';
			tabContent += '		<td style="color:#FFFFFF;"><strong>Size</strong></td>\n';
			tabContent += '		<td style="color:#FFFFFF;"><strong>USPS Postage*</strong></td>\n';
			tabContent += '		<td style="color:#FFFFFF;"><strong>In Transit - Southern California*</strong></td>\n';
			tabContent += '		<td style="color:#FFFFFF;"><strong>In Transit- Nationwide*</strong></td>\n';
			tabContent += '	</tr>\n';
			tabContent += '	<tr bgcolor="#FFFFFF">\n';
			tabContent += '		<td><strong>4.25&quot; x 6&quot;</strong> </td>\n';
			tabContent += '		<td>First Class $0.223</td>\n';
			tabContent += '		<td>1-2 Business Days</td>\n';
			tabContent += '		<td>2-3 Business Days</td>\n';
			tabContent += '	</tr>\n';
			tabContent += '	<tr bgcolor="#FFFFFF">\n';
			tabContent += '		<td rowspan="2"><strong>4.75&quot; x 6.25&quot; to 6&quot; x 11&quot;</strong> </td>\n';
			tabContent += '		<td>First Class $0.369</td>\n';
			tabContent += '		<td>1-2 Business Days</td>\n';
			tabContent += '		<td>2-3 Business Days</td>\n';
			tabContent += '	</tr>\n';
			tabContent += '	<tr bgcolor="#FFFFFF">\n';
			tabContent += '		<td>Standard Bulk $0.257</td>\n';
			tabContent += '		<td>1-2 Business Days</td>\n';
			tabContent += '		<td>5-14 Business Days</td>\n';
			tabContent += '	</tr>\n';
			tabContent += '</table>\n';
			tabContent += '<br /><div class="arialFont12">*Estimated USPS Postage and Transit Times.</div>\n';
		break;
		case 'ls':
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'pm\');">Postcard Mailing</a></li>\n';
			tabOutput += '<li><a href="javascript:;" onclick="switchMailingTab(\'usps\'); return false;">USPS Postage</a></li>\n';
			tabOutput += '<li id="currentFixed"><a href="javascript:;" onclick="switchMailingTab(\'ls\'); return false;">List Services</a></li>\n';

			tabContent += '<strong>Targeted List</strong>\n';
			tabContent += '<ul>\n';
			tabContent += '	<li>Choose Business and Consumer List</li>\n';
			tabContent += '	<li>Target prospects by demographics, zip code, zip-radius</li>\n';
			tabContent += '</ul>\n';
			tabContent += '<strong>Our Data Partners</strong><br />\n';
			tabContent += '<img src="../images/equitrans.png" />\n';				
		break;
	}
	
	document.getElementById('pcmTabs').innerHTML = tabOutput;
	document.getElementById('pcmCont').innerHTML = tabContent;
}
// ------------------------------------------------------------------ //
// }
// ------------------------------------------------------------------ //

function changeZipcode(valueFlag) {
	if (valueFlag=='y') {
		if(!document.getElementById('zip_code').value || document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter' || document.getElementById('zip_code').value=='Enter Zip Code') {
			document.getElementById('zip_code').maxLength = 14;
			document.getElementById('zip_code').value = 'Enter Zip Code';
		}
	} else {
		if(!document.getElementById('zip_code').value || document.getElementById('zip_code').value=='' || document.getElementById('zip_code').value=='Enter' || document.getElementById('zip_code').value=='Enter Zip Code') {
			document.getElementById('zip_code').maxLength = 5;
			document.getElementById('zip_code').value = '';
		}
	}
}

var attrsName = '';
function changeEditVars(attrName, attrId, attrValue, attrVar) {
	if(!attrsName.match(attrName) && attrValue!=attrVar) {
		attrsName += attrName+'|';
	} else if(attrValue==attrVar) {
		attrsName = attrsName.replace(attrName,'');
	}

	if(attrsName.match("Size") && attrsName.match("Color")) {
		var msgAlert = 'If your current file does not match these specifications, please re-upload a new file.\n\nIf you need assistance, please call us at 1-888-888-4211';
	} else if(attrsName.match("Size") && !attrsName.match("Color")) {
		var msgAlert = 'Is this the trim size for your current file? If not, please re-upload a new file.\n\nIf you need assistance, please call us at 1-888-888-4211';
	} else if(!attrsName.match("Size") && attrsName.match("Color")) {
		var selColor = document.getElementById(attrId).options[document.getElementById(attrId).selectedIndex].text;
		var msgAlert = 'Did you upload a '+selColor+' file?  If not, please re-upload a new file.\n\nIf you need assistance, please call us at 1-888-888-4211';
	}
	
	if(msgAlert) {
		document.getElementById('divEditMsgs').innerHTML = msgAlert;
		document.getElementById('divEditMsgs').style.display = '';
	} else {
		document.getElementById('divEditMsgs').innerHTML = '';
		document.getElementById('divEditMsgs').style.display = 'none';
	}
}

function showHiddenBox(boxType) {
	if(boxType=='shipping') {
		document.getElementById('shippingCalculatorTD').className = 'opCalcPop';
		document.getElementById('emailQuote').className = 'opMailPop shippingCalculatorTDHidden';
	} else if(boxType=='quote') {
		document.getElementById('shippingCalculatorTD').className = 'opCalcPop shippingCalculatorTDHidden';
		document.getElementById('emailQuote').className = 'opMailPop';
	} else {
		document.getElementById('shippingCalculatorTD').className = 'opCalcPop shippingCalculatorTDHidden';
		document.getElementById('emailQuote').className = 'opMailPop shippingCalculatorTDHidden';
	}
}

// ------------------------------------------------------------------ //
// Begin :: order_page_xml.php
// ------------------------------------------------------------------ //
function setTurnStyles(turnVal){
	var turnOpts = document.orderPageForm.attr27;
	if(turnVal==4) {
		document.getElementById('radioTurn1').style.color = '#000000';
		document.getElementById('radioTurn1').style.fontWeight = 'normal';
		
		var turnArrs = new Array();
		for(var i=0; i<turnOpts.length; i++) {
			turnArrs.push(turnOpts[i].value);
		}
		turnArrs.sort();
		
		document.getElementById('div_attr27_'+turnArrs[0]).style.textDecoration = 'none';
		document.getElementById('div_attr27_'+turnArrs[0]+'_rprice').style.textDecoration = 'none';
		
		if(document.getElementById('4dayUpgrade'))
			document.getElementById('4dayUpgrade').style.display = 'none';		
			
	} else if(turnVal==6) {
		document.getElementById('radioTurn1').style.color = '#CC0000';
		document.getElementById('radioTurn1').style.fontWeight = 'bold';

		var turnArrs = new Array();
		for(var i=0; i<turnOpts.length; i++) {
			turnArrs.push(turnOpts[i].value);
		}
		turnArrs.sort();
		
		document.getElementById('div_attr27_'+turnArrs[0]).style.textDecoration = 'line-through';
		document.getElementById('div_attr27_'+turnArrs[0]+'_rprice').style.textDecoration = 'line-through';
		
		if(document.getElementById('4dayUpgrade'))
			document.getElementById('4dayUpgrade').style.display = '';
	}
}

function setFolding(foldValue) {
	document.getElementById('folding_temp').value = foldValue;
}

function setProofingHours() {
	var typeFolded = new Array(5,22,47,69);
	var typeMultiPage = new Array(6,21,38,66,67,68);	
	var typeMailed = new Array(49);	
	
	var productId = '{$product_id}';
	var foldValue = document.getElementById('folding_temp').value;
	var turnValue = document.getElementById('turnaround_temp').value;
	
	var proofingTurnOrder = '';
	var proofingTurnFree = '';
	
	if(turnValue==1) {
		proofingTurnOrder = '2';
		proofingTurnFree = '4';
	} else if(turnValue==2) {
		proofingTurnOrder = '3';
		proofingTurnFree = '5';
	} else if(turnValue==4) {
		proofingTurnOrder = '4';
		proofingTurnFree = '6';
	} else if(turnValue==6) {
		proofingTurnOrder = '6';
		proofingTurnFree = '8';
	} else {
		proofingTurnOrder = '6';
		proofingTurnFree = '8';
	}
	/*
	if(document.getElementById('proofing_time_order'))
		document.getElementById('proofing_time_order').innerHTML = '('+proofingTurnOrder+' Business Hours)';
	if(document.getElementById('proofing_time_free'))
		document.getElementById('proofing_time_free').innerHTML = '('+proofingTurnFree+' Business Hours)';
		*/
	if(document.getElementById('proofing_time_order'))
		document.getElementById('proofing_time_order').innerHTML = proofingTurnOrder+' Hours';
	if(document.getElementById('proofing_time_free'))
		document.getElementById('proofing_time_free').innerHTML = proofingTurnFree+' Hours';
}
// ------------------------------------------------------------------ //
// End :: order_page_xml.php
// ------------------------------------------------------------------ //

function getUrlParams() {
	var selTurnaround = document.getElementById('turnaround_temp').value;
	var selZipcode = document.getElementById('zip_code').value;
	var selDate = document.getElementById('estDate').innerHTML.replace(" ","-");
	
	var optShipping = document.orderPageForm.ups_shipping;
	for(var i=0; i<optShipping.length; i++) {
		if(optShipping[i].checked==true) {
			var selShipping = optShipping[i].value;
			selShipping = selShipping.replace(" ","-");
		}
	}
	
	if(selShipping=='UPS-Ground') {
		var selTransit = document.getElementById('ups_transit_ground').value;
	} else if(selShipping=='UPS-2nd Day Air') {
		var selTransit = '2';
	} else {
		var selTransit = '1';		
	}
	
	return GB_showCenter('Estimated Arrival Date', '/index.php?main_page=print_arrival&turn='+selTurnaround+'&zip='+selZipcode+'&ship='+selShipping+'&date='+selDate+'&transit='+selTransit, 650, 900);
	//alert('selTurnaround:'+selTurnaround+'\n'+'selZipcode:'+selZipcode+'\n'+'selShipping:'+selShipping);
	return false;
}

function showSpecDisplay(product_id,attr_val_id){
	if(attr_val_id==0){
		var attr_val_id = '0';
	} else if(!attr_val_id) {
		var attr_val_id = '';
	}
	
	var imgDir = DIR_WS_TEMPLATE+'images/';
	var foldingImages = new Array();
	foldingImages['None'] = '';
	foldingImages['Half Fold'] = 'halfFold.png';
	foldingImages['Trifold'] ='triFold.png';
	foldingImages['Z-Fold'] = 'zFold.png';
	foldingImages['Accordion (4 Panels)'] = 'aFold.png';
	foldingImages['Roll Fold'] = 'rollFold.png';
	
	var diecutImages = new Array();
	diecutImages['Rounded Corners'] = 'roundedCorners.png';
	diecutImages['Leaf'] = 'leaf.png';
	diecutImages['Rounded One-Corner'] = 'oneCornerRounded.png';
	diecutImages['Half-Circle Side'] = 'onesideCircle.png';
	
	var specDispImg = '';
	
	switch(product_id){
		case 5:
		case 7:
		case 32:
		case 45:
		case 47:
		    // folding
				var attr_id = 32;
				if(attr_val_id) {
					var u = attr_val_id;
				} else {
					var u = document.getElementById('attr'+attr_id).selectedIndex;
					
				}				
				var folding = document.getElementById('attr'+attr_id).options[u].text;	

				if(folding != 'None')
					specDispImg = foldingImages[folding];
				
			break;
		case 76:
				// die-cut
				var attr_id = 58;
				if(attr_val_id) {
					var u = attr_val_id;
				} else {
					var u = document.getElementById('attr'+attr_id).selectedIndex;
				}
				var diecut = document.getElementById('attr'+attr_id).options[u].text;	
				specDispImg = diecutImages[diecut];
				
			break;
	}
	
	//alert(specDispImg);
	//alert(specDispImg && document.getElementById('spec_disp_' + attr_id));
	//alert(document.getElementById('td_'+attr_id+'_options').focus);
	if(specDispImg && document.getElementById('spec_disp_' + attr_id)){
		if(attr_val_id) {
			switch (attr_val_id) {
				case '0':
					document.getElementById('spec_disp_' + attr_id).style.top = '10px';
				break;
				case 1:
					document.getElementById('spec_disp_' + attr_id).style.top = '25px';
				break;
				case 2:
					document.getElementById('spec_disp_' + attr_id).style.top = '40px';
				break;
				case 3:
					document.getElementById('spec_disp_' + attr_id).style.top = '50px';
				break;
				case 4:
					document.getElementById('spec_disp_' + attr_id).style.top = '65px';
				break;
				case 5:
					document.getElementById('spec_disp_' + attr_id).style.top = '75px';
				break;
			}
		}
		
		document.getElementById('spec_disp_' + attr_id).style.display = 'block';
		document.getElementById('spec_disp_' + attr_id).innerHTML = "<img src=\""+ imgDir + specDispImg + "\" border=\"0\" />";
		//alert(document.getElementById('spec_disp_' + attr_id).innerHTML);

	} else {
		document.getElementById('spec_disp_' + attr_id).style.display = 'none';
		document.getElementById('spec_disp_' + attr_id).innerHTML = '';
	}
	//alert(specDispImg);
	//alert(document.getElementById('spec_disp_' + attr_id).innerHTML);
}

function hideSpecDisplay(attr_id){
	if(document.getElementById('spec_disp_' + attr_id)){
			document.getElementById('spec_disp_' + attr_id).style.display = 'none';
	}
}