document.write('\
<div id="quickView">\
 <div class="qvTitle" id="qvItemName"></div>\
 <div class="dashedBorder"><img src="http://site.invitationbox.com/images/imgDashLine.gif" width="580"/></div>\
 <div id="qvImage"></div>\
 <div id="qvInnerBG"></div>\
 <div class="qvTabs">\
  <ul class="tabNavigation">\
      <li id="firstTab"><a href="#first">Info</a></li>\
      <li id="secondTab"><a href="#second">Pricing</a></li>\
  </ul>\
  <div id="first">\
   <table border="0" cellpadding=1 cellspacing=0 class="qvInfo" id="qvTable">\
    <tr><td class="itemLabelTd">item #:</td><td class="itemItemTd"><span id="qvItemNum">&nbsp;</span></td></tr>\
    <tr><td class="itemLabelTd">designer:</td><td class="itemItemTd"><span id="qvVendor">&nbsp;</span></td></tr>\
    <tr><td class="itemLabelTd">&nbsp;</td><td class="itemItemTd">&nbsp;</td></tr>\
    <tr><td class="itemLabelTd">size:</td><td class="itemItemTd"><div id="qvSize">&nbsp;</div></td></tr>\
    <tr><td class="itemLabelTd" id="qvLblPaperWeight">card stock:</td><td class="itemItemTd"><div id="qvPaperWeight">&nbsp;</div></td></tr>\
    <tr><td class="itemLabelTd" id="qvLblBlank">available blank:</td><td class="itemItemTd"><div id="qvBlank">&nbsp;</div></td></tr>\
    <tr><td class="itemLabelTd">&nbsp;</td><td>&nbsp;</td></tr>\
    <tr><td class="itemLabelTd">ships from:</td><td class="itemItemTd"><div id="qvShipsFrom">&nbsp;</div></td></tr>\
    <tr><td class="itemLabelTd">lead time:</td><td class="itemItemTd"><div id="qvProcessingTime">&nbsp;</div></td></tr>\
    <tr><td class="itemLabelTd">&nbsp;</td><td class="itemItemTd">&nbsp;</td></tr>\
    <tr><td colspan="2" align=center><div id="qvIboxGreen">&nbsp;</div></td></tr>\
  	<tr><td colspan="2" align=center><div id="qvNewItem">&nbsp;</div></td></tr>\
    <tr><td colspan="2" align=center><div id="qvMultiColor">&nbsp;</div></td></tr>\
   </table>\
  </div>\
  <div id="second">\
   <iframe id="priceingIframe" marginwidth="0" marginheight="10" frameborder="0" src="http://site.invitationbox.com/pricing/dynPricing.php?pcode=&tab=y&blank=T" height=250 width=225></iframe>\
  </div>\
 </div>\
 <div class="modalClose" style="margin-right:4px;"><a href="javascript:hideMe()"><img class="rollOverImg" src="http://site.invitationbox.com/images/btnCloseCircle-off.gif" border="0"/></a></div>\
 <div id="qvGotoItem"></div>\
</div>\
<div id="qvOverlay"></div>');

function loadQuickView(itemIdx) {
	
	$(function () {
		var tabContainers = $('div.qvTabs > div');
		tabContainers.hide().filter(':first').show();
		
		$('div.qvTabs ul.tabNavigation a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('#firstTab').removeClass('selected');
			$('#secondTab').removeClass('selected');
			$(this.hash + 'Tab').addClass('selected');
			return false;
		}).filter(':first').click();
	});	
	
	var localItem = pageSegment[itemIdx];
	
	$("#quickView").show('fast');
	$("#qvOverlay").show();
	
	$("#qvImage").html("<a href='/"+localItem.id+".html'>" + localItem.listimg + "</a>");
	
	$("#qvItemName").html(localItem.name);
	$("#qvVendor").html(localItem.brand);
	$("#qvItemNum").html(localItem.code);
	$("#qvGotoItem").html("<a href='/" + localItem.id + ".html'><img src='http://site.invitationbox.com/images/btnLearnMore_0.gif' border=0></a>");
	
	if (localItem.brand == "William Arthur") {
		var priceTab = "http://site.invitationbox.com/pricing/waPricing.php?"+localItem['availablePricecodes']+"&quickview=y";
	} else {
		var priceTab = "http://site.invitationbox.com/pricing/dynPricing.php?pcode="+localItem['pricecode']+"&quickview=y";
	}

	if (localItem['showsalepricing']) {
		priceTab += "&sale=T";
	}
	
	if (localItem['blank']) {
		priceTab += "&blank=T";
	}
	
	if (localItem['showsupersalepricing']) {
	      priceTab += "&supersale=t";        
	}
	
	if (!localItem['invitation']) {
		var showprice;
		if (localItem['showsalepricing']) {
			showprice = localItem.saleprice;
		} else {
			showprice = localItem.price;
		}
		showprice = showprice.substring(showprice.indexOf("Price:")+6);
		priceTab += "&showPrice=" + showprice;
	}
	
	$("#second > iframe").attr("src",priceTab);
	
	if (localItem['productsize']) {
		$("#qvSize").html(localItem['productsize']);
	} else {
		$("#qvSize").html("");
	}	

	if (localItem['processingtime']) {
		$("#qvProcessingTime").html(localItem['processingtime']);
	} else {
		$("#qvProcessingTime").html("");
	}	
		
	if (localItem['shipfromstate']) {
		$("#qvShipsFrom").html(localItem['shipfromstate']);
	} else {
		$("#qvShipsFrom").html("");
	}	

	if (localItem['invitation']) {	
		if (localItem['paperweight']) {
			$("#qvPaperWeight").html(localItem['paperweight']);
		}
	
		if (localItem['newitem']) {
			$("#qvNewItem").html("<img src='http://site.invitationbox.com/images/newitem_icon.gif' border=0>");
		} else {
			$("#qvNewItem").html("");
		}
			
		if (localItem['blank']) {
			$("#qvBlank").html("Yes");
		} else {
			$("#qvBlank").html("No");
		}
	
		if (localItem['green']) {
			$("#qvIboxGreen").html("<img src='http://site.invitationbox.com/images/iboxgreenshort.gif' />");
		} else {
			$("#qvIboxGreen").html("");
		}

		if (localItem['multiColor']) {
			$("#qvMultiColor").html("<img src='http://site.invitationbox.com/images/qvSwatch/swatch-"+localItem['egSwatchName']+".gif' />");
		} else {
			$("#qvMultiColor").html("");
		}
	} else {
		$("#qvLblPaperWeight").html("");
		$("#qvLblBlank").html("");		
	}
	$('img.rollOverImg').hover(
		function() {
			this.src = this.src.replace("-off", "-on");
		},
		function() {
			this.src = this.src.replace("-on", "-off");
		}
	);
}

function hideMe() {
	$("#qvOverlay").hide();
	$("#quickView").hide('slow');
}

