﻿// JScript File

function PRODUCTVIEWTABNONE(){return-1;}
function PRODUCTVIEWTABDETAILS(){return 0;}
function PRODUCTVIEWTABIMAGES(){return 1;}
function PRODUCTVIEWTABVIDEOS(){return 2;}
function PRODUCTVIEWTABDOWNLOADS(){return 3;}
function PRODUCTVIEWTABUNKNOWN(){return 4;}
function PRODUCTVIEWCALLERSHOP(){return 0;}
function PRODUCTVIEWCALLERWL(){return 1;}
function CATVIEWDSTTYPEPRODUCT(){return 1;}
function CATVIEWDSTTYPECOLLECTION(){return 2;}
function CATVIEWSORTTYPENAMEASC(){return"nameasc";};function CATVIEWSORTTYPENAMEDESC(){return"namedesc";};function CATVIEWSORTTYPEPRICEASC(){return"priceasc";};function CATVIEWSORTTYPEPRICEDESC(){return"pricedesc";};function GETROOTURL(){return"http://www.annthegran.com"};function productViewInstance()
{this.catalogId=-1;this.callBack=0;this.selectedTabId=PRODUCTVIEWTABNONE();this.tabs=new Array();this.layer=null;this.callerId=0;this.images=new imageQueueInstance();return this;}
var __productView=new productViewInstance();function productViewTabFirstAvail()
{if(productViewMediaDetailsGet().length)
return PRODUCTVIEWTABDETAILS();if(productViewMediaImagesGet().length)
return PRODUCTVIEWTABIMAGES();if(productViewMediaVideosGet().length)
return PRODUCTVIEWTABVIDEOS();if(productViewMediaDownloadsGet().length)
return PRODUCTVIEWTABDOWNLOADS();if(productViewMediaUnknownGet().length)
return PRODUCTVIEWTABUNKNOWN();return PRODUCTVIEWTABNONE();}
function productViewMediaImagesGet()
{var mediaFiles=__productInfo.products[0].media;var a=new Array();for(var i=0;i<mediaFiles.length;i++)
{if(mediaFiles[i].mime=="image/jpeg"||mediaFiles[i].mime=="image/gif"||mediaFiles[i].mime=="image/png")
a.push(mediaFiles[i]);}
return a;}
function productViewMediaVideosGet()
{var mediaFiles=__productInfo.products[0].media;var a=new Array();for(var i=0;i<mediaFiles.length;i++)
{if(mediaFiles[i].mime=="video/avi"||mediaFiles[i].mime=="video/quicktime"||mediaFiles[i].mime=="windows/metafile"||mediaFiles[i].mime=="application/x-shockwave-flash")
a.push(mediaFiles[i]);}
return a;}
function productViewMediaDownloadsGet()
{var mediaFiles=__productInfo.products[0].media;var a=new Array();for(var i=0;i<mediaFiles.length;i++)
{if(mediaFiles[i].mime=="application/pdf"||mediaFiles[i].mime=="application/msword"||mediaFiles[i].mime=="text/plain"||mediaFiles[i].mime=="text/xml"||mediaFiles[i].mime=="application/zip"||mediaFiles[i].mime=="application/rar")
a.push(mediaFiles[i]);}
return a;}
function productViewMediaDetailsGet()
{var mediaFiles=__productInfo.products[0].media;var a=new Array();for(var i=0;i<mediaFiles.length;i++)
{if(mediaFiles[i].mime=="text/html")
a.push(mediaFiles[i]);}
return a;}
function productViewMediaUnknownGet()
{var mediaFiles=__productInfo.products[0].media;var a=new Array();for(var i=0;i<mediaFiles.length;i++)
{if(mediaFiles[i].mime=="unknown")
a.push(mediaFiles[i]);}
return a;}
function productViewClear()
{var ctrlView=document.getElementById("ctrlview");while(ctrlView.firstChild)
ctrlView.removeChild(ctrlView.firstChild);}
function productViewDrawBody()
{productViewClear();if(__productInfo.products.length==0)
return;if(__productInfo.products[0].type=="DESIGNPACK")
productViewDrawDesignPack();else
productViewDrawProduct();}
function productViewDrawDetails()
{var ctrlView=document.getElementById("ctrlview");{var table=document.createElement("table");table.style.width="100%";table.cellPadding=0;table.cellSpacing=0;var tBody=document.createElement("tbody");{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.style.textAlign="center";td.style.verticalAlign="middle";var a=document.createElement("a");a.href="/Shop.aspx";var img=new Image();var Limg=new Image();img.border=0;td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="middle";td.style.width="30%";var img=new Image();img.src=GETROOTURL()+__productInfo.products[0].img;img.id="spic";if(__productInfo.products[0].largeicon!=undefined)
{var PreloadedImg=new Image();PreloadedImg.id="PreloadedImg";PreloadedImg.src=__productInfo.products[0].largeicon;}
if(__productInfo.products[0].largeicon!=undefined)
{img.onmouseover=function(){Tip('<img src='+__productInfo.products[0].largeicon+" width='300'>",JUMPHORZ,true,JUMPVERT,true,BGCOLOR,'#ffffff');return true;};img.onmouseout=function(){UnTip();};}
td.appendChild(img);tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top";td.style.width="70%";var h3=document.createElement("h3");h3.innerHTML=__productInfo.products[0].name;td.appendChild(h3);if(__productInfo.products[0].desc!=undefined)
{var span=document.createElement("span");span.className="productviewdetails";span.innerHTML=__productInfo.products[0].desc;td.appendChild(span);td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));}
if(__productInfo.products[0].brand!=undefined)
{var span=document.createElement("span");span.className="productviewdetails";span.appendChild(document.createTextNode(__productInfo.products[0].brand));td.appendChild(span);}
tr.appendChild(td);}
tBody.appendChild(tr);}
table.appendChild(tBody);ctrlView.appendChild(table);}
ctrlView.appendChild(document.createElement("br"));{var table=document.createElement("table");table.style.width="100%";table.cellPadding=0;table.cellSpacing=0;var tBody=document.createElement("tbody");{var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="justify";td.style.verticalAlign="top";var extdesc=__productInfo.products[0].extdesc;if(extdesc!=undefined)
{var span=document.createElement("span");span.className="productviewdescription";span.innerHTML=extdesc;td.appendChild(span);}
tr.appendChild(td);}
tBody.appendChild(tr);{var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="left";var span=document.createElement("span");span.className="ctrlproductinfo";span.id="spanProdInfo";td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);if(__productInfo.products[0]["IsOnPromotion"]=="True")
{var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="right";var b=document.createElement("b");b.className="productviewspecialoffer";b.appendChild(document.createTextNode("* "));td.appendChild(b);var span=document.createElement("span");span.className="productviewspecialoffer";span.appendChild(document.createTextNode(__productInfo.products[0].PromotionDescription));td.appendChild(span);tr.appendChild(td);tBody.appendChild(tr);}
table.appendChild(tBody);ctrlView.appendChild(table);}
ctrlView.appendChild(document.createElement("br"));if(parseFloat(__productInfo.products[0].price)!=0)
{var table=document.createElement("table");table.style.width="100%";var tBody=document.createElement("tbody");if(parseFloat(__productInfo.products[0].pricediscnotmember)!=parseFloat(__productInfo.products[0].price))
{{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="80%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="msclabel";span.appendChild(document.createTextNode("Price: "));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var del=document.createElement("del");del.className="msctext";del.appendChild(document.createTextNode("$"+__productInfo.products[0].price));td.appendChild(del);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="msctext";span.appendChild(document.createTextNode("$"+(__productInfo.products[0].pricediscnotmember)));td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="80%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="mscclublabel";span.appendChild(document.createTextNode("Club Price: "));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var del=document.createElement("del");del.className="mscclublabel";del.appendChild(document.createTextNode("$"+__productInfo.products[0].cprice));td.appendChild(del);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="mscclublabel";span.appendChild(document.createTextNode("$"+(__productInfo.products[0].pricediscmember)));td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);}}
else
{{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="90%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="msclabel";span.appendChild(document.createTextNode("Price: "));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="msctext";span.appendChild(document.createTextNode("$"+__productInfo.products[0].price));td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="90%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="mscclublabel";span.appendChild(document.createTextNode("Club Price: "));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="mscclublabel";span.appendChild(document.createTextNode("$"+__productInfo.products[0].cprice));td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);}}
if(parseFloat(__productInfo.products[0].rprice)!=0)
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="90%";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="msclabel";span.appendChild(document.createTextNode("MSRP: "));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="10";td.style.textAlign="right";td.style.verticalAlign="middle";var span=document.createElement("span");span.className="mscrrptext";span.appendChild(document.createTextNode("$"+__productInfo.products[0].rprice));td.appendChild(span);tr.appendChild(td);}
tBody.appendChild(tr);}
{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.style.textAlign="right";td.style.verticalAlign="middle";var a=document.createElement("a");a.href="javascript:cartMiniViewProductAdd("+__productInfo.products[0].id+");";var img=new Image();img.src="/images/addtocart.gif";img.border=0;a.appendChild(img);td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.style.textAlign="right";td.style.verticalAlign="middle";var a=document.createElement("a");var img=new Image();img.border=0;if(__productView.callerId==PRODUCTVIEWCALLERSHOP())
{a.href="javascript:wishListAddItem("+__productInfo.products[0].id+","+CATVIEWDSTTYPECOLLECTION()+");";img.src="/images/addwishlist.gif";}
else
{a.href="javascript:wishListDelItem("+__productInfo.products[0].id+");";img.src="/images/removewishlist.gif";}
a.appendChild(img);td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.style.textAlign="right";td.style.verticalAlign="middle";var a=document.createElement("a");a.href="javascript:printPage();";var img=new Image();img.src="/images/print-shop.gif";img.border=0;a.appendChild(img);td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);}
if(__productInfo.products[0].trial&&__productInfo.products[0].trial.length)
{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.style.textAlign="right";td.style.verticalAlign="middle";var a=document.createElement("a");a.href=__productInfo.products[0].trial;a.appendChild(document.createTextNode("Download Information"));td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);}
var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="right";td.colSpan="2";var span=document.createElement("span");span.innerHTML="<br/>";var a=document.createElement("a");a.className="foundlowerprice";a.href="Account/Support.aspx?FoundLowerPrice=1&id="+__productInfo.products[0].id;a.innerHTML="Found Lower Price?";td.appendChild(span);td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);ctrlView.appendChild(table);}
ctrlView.appendChild(document.createElement("br"));}
function productViewDrawDesignPack()
{imageQueueZero(__productView.images);productViewDrawDetails();if(__productInfo.products.length==0||__productInfo.products[0].media.length==0)
return;var ctrlView=document.getElementById("ctrlview");{var table=document.createElement("table");table.className="productviewtabs";table.cellPadding=0;table.cellSpacing=0;table.style.width="100%";table.style.height="23px";var tBody=document.createElement("tbody");var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="1px";td.style.height="23px";td.style.backgroundImage="url(/images/colhdr-left.gif)";tr.appendChild(td);}
{var td=document.createElement("td");td.style.height="23px";td.style.textAlign="center";td.style.backgroundImage="url(/images/colhdr-center.gif)";td.appendChild(document.createTextNode("Designs in this collection"));tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="1px";td.style.height="23px";td.style.backgroundImage="url(/images/colhdr-right.gif)";tr.appendChild(td);}
tBody.appendChild(tr);table.appendChild(tBody);ctrlView.appendChild(table);}
{var table=document.createElement("table");table.className="designviewpage";table.cellPadding=0;table.cellSpacing=0;table.style.width="100%";table.style.height="100%";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var k=1;for(var i=0;i<__productInfo.products[0].media.length;i++)
{var mime=__productInfo.products[0].media[i].mime;if(mime=="image/jpeg"||mime=="image/gif"||mime=="image/png")
{if(__productInfo.products[0].media[i].catalogId!=-2)
{var td=document.createElement("td");var a=document.createElement("a");td.style.width="25%";td.style.height="130px";td.style.textAlign="center";td.style.verticalAlign="middle";var img=new Image();img.src=__productInfo.products[0].media[i].thumburl;img.id="pic"+i;img.border=0;if(__productInfo.products[0].media[i].largeicon!=undefined)
{var imgvar=new Image();imgvar.id="PreloadedImg"+i;imgvar.src=__productInfo.products[0].media[i].largeicon;}
if(__productInfo.products[0].media[i].catalogId!=0&&__productInfo.products[0].media[i].catalogId!=-1)
{a.href="/Product.aspx?t=1&i="+__productInfo.products[0].media[i].catalogId;imageQueueAdd(__productView.images,"pic"+i,__productInfo.products[0].media[i].largeicon,GETROOTURL()+((__productInfo.products[0].media[i].thumburl)?__productInfo.products[0].media[i].thumburl:"/images/noiproduct.gif"));}
a.appendChild(img);td.appendChild(a);tr.appendChild(td);if(k++==4)
{tBody.appendChild(tr);tr=document.createElement("tr");k=1;}}}}}
tBody.appendChild(tr);table.appendChild(tBody);ctrlView.appendChild(table);imageQueueExecute(__productView.images,1,1);}
function productViewDrawProduct()
{productViewDrawDetails();if(__productInfo.products.length==0||__productInfo.products[0].media.length==0)
return;arrayRemoveAll(__productView.tabs);var firstAvail=productViewTabFirstAvail();if(firstAvail!=PRODUCTVIEWTABNONE())
{var ctrlView=document.getElementById("ctrlview");{var d=document.createElement("div");d.id="ctrltabcontrols";d.style.width="100%";d.style.height="25px";ctrlView.appendChild(d);}
{var d=document.createElement("div");d.id="ctrltabcontent";d.style.width="100%";ctrlView.appendChild(d);}
if(productViewMediaDetailsGet().length)
productViewTabAdd("Details",PRODUCTVIEWTABDETAILS(),productViewTabSelect(PRODUCTVIEWTABDETAILS()));if(productViewMediaImagesGet().length)
productViewTabAdd("Images",PRODUCTVIEWTABIMAGES(),productViewTabSelect(PRODUCTVIEWTABIMAGES()));if(productViewMediaVideosGet().length)
productViewTabAdd("Videos",PRODUCTVIEWTABVIDEOS(),productViewTabSelect(PRODUCTVIEWTABVIDEOS()));if(productViewMediaDownloadsGet().length)
productViewTabAdd("Downloads",PRODUCTVIEWTABDOWNLOADS(),productViewTabSelect(PRODUCTVIEWTABDOWNLOADS()));if(productViewMediaUnknownGet().length)
productViewTabAdd("Unknown",PRODUCTVIEWTABUNKNOWN(),productViewTabSelect(PRODUCTVIEWTABUNKNOWN()));}
productViewTabSelect(firstAvail)();}
function productViewTabAdd(_label,_id,_onclick)
{__productView.tabs.push({label:_label,id:_id,onclick:_onclick});}
function productViewDrawTabs()
{if(__productView.tabs.length==0)
return;var tabs=__productView.tabs;var table=document.createElement("table");table.className="productviewtabs";table.style.height="25px";table.cellPadding=0;table.cellSpacing=0;var tBody=document.createElement("tbody");var tr=document.createElement("tr");for(var i=0;i<tabs.length;i++)
{if(i)
{var td=document.createElement("td");td.style.width="2px";td.style.backgroundImage="url(/images/tabbut-sep.gif)";var img=new Image();img.style.width="2px";img.style.height="1px";img.src="/images/blank.gif";td.appendChild(img);tr.appendChild(td);}
{var td=document.createElement("td");td.style.backgroundImage="url(/images/tabbut-"+((tabs[i].id==__productView.selectedTabId)?"selected-":"")+"left.gif)";td.style.width="1px";var img=new Image();img.src="/images/blank.gif";img.style.width="1px";img.style.height="1px";td.appendChild(img);tr.appendChild(td);}
{var td=document.createElement("td");td.style.backgroundImage="url(/images/tabbut-"+((tabs[i].id==__productView.selectedTabId)?"selected-":"")+"center.gif)";td.style.textAlign="left";td.style.verticalAlign="middle";var nobr=document.createElement("nobr");{var img=new Image();img.src="/images/blank.gif";img.style.width="7px";img.style.height="1px";nobr.appendChild(img);}
nobr.appendChild(document.createTextNode(tabs[i].label));{var img=new Image();img.src="/images/blank.gif";img.style.width="7px";img.style.height="1px";nobr.appendChild(img);}
td.appendChild(nobr);td.onclick=tabs[i].onclick;td.onmouseover=function(){document.body.style.cursor="pointer";return true;};td.onmouseout=function(){document.body.style.cursor="auto";return true;};tr.appendChild(td);}
{var td=document.createElement("td");td.style.backgroundImage="url(/images/tabbut-"+((tabs.id==__productView.selectedTabId)?"selected-":"")+"right.gif)";td.style.width="1px";var img=new Image();img.src="/images/blank.gif";img.style.width="1px";img.style.height="1px";td.appendChild(img);tr.appendChild(td);}}
{var td=document.createElement("td");td.style.width="100%";tr.appendChild(td);}
tBody.appendChild(tr);table.appendChild(tBody);var tabctrls=document.getElementById("ctrltabcontrols");while(tabctrls.firstChild)
tabctrls.removeChild(tabctrls.firstChild);tabctrls.appendChild(table);}
function productViewTabSelect(tab){return function()
{__productView.selectedTabId=tab;productViewDrawTabs();productViewDrawTabContent(tab);return true;}}
function productViewDrawTabContent(tab)
{switch(tab)
{case PRODUCTVIEWTABDETAILS():productViewTabDrawDetails();break;case PRODUCTVIEWTABIMAGES():productViewTabDrawImages();break;case PRODUCTVIEWTABVIDEOS():productViewTabDrawVideos();break;case PRODUCTVIEWTABDOWNLOADS():productViewTabDrawDownloads();break;case PRODUCTVIEWTABUNKNOWN():productViewTabDrawUnknown();break;default:__productView.selectedTabId=PRODUCTVIEWTABNONE();productViewTabDrawNone();break;}}
function productViewTabDrawNone()
{}
function productViewTabDrawDetails()
{var ar=productViewMediaDetailsGet();var table=document.createElement("table");table.className="productviewpage";table.cellPadding=10;table.cellSpacing=0;table.style.width="100%";table.style.height="400px";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top";var tdText="";for(i=0;i<ar.length;i++)
tdText+=ar[i].desc;td.innerHTML=tdText;tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);var tv=document.getElementById("ctrltabcontent");while(tv.firstChild)
tv.removeChild(tv.firstChild);tv.appendChild(table);}
function productViewTabDrawImages()
{var ar=productViewMediaImagesGet();var table=document.createElement("table");table.className="productviewpage";table.style.width="100%";table.style.height="400px";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var tdc=1;for(i=0;i<ar.length;i++)
{var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="top";{var a=document.createElement("a");a.href="#";a.onclick=productViewMediaImageShow(ar[i]);var img=new Image();img.src=ar[i].thumburl;img.width=100;img.height=100;img.border=0;a.appendChild(img);td.appendChild(a);}
{td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));var a=document.createElement("a");a.href="#";a.onclick=productViewMediaImageShow(ar[i]);var img=new Image();img.src="/images/magnify.gif";img.border=0;a.appendChild(img);a.appendChild(document.createTextNode("View"));td.appendChild(a);}
tr.appendChild(td);if(tdc++==4)
{tBody.appendChild(tr);tr=document.createElement("tr");tdc=0;}}
tBody.appendChild(tr);table.appendChild(tBody);var tv=document.getElementById("ctrltabcontent");while(tv.firstChild)
tv.removeChild(tv.firstChild);tv.appendChild(table);}
function productViewTabDrawVideos()
{var ar=productViewMediaVideosGet();var table=document.createElement("table");table.className="productviewpage";table.style.width="100%";table.style.height="400px";var tBody=document.createElement("tbody");for(i=0;i<ar.length;i++)
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="top";var a=document.createElement("a");a.href="#";a.onclick=showvideo(ar[i]);var img=new Image();img.src=ar[i].thumburl;img.border=0;a.appendChild(img);td.appendChild(a);tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top";td.appendChild(document.createTextNode(ar[i].desc));td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));var a=document.createElement("a");a.href="#";a.onclick=showvideo(ar[i]);a.appendChild(document.createTextNode("Watch Video Clip"));td.appendChild(a);tr.appendChild(td);}
tBody.appendChild(tr);}
table.appendChild(tBody);var tv=document.getElementById("ctrltabcontent");while(tv.firstChild)
tv.removeChild(tv.firstChild);tv.appendChild(table);}
function showvideo(media)
{var path=GETROOTURL()+'/Videos/ShowVideo.aspx?url='+media.file;return function()
{window.open(path);}}
function productViewTabDrawDownloads()
{var ar=productViewMediaDownloadsGet();var table=document.createElement("table");table.className="productviewpage";table.cellPadding=10;table.cellSpacing=0;table.style.width="100%";var tBody=document.createElement("tbody");{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.height="20px";td.style.backgroundColor="#eeeeee";td.appendChild(document.createTextNode(" "));tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="middle";td.style.height="20px";td.style.backgroundColor="#eeeeee";td.appendChild(document.createTextNode("Description"));tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="middle";td.style.height="20px";td.style.backgroundColor="#eeeeee";td.appendChild(document.createTextNode("File"));tr.appendChild(td);}
tBody.appendChild(tr);}
for(i=0;i<ar.length;i++)
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top"
td.style.height="20px";var a=document.createElement("a");a.href=ar[i].file;a.target=ar[i].target;var img=new Image();img.src=ar[i].thumburl;img.border=0;a.appendChild(img);td.appendChild(a);tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top";td.style.height="20px";td.appendChild(document.createTextNode(ar[i].desc));tr.appendChild(td);}
{var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="top";td.style.height="20px";var a=document.createElement("a");a.href=ar[i].file;a.target=ar[i].target;a.appendChild(document.createTextNode("Download"));td.appendChild(a);tr.appendChild(td);}
tBody.appendChild(tr);}
table.appendChild(tBody);var tv=document.getElementById("ctrltabcontent");while(tv.firstChild)
tv.removeChild(tv.firstChild);tv.appendChild(table);}
function productViewTabDrawUnknown()
{var ar=productViewMediaUnknownGet();var table=document.createElement("table");table.className="productviewpage";table.style.width="100%";table.style.height="400px";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="left";td.style.verticalAlign="top";for(i=0;i<ar.length;i++)
{td.appendChild(document.createTextNode("FILE: "+ar[i].file+", IMG: "+ar[i].img+", DESC: "+ar[i].desc+", THUMB: "+ar[i].thumburl+", TARGET: "+ar[i].target));td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));}
tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);var tv=document.getElementById("ctrltabcontent");while(tv.firstChild)
tv.removeChild(tv.firstChild);tv.appendChild(table);}
function productViewMediaImageShow(media)
{return function()
{var s=document.getElementById("screen");s.style.visibility="visible";var sr={w:s.style.width,h:s.style.height};{var d=document.createElement("div");d.style.position="absolute";d.style.left="0px";d.style.top="0px";d.style.width=sr.w;d.style.height=sr.h;d.style.overflowY="scroll";d.style.backgroundColor="#000000";divOpacitySet(d,50);s.appendChild(d);}
{var d=document.createElement("div");d.style.position="absolute";d.style.left="0px";d.style.top="0px";d.style.width=sr.w;d.style.height=sr.h;d.style.overflowY="scroll";d.style.backgroundColor="transparent";var table=document.createElement("table");table.style.width="100%";table.style.height="100%";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="top";{var a=document.createElement("a");a.href="#";a.onclick=productViewMediaImageHide(d);var img=new Image();img.src="/images/closebutton.gif";img.border=0;a.appendChild(img);td.appendChild(a);}
var h1=document.createElement("h1");h1.style.color="#ffffff";h1.style.backgroundColor="#000000";h1.appendChild(document.createTextNode(media.desc));td.appendChild(h1);td.appendChild(document.createElement("br"));{var img=new Image();img.src=media.file;img.border=0;td.appendChild(img);td.appendChild(document.createElement("br"));td.appendChild(document.createElement("br"));}
{var a=document.createElement("a");a.href="#";a.onclick=productViewMediaImageHide(d);var img=new Image();img.src="/images/closebutton.gif";img.border=0;a.appendChild(img);td.appendChild(a);td.appendChild(document.createElement("br"));}
tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);d.appendChild(table);s.appendChild(d);}
return true;}}
function productViewMediaImageHide()
{return function()
{var s=document.getElementById("screen");while(s.firstChild)
s.removeChild(s.firstChild);s.style.visibility="hidden";return true;}}
function productViewMediaVideoShow(media)
{return function()
{var s=document.getElementById("screen");s.style.visibility="visible";var sr={w:s.style.width,h:s.style.height};{var d=document.createElement("div");d.style.position="absolute";d.style.left="0px";d.style.top="0px";d.style.width=sr.w;d.style.height=sr.h;d.style.backgroundColor="#000000";divOpacitySet(d,50);s.appendChild(d);}
{var d=document.createElement("div");d.style.position="absolute";d.style.left="0px";d.style.top="0px";d.style.width=sr.w;d.style.height=sr.h;d.style.backgroundColor="transparent";var table=document.createElement("table");table.style.width="100%";table.style.height="100%";var tBody=document.createElement("tbody");var tr=document.createElement("tr");var td=document.createElement("td");td.style.textAlign="center";td.style.verticalAlign="top";{var a=document.createElement("a");a.href="#";a.onclick=productViewMediaImageHide(d);var img=new Image();img.src="/images/closebutton.gif";img.border=0;a.appendChild(img);td.appendChild(a);}
td.appendChild(document.createElement("br"));var h1=document.createElement("h1");h1.style.color="#ffffff";h1.style.backgroundColor="#000000";h1.appendChild(document.createTextNode(media.desc));td.appendChild(h1);{var span=document.createElement("span");if(media.mime=="application/x-shockwave-flash")
{span.innerHTML="<object width='640' height='480' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"+"<param name='movie' value='"+media.file+"' />"+"<embed src='"+media.file+"' width='640' height='480' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+"</object>";}
td.appendChild(span);}
td.appendChild(document.createElement("br"));tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);d.appendChild(table);s.appendChild(d);}
return true;}}
function productViewMediaVideoHide()
{return function()
{var s=document.getElementById("screen");while(s.firstChild)
s.removeChild(s.firstChild);s.style.visibility="hidden";return true;}}
function productViewDrawLoading()
{productViewClear();var ctrlView=document.getElementById("ctrlview");var center=document.createElement("center");var table=document.createElement("table");var tBody=document.createElement("tbody");table.width="100%";table.cellPadding=0;table.cellSpacing=0;var tr=document.createElement("tr");var td=document.createElement("td");td.className="loading";td.style.width="100%";td.style.height="200px";td.style.textAlign="center";td.style.verticalAlign="middle";var img=new Image();img.src="/images/loading.gif";td.appendChild(img);td.appendChild(document.createElement("br"));td.appendChild(document.createTextNode("Loading..."));tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);center.appendChild(table);ctrlView.appendChild(center);}
function productViewInit(callerContext)
{productViewDrawBody();}
function productViewCreate(catalogId,callerId)
{__productView.catalogId=catalogId;__productView.callBack=productViewInit;__productView.callerId=callerId;productViewDrawLoading();productInfoGet(__productView.catalogId,__productView);}
function productViewLoad()
{if(__preSelectInfo.productId==-1)
productViewDrawLoading();else
__preSelectInfo.productId=-1;productInfoGet(__productView.catalogId,__productView);}
function productViewBack()
{if(__productView.callerId==PRODUCTVIEWCALLERSHOP())
catalogViewLoad(0);else
wishListViewLoad();}
function showproductInfo(stitchcount,colorchanges,width,height)
{var span=document.getElementById("spanProdInfo");if(span)
span.innerHTML="Stitches: "+stitchcount+", "+" Color Changes: "+colorchanges+", "+" Width: "+width+" in.,"+" Height: "+height+" in.";}