document.write('\
<div id="quickView">\
 <div class="qvTitle" id="qvItemName"></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">\
    <tr><td style="font-weight:bold;width:90px;">Item #:</td><td><span id="qvItemNum">&nbsp;</span></td></tr>\
    <tr><td style="font-weight:bold;width:90px;">Designer:</td><td><span id="qvVendor">&nbsp;</span></td></tr>\
    <tr><td style="font-weight:bold;width:90px;">&nbsp;</td><td>&nbsp;</td></tr>\
    <tr><td style="font-weight:bold;width:90px;">Size:</td><td><div id="qvSize">&nbsp;</div></td></tr>\
    <tr><td style="font-weight:bold;width:90px;" id="qvLblPaperWeight">Card Stock:</td><td><div id="qvPaperWeight">&nbsp;</div></td></tr>\
    <tr><td style="font-weight:bold;width:90px;" id="qvLblBlank">Available Blank:</td><td><div id="qvBlank">&nbsp;</div></td></tr>\
    <tr><td style="font-weight:bold;width:90px;">&nbsp;</td><td>&nbsp;</td></tr>\
    <tr><td style="font-weight:bold;width:90px;">Ships From:</td><td><div id="qvShipsFrom">&nbsp;</div></td></tr>\
    <tr><td style="font-weight:bold;width:90px;">Lead Time:</td><td><div id="qvProcessingTime">&nbsp;</div></td></tr>\
    <tr><td style="font-weight:bold;width:90px;">&nbsp;</td><td>&nbsp;</td></tr>\
    <tr><td colspan="2" align=center><div id="qvIboxGreen">&nbsp;</div></td></tr>\
    <tr><td colspan="2" align=center><div id="qvPreview">&nbsp;</div></td></tr>\
   </table>\
  </div>\
  <div id="second">\
   <iframe MARGINWIDTH=0 MARGINHEIGHT=10 FRAMEBORDER=0 src="http://site.invitationbox.com/pricing/dynPricing.php?pcode=&tab=y" height=250 width=225></iframe>\
  </div>\
 </div>\
 <div class="qvClose"><a href="javascript:hideMe()"><img src="http://site.invitationbox.com/images/close-x.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/learn-more.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['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['preview']) {
			$("#qvPreview").html("<img src='http://site.invitationbox.com/images/online_preview.gif' border=0>");
		} else {
			$("#qvPreview").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("");
		}
	} else {
		$("#qvLblPaperWeight").html("");
		$("#qvLblBlank").html("");		
	}
}

function hideMe() {
	$("#qvOverlay").hide();
	$("#quickView").hide('slow');
}
