/* FC_quickview :
	FranklinCovey Quick View functionality
	Author: Cornelius Johnson
*/
// INIT
// preload icons
var icon_hover = new Image();
var icon_on = new Image();
icon_hover.src = "/shopping/images/FC_quickview/QV_on.png";
icon_on.src = "/shopping/images/FC_quickview/QV_hover.png";
// preload frame
var frame_bottom = new Image();
var frame_bottom_left = new Image();
var frame_bottom_right = new Image();
var frame_bottom_start = new Image();
var frame_close = new Image();
var frame_left = new Image();
var frame_left_start = new Image();
var frame_right = new Image();
var frame_right_start = new Image();
var frame_top = new Image();
var frame_top_left = new Image();
var frame_top_right = new Image();
frame_bottom.src = "/shopping/images/FC_quickview/frame/bottom.png";
frame_bottom_left.src = "/shopping/images/FC_quickview/frame/bottom_left.png";
frame_bottom_right.src = "/shopping/images/FC_quickview/frame/bottom_right.png";
frame_bottom_start.src = "/shopping/images/FC_quickview/frame/bottom_start.png";
frame_close.src = "/shopping/images/FC_quickview/frame/close.gif";
frame_left.src = "/shopping/images/FC_quickview/frame/left.png";
frame_left_start.src = "/shopping/images/FC_quickview/frame/left_start.png";
frame_right.src = "/shopping/images/FC_quickview/frame/right.png";
frame_right_start.src = "/shopping/images/FC_quickview/frame/right_start.png";
frame_top.src = "/shopping/images/FC_quickview/frame/top.gif";
frame_top_left.src = "/shopping/images/FC_quickview/frame/top_left.png";
frame_top_right.src = "/shopping/images/FC_quickview/frame/top_right.png";
// delay vars
var icon_flag = false;
var icon_interval = null;
// global instance of quickview
var QV_display = new FC_quickview();
var rd = false;

// function will start quick view process (delay)
function FC_QV_START (elementName, skuid, prodid, type, template, store) {

	if ( store != "" ) {
	   //if ( store == "franklincovey" || store == "quixtar" || store == "gsa" || store == "corporatemarketplace" ) {
	   //		rd = true;
	   //}
	   //if ( store == "franklincovey" ) {
	   		rd = true;
	   //}
	}
	if(prodid.indexOf("cat") == -1 && prodid != "prod2400001" && template != "Product Third Party Template") {
		// prepare to show icon
		var icon = document.getElementById('FC_QV_icon');
		// if icon not found... page not fully loaded... call again after slight delay
		if(icon == null) {
			setTimeout('FC_QV_START(\'' + elementName + '\', \'' + skuid + '\', \'' + prodid +'\', ' + type +');', 100);
			return;}
		
		// prepare icon (IE with png loader)
		if(navigator.appName=="Microsoft Internet Explorer")	
			icon.innerHTML = '<a href="javascript:FC_QV_SHOW(\'' + prodid + '\', \'' + skuid + '\', ' + type + ', \'' + template + '\');" onmouseover="QV_IE_swapIcon(\'on\');" onmouseout="QV_IE_swapIcon(\'off\');"><div id="FC_QV_ICON_IMAGE" style="height:38px; width:136px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/QV_on.png\', sizingMethod=\'scale\');"></div></a>';
		else
			icon.innerHTML = '<a href="javascript:FC_QV_SHOW(\'' + prodid + '\', \'' + skuid + '\', ' + type + ', \'' + template + '\');"><img src="' + icon_hover.src + '" border="0" alt="" onmouseover="this.src=icon_on.src; icon_flag = true;" onmouseout="this.src=icon_hover.src; icon_flag = false;"/></a>';
		
		var imageObject = document.getElementById("s" + elementName + "Pos");
		var imagePos = findPos(imageObject);
		if ( rd ) {
			icon.style.top = Number(imagePos[1] + 100);
		} else {
			icon.style.top = Number(imagePos[1] + 50);
		}
		
		icon.style.left = Number(imagePos[0] + imageObject.offsetWidth / 2 - icon_hover.width / 2);
				
		// set icon show delay
		icon_flag = true;
		if(icon_interval != null) clearInterval(icon_interval);
		icon_interval = setInterval('FC_QV_ICON_HIDE();', 350);
		imageObject.onmouseout = function() {icon_flag = false;};
}	}

function QV_IE_swapIcon(state) {
	if (state == "on") {
		document.getElementById("FC_QV_ICON_IMAGE").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = icon_on.src;
		icon_flag = true;
		document.body.style.cursor = 'pointer';}
	else {
		document.getElementById("FC_QV_ICON_IMAGE").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = icon_hover.src;
		icon_flag = false;
		document.body.style.cursor = 'default';}}

// displays quickview
function FC_QV_SHOW(prodid, skuid, type, template, store) {
	// hide existing window
	document.getElementById('FC_QV').style.display = "none";
	
	// fills in quickview data
	QV_display.setType(type);
	
	QV_display.setID(prodid);
	QV_display.setSkuID(skuid);
	QV_display.setTemplateName(template);
	// requests information from server & display once server information is received
	QV_display.showQV();
}

function FC_QV_ICON_HIDE() {
	if (!icon_flag) {
		document.getElementById('FC_QV_icon').style.display = "none";
		clearInterval(icon_interval);}
	else 
		document.getElementById('FC_QV_icon').style.display = "block";}
		
function FC_QV_HIDE() {
		document.getElementById('FC_QV').style.display = "none";}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
	}	}
	return [curleft,curtop];
}

function FC_quickview() {
	// vars
	var XMLHTTP_OBJ;
	var QVHTML = "";
	var TYPE = 1;
	var HEIGHT = 0;
	var WIDTH = 0;
	var PRODID = '';
	var SKUID = '';
	var TEMPLATENAME = '';
	
	// methods
	this.showQV = showQV;
	this.setType = setType;
	this.setID = setID;
	this.setSkuID = setSkuID;
	this.setTemplateName = setTemplateName;
	this.redrawQV = redrawQV;
	
	function writeQV() {
		// write html into quickview div
		var quickview = document.getElementById('FC_QV');
		// If type, do the big one
		if ( rd == true ) {
			if (TYPE) {quickview.innerHTML = navigator.appName=="Microsoft Internet Explorer" ? writeQV_small_IE(HEIGHT) : writeQV_small_OTHER_RD();}
			else      {quickview.innerHTML = navigator.appName=="Microsoft Internet Explorer" ? writeQV_big_IE_RD(HEIGHT) : writeQV_big_OTHER_RD();}
		} else {
			if (TYPE) {quickview.innerHTML = navigator.appName=="Microsoft Internet Explorer" ? writeQV_small_IE(HEIGHT) : writeQV_small_OTHER();}
			else      {quickview.innerHTML = navigator.appName=="Microsoft Internet Explorer" ? writeQV_big_IE(HEIGHT) : writeQV_big_OTHER();}
		}
		
		// position quickview
		var windowSize = getWindowSize();
		var scrollOffset = getScrollOffset();
		quickview.style.display = "block";
		var x = (windowSize[0] / 2 + scrollOffset[0]) - (quickview.offsetWidth / 2);
		var y = (windowSize[1] / 2 + scrollOffset[1]) - (quickview.offsetHeight / 2);
  		quickview.style.top = y < 120 ? 120 : y;
  		quickview.style.left = x;
  		
  		// redraw frame height with actual content
  		redrawQV();
	}
  	
  	function redrawQV() {
  		var quickview = document.getElementById('FC_QV');
  		var qvContent = document.getElementById('FC_QUICKVIEW_CONTENT');
  		var qvDetails = document.getElementById('product-details');
  		// save content
  		QVHTML = qvContent.innerHTML;
  		// redraw
  		var frameHeight = qvDetails.offsetHeight + 265;
  		if(navigator.appName=="Microsoft Internet Explorer") {
  			if ( rd == true ) {
				if (TYPE) {quickview.innerHTML = writeQV_small_IE_RD(frameHeight);}
				else      {quickview.innerHTML = writeQV_big_IE_RD(frameHeight);}
			} else {
				if (TYPE) {quickview.innerHTML = writeQV_small_IE(frameHeight);}
				else      {quickview.innerHTML = writeQV_big_IE(frameHeight);}
			}
  		}
  		else {
  			document.getElementById("QV_frame_right_img").height=frameHeight;
	  		document.getElementById("QV_frame_left_img").height=frameHeight;
	}  	}
	
	function writeQV_small_OTHER() {
	   
		html = 	'<table cellpadding="0" cellspacing="0" border="0" width="286" height="361">\n';
		html +=	'<tr>';
		html +=	'		<td width="9" height="6"><img src="/shopping/images/FC_quickview/frame/top_left.png" height="6" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="253"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="253" alt="" /></td>\n';
		html +=	'		<td width="17"><img src="/shopping/images/FC_quickview/frame/top_right.png" height="6" width="17" border="0" alt=""/></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top" height="8"><img src="/shopping/images/FC_quickview/frame/left_start.png" height="8" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF">\n';
		html +=	'			<div align="right" style="position:relative; left:-3px; top:3px;"><a href="javascript:FC_QV_HIDE();"><img src="/shopping/images/FC_quickview/frame/close.gif" height="15" width="42" alt="close" border="0"/></a></div>\n';
		html +=	'			<div align="center" style="position:relative; top:15px;" id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>\n';
		html +=	'			<div align="center" style="position:relative; top:20px;"><a href="javascript:openWinRequired(\'largerImage.jsp?sku=' + PRODID + '\',\'largeImage\',\'height=600,width=640\');">View Larger</a><br/><a href="#">Click to view all product options</a></div>\n';
		html +=	'		</td>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame/right_start.png" height="8" width="17" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame/left.png" height="327" width="9" alt="" /></td>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame/right.png" height="327" width="17" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td height="20"><img src="/shopping/images/FC_quickview/frame/bottom_left.png" height="20" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame/bottom_start.png" height="20" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left"><img src="/shopping/images/FC_quickview/frame/bottom.png" height="20" width="253" alt="" /></td>\n';
		html +=	'		<td><img src="/shopping/images/FC_quickview/frame/bottom_right.png" height="20" width="17" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'</table>\n';
		
		return html;
	}
	
	function writeQV_small_OTHER_RD() {
	
		html = 	'<table cellpadding="0" cellspacing="0" border="0" width="286">\n';
		html +=	'<tr>';
		html +=	'		<td width="9" height="6"><img src="/shopping/images/FC_quickview/frame_rd/top_left.png" height="6" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame_rd/top.png" height="6" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="253"><img src="/shopping/images/FC_quickview/frame_rd/top.png" height="6" width="253" alt="" /></td>\n';
		html +=	'		<td width="17"><img src="/shopping/images/FC_quickview/frame_rd/top_right.png" height="6" width="17" border="0" alt=""/></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td colspan="4" valign="top" bgcolor="#FFFFFF">\n';
		html +=	'			<div align="right" style="position:relative; left:-3px; top:3px;"><a href="javascript:FC_QV_HIDE();"><img src="/shopping/images/FC_quickview/frame/close.gif" height="15" width="42" alt="close" border="0"/></a></div>\n';
		html +=	'			<div align="center" style="position:relative; top:15px;" id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>\n';
		html +=	'			<div align="center" style="position:relative; top:20px;"><a href="javascript:openWinRequired(\'largerImage.jsp?sku=' + PRODID + '\',\'largeImage\',\'height=600,width=640\');">View Larger</a><br/><a href="#">Click to view all product options</a></div>\n';
		html +=	'		</td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame_rd/left.png" height="327" width="9" alt="" /></td>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame_rd/right.png" height="327" width="17" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td height="20"><img src="/shopping/images/FC_quickview/frame_rd/bottom_left.png" height="20" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left"><img src="/shopping/images/FC_quickview/frame_rd/bottom.png" height="20" width="253" alt="" /></td>\n';
		html +=	'		<td><img src="/shopping/images/FC_quickview/frame_rd/bottom_right.png" height="20" width="17" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'</table>\n';
		
		return html;
	}
	function writeQV_big_OTHER() {

		html =	'<table cellpadding="0" cellspacing="0" border="0" width="512" >\n';
		html +=	'	<tr>\n';
		html +=	'		<td width="9" height="6"><img src="/shopping/images/FC_quickview/frame/top_left.png" height="6" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="253"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="479" alt="" /></td>\n';
		html +=	'		<td width="17"><img src="/shopping/images/FC_quickview/frame/top_right.png" height="6" width="17" border="0" alt=""/></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top" height="8"><img src="/shopping/images/FC_quickview/frame/left_start.png" height="8" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF">\n';
		html +=	'			<div align="right" style="position:absolute; left:465px; top:8px;"><a href="javascript:FC_QV_HIDE();"><font face="Arial, Helvetica, sans-serif" size="1" style="text-decoration:underline;">close</font></a></div>\n';
		html +=	'			<div align="center" style="position:absolute; top:285px; left:19px;"><img src="/shopping/images/clear.gif" height="1" width="463" alt="" /></div>\n';
		html +=	'			<div style="float:left; position:absolute; left:224px; top:16px;"><img src="/shopping/images/clear.gif" height="270" width="1" alt="" /></div>\n';
		html +=	'			<div id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>\n';
		html +=	'		</td>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame/right_start.png" height="8" width="17" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top"><img id="QV_frame_left_img" src="/shopping/images/FC_quickview/frame/left.png" height="379" width="9" alt="" /></td>\n';
		html +=	'		<td valign="top"><img id="QV_frame_right_img" src="/shopping/images/FC_quickview/frame/right.png" height="379" width="17" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td height="20"><img src="/shopping/images/FC_quickview/frame/bottom_left.png" height="20" width="9" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame/bottom_start.png" height="20" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left"><img src="/shopping/images/FC_quickview/frame/bottom.png" height="20" width="479" alt="" /></td>\n';
		html +=	'		<td><img src="/shopping/images/FC_quickview/frame/bottom_right.png" height="20" width="17" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'</table>\n';
		
		return html;
	}
	
	function writeQV_big_OTHER_RD() {
		html =	'<table cellpadding="0" cellspacing="0" style="width:512;border:none;margin-left:-8px; margin-top:-14px;">\n';
		html +=	'	<tbody><tr>\n';
		html +=	'		<td style="height:20;width:20;"><img src="/shopping/images/FC_quickview/frame_rd/tleft.png" height="20" width="20" border="0" alt="" /></td>\n';
		html +=	'		<td style="text-align:left;width:7;"><img src="/shopping/images/FC_quickview/frame_rd/top.png" height="20" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td style="text-align:left;width:479;"><img src="/shopping/images/FC_quickview/frame_rd/top.png" height="20" width="479" alt="" /></td>\n';
		html +=	'		<td style="width:20;"><img src="/shopping/images/FC_quickview/frame_rd/tright.png" height="20" width="20" border="0" alt=""/></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top" height="8"><img src="/shopping/images/FC_quickview/frame_rd/left.png" height="8" width="20" border="0" alt="" /></td>\n';
		html +=	'		<td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF">\n';
		html +=	'			<div align="right" style="z-index:9999;position:absolute; left:450px; top:12px;"><a href="javascript:FC_QV_HIDE();"><span style="padding-right:3px;><font face="Arial, Helvetica, sans-serif" size="1">close</font></span><img style="vertical-align:middle;" src="/shopping/images/shop_template/close_button.gif" border="0"/></a></div>\n';
		html +=	'			<div align="center" style="position:absolute; top:285px; left:19px;"><img src="/shopping/images/clear.gif" height="1" width="463" alt="" /></div>\n';
		html +=	'			<div style="float:left; position:absolute; left:224px; top:16px;"><img src="/shopping/images/clear.gif" height="270" width="1" alt="" /></div>\n';
		html +=	'			<div id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>\n';
		html +=	'		</td>\n';
		html +=	'		<td valign="top"><img src="/shopping/images/FC_quickview/frame_rd/right.png" height="8" width="20" border="0" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td valign="top"><img id="QV_frame_left_img" src="/shopping/images/FC_quickview/frame_rd/left.png" height="379" width="20" alt="" /></td>\n';
		html +=	'		<td valign="top"><img id="QV_frame_right_img" src="/shopping/images/FC_quickview/frame_rd/right.png" height="379" width="20" alt="" /></td>\n';
		html +=	'	</tr>\n';
		html +=	'	<tr>\n';
		html +=	'		<td height="20"><img src="/shopping/images/FC_quickview/frame_rd/bleft.png" height="20" width="20" border="0" alt="" /></td>\n';
		html +=	'		<td align="left" width="7"><img src="/shopping/images/FC_quickview/frame_rd/bottom.png" height="20" width="7" border="0" alt="" /></td>\n';
		html +=	'		<td align="left"><img src="/shopping/images/FC_quickview/frame_rd/bottom.png" height="20" width="479" alt="" /></td>\n';
		html +=	'		<td><img src="/shopping/images/FC_quickview/frame_rd/bright.png" height="20" width="20" border="0" alt="" /></td>\n';
		html +=	'	</tr></tbody>\n';
		html +=	'</table>\n';	
		
		return html;
	}
	
	function writeQV_big_IE(IE_height) {
		html =	'<table cellpadding="0" cellspacing="0" border="0" width="512" >';
		html +=	'<tr><td width="9" height="6"><div style="height:6px; width:9px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/top_left.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left" width="7" bgcolor="#FFFFFF"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="7" border="0" alt="" /></td>';
		html +=	'<td align="left" width="253" bgcolor="#FFFFFF"><img src="/shopping/images/FC_quickview/frame/top.gif" height="6" width="479" alt="" /></td>';
		html +=	'<td width="17"><div style="height:6px; width:17px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/top_right.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr><tr>';
		html +=	'<td valign="top" height="8"><div style="height:8px; width:9px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/left_start.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="right" style="position:absolute; left:465px; top:8px;"><a href="javascript:FC_QV_HIDE();"><font face="Arial, Helvetica, sans-serif" size="1" style="text-decoration:underline;">close</font></a></div>';
		html +=	'<div align="center" style="position:absolute; top:285px; left:19px;"><img src="/shopping/images/clear.gif" height="1" width="463" alt="" /></div>';
		html +=	'<div style="float:left; position:absolute; left:224px; top:16px;"><img src="/shopping/images/clear.gif" height="270" width="1" alt="" /></div>';
		html +=	'<div id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>';
		html +=	'</td>';
		html +=	'<td valign="top"><div style="height:8px; width:17px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/right_start.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'<tr><td valign="top"><div id="QV_frame_left_img" style="height:' + IE_height + 'px; width:9px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/left.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td valign="top"><div id="QV_frame_right_img" style="height:' + IE_height + 'px; width:17px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/right.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'<tr><td height="20"><div style="height:20px; width:9px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/bottom_left.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left" width="7"><div style="height:20px; width:7px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/bottom_start.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left"><div style="height:20px; width:479px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/bottom.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td><div style="height:20px; width:17px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame/bottom_right.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'</table>';
		
		return html;
	}
	
	function writeQV_big_IE_RD(IE_height) {

		html =	'<table cellpadding="0" cellspacing="0" border="0" width="512" style="margin-left:-8px; margin-top:-14px;" >';
		html +=	'<tr><td width="20" height="20"><div style="height:20px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/tleft.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left" width="7"><div style="height:20px; width:7px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/top.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left"><div style="height:20px; width:479px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/top.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td width="20"><div style="height:20px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/tright.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr><tr>';
		html +=	'<td valign="top" height="8"><div style="height:8px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/left.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="right" style="z-index=9999;position:absolute; left:450px; top:6px;white-space:nowrap;height:16px;vertical-align:top;"><a href="javascript:FC_QV_HIDE();"><span><span style="padding-right:3px;><font face="Arial, Helvetica, sans-serif" size="10px">close</font></span><img style="vertical-align:middle;" src="/shopping/images/shop_template/close_button.gif" border="0"/></a></span></div>';
		html +=	'<div align="center" style="position:absolute; top:28px; left:19px;"><img src="/shopping/images/clear.gif" height="1" width="463" alt="" /></div>';
		html +=	'<div style="float:left; position:absolute; left:224px; top:16px;"><img src="/shopping/images/clear.gif" height="270" width="1" alt="" /></div>';
		html +=	'<div id="FC_QUICKVIEW_CONTENT">' + QVHTML + '</div>';
		html +=	'</td>';
		html +=	'<td valign="top"><div style="height:8px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/right.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'<tr><td valign="top"><div id="QV_frame_left_img" style="height:' + IE_height + 'px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/left.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td valign="top"><div id="QV_frame_right_img" style="height:' + IE_height + 'px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/right.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'<tr><td height="20"><div style="height:20px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/bleft.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left" width="7"><div style="height:20px; width:7px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/bottom.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td align="left"><div style="height:20px; width:479px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/bottom.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'<td><div style="height:20px; width:20px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/shopping/images/FC_quickview/frame_rd/bright.png\', sizingMethod=\'scale\');"></div></td>';
		html +=	'</tr>';
		html +=	'</table>';
		
		return html;
	}
	
	function showQV() {
		if (PRODID.length == 0) {
			QVHTML = "";
			return;}

		XMLHTTP_OBJ = GetXMLHTTPObject();
		if (XMLHTTP_OBJ == null)
			return;
		
		// request data
		var urlOptions = "productId=" + PRODID;
		if (SKUID.length > 0){
			urlOptions += "&skuid=" + SKUID;
		}
		if (TEMPLATENAME.length > 0){
			urlOptions += "&requestorTemplateName=" + TEMPLATENAME;
		}
		if ( rd ) {
			urlOptions += "&redesign=yes";
		}
		var url = "/shopping/catalog/quickview.jsp?" + urlOptions;
		XMLHTTP_OBJ.onreadystatechange = stateChanged_Img;
		XMLHTTP_OBJ.open("GET", url, true);
		XMLHTTP_OBJ.send(null);
	}

	function GetXMLHTTPObject() {
		var XMLObject = null;
		try {
			// Firefox, Opera 8.0+, Safari
			XMLObject = new XMLHttpRequest(); }
		catch (e) {
			// Internet Explorer
			try {
				XMLObject = new ActiveXObject("Msxml2.XMLHTTP");}
			 catch (e) {
					XMLObject = new ActiveXObject("Microsoft.XMLHTTP");
		}	}
		return XMLObject;
	}
		
		
	function stateChanged_Img() { 
		if (XMLHTTP_OBJ.readyState==4 && XMLHTTP_OBJ.responseText.indexOf("<head>") == -1) { 
			QVHTML = XMLHTTP_OBJ.responseText;
			writeQV();
	}	}
	
	function setType(type) {
		TYPE = type;
		// default quickview size
		if (TYPE) {
			WIDTH = 286;
			HEIGHT = 361;}
		else {
			WIDTH = 512;
			HEIGHT = 413;
	}	}
	
	function setID(id) {
		PRODID = id;}
		
	function setSkuID(id) {
		SKUID = id;}
		
	function setTemplateName(tn) {
		TEMPLATENAME = tn;}
		
	function getWindowSize() {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
	 		myHeight = document.documentElement.clientHeight;
	 	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		return [ myWidth, myHeight];
	}
	

	function getScrollOffset() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}
		return [ scrOfX, scrOfY ];
}	}

