
var t;var currentSortByID='P_SiteRank';var noImgSelected='36';var wtView='Gallery View';var wtTab='All Items';var wtRecordCount='';var wtEnabled='false';var filterColorSelected='0';var filterSizeSelected='0';var filterShapeSelected='0';var theDomain='';theDomain=document.domain;var theDomainStart=theDomain.indexOf('allposters');theDomain=theDomain.substr(theDomainStart);theDomain='.'+theDomain;$(document).ready(function(){wtEnabled=$('#webtrendsEnabled').text().toLowerCase();hasOpenedSortByDD=false;$("#Submit").click(function(){var request=$("input#request").val();var email=$("input#emailA").val();var cid=$("input#CID").val();var customerZoneiD=$("input#CustZoneID").val();var languageID=$("input#LanguageID").val();var finalData="request="+request+'&'+"email="+email+'&'+"cid="+cid+'&'+"custzoneid="+customerZoneiD+'&'+"languageid="+languageID;$.ajax({url:"/ADC.NET/root/pages/gallery/SubmitSNFRequest.aspx",processData:false,data:finalData,cache:false,type:"GET",dataType:"html",beforeSend:function(){return ValidateForm(request,email);},success:AjaxSucceeded,error:AjaxFailed});});$('#brdcrumb_home').hover(function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/homerollover.gif');},function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/home.gif');});var liCount=$('#galleft').find('li').size();if(liCount==0)
$('#galleft').css('visibility','hidden');$('.Pbrd:first > img').attr('style','position: absolute; margin-left: 0px; _margin-left: -4px; _margin-top: 0px;');$('.Pbrd:first').css('border-left','1px solid #DCDDDE');$('.cthdr:first').css('margin-top','0px');$('.cthdr:first').css('border-top','none');$('.sortBy').bind('click',function(){theParam=$(this).attr('id');currentSortByID=theParam;theAction='Ns='+theParam;theParam=theParam.replace('-','|');SetCookieDictionary('ENDECA','Ns',theParam,'','/','');SetCookieDictionary('ENDECA','persistSortBy','0','','/','');theGAEvent=$(this).next('#event').text();trackWithGA(theGAEvent);makeAjaxCallToGallery(theAction);});galleryImageClick=GetCookieDictionary('apc','galleryImageClick');var isRequestForm=$('#gTxt_RequestForm').text();$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div:first').addClass("inactive_tab_left");if($('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').length==2){$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).attr('class','default_tab inactive_tab_right');}
else{$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).addClass("inactive_tab_rightCenter");}
if($('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').length==3){$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).attr('class','default_tab inactive_tab_right');}
else{$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).addClass("inactive_tab_rightCenter");}
$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(3).addClass("inactive_tab_right");$('.inactive_tab').hover(function(){if($(this).hasClass('inactive_tab')){$(this).css({"backgroundImage":"url(http://cache1.allpostersimages.com/images/galleryNav/inactive_tab_rollover.png)"});}},function(){if($(this).hasClass('inactive_tab')){$(this).css({"backgroundImage":"url(http://cache1.allpostersimages.com/images/galleryNav/inactive_tab.png)"});}});$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div:first').hover(function(){if($(this).hasClass('inactive_tab_left')||$(this).hasClass('inactive_tab')){$(this).addClass("inactive_tab_left_hover").removeClass("inactive_tab_left");}},function(){if($(this).hasClass('inactive_tab_left_hover')){$(this).removeClass("inactive_tab_left_hover").addClass("inactive_tab_left");}});$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).hover(function(){if($(this).hasClass('inactive_tab_rightCenter'))
$(this).addClass('inactive_tab_rightCenter_hover').removeClass('inactive_tab_rightCenter');if($(this).hasClass('inactive_tab_leftCenter'))
$(this).addClass('inactive_tab_leftCenter_hover').removeClass('inactive_tab_leftCenter');if($(this).hasClass('inactive_tab_right'))
$(this).addClass('inactive_tab_right_hover').removeClass('inactive_tab_right');},function(){if($(this).hasClass('inactive_tab_rightCenter_hover'))
$(this).removeClass('inactive_tab_rightCenter_hover').addClass('inactive_tab_rightCenter');if($(this).hasClass('inactive_tab_leftCenter_hover'))
$(this).removeClass('inactive_tab_leftCenter_hover').addClass('inactive_tab_leftCenter');if($(this).hasClass('inactive_tab_right_hover'))
$(this).addClass('inactive_tab_right').removeClass('inactive_tab_right_hover');});$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).hover(function(){if($(this).hasClass('inactive_tab_rightCenter'))
$(this).addClass('inactive_tab_rightCenter_hover').removeClass('inactive_tab_rightCenter');if($(this).hasClass('inactive_tab_leftCenter'))
$(this).addClass('inactive_tab_leftCenter_hover').removeClass('inactive_tab_leftCenter');if($(this).hasClass('inactive_tab_right'))
$(this).addClass('inactive_tab_right_hover').removeClass('inactive_tab_right');},function(){if($(this).hasClass('inactive_tab_rightCenter_hover'))
$(this).removeClass('inactive_tab_rightCenter_hover').addClass('inactive_tab_rightCenter');if($(this).hasClass('inactive_tab_leftCenter_hover'))
$(this).removeClass('inactive_tab_leftCenter_hover').addClass('inactive_tab_leftCenter');if($(this).hasClass('inactive_tab_right_hover'))
$(this).addClass('inactive_tab_right').removeClass('inactive_tab_right_hover');});$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(3).hover(function(){if($(this).hasClass('inactive_tab_right')||$(this).hasClass('inactive_tab')){$(this).addClass("inactive_tab_right_hover").removeClass("inactive_tab_right");}},function(){if($(this).hasClass('inactive_tab_right_hover')){$(this).removeClass("inactive_tab_right_hover").addClass("inactive_tab_right");}});$('.inactive_tab_left_hover, .inactive_tab_right_hover, .inactive_tab_leftCenter_hover, .inactive_tab_rightCenter_hover, .inactive_tab_leftCenter, .inactive_tab_rightCenter, .inactive_tab_left, .inactive_tab_right').live('click',function(){theParam=$(this).attr('id');theAction=SetTabCssAndGetAction(theParam);if(wtEnabled=='true'){wtRecordCount=getCount($(this).find(".tab_text").html());wtRecordCount=wtRecordCount.replace(',','');wtRecordCount=wtRecordCount.replace(' ','');wtRecordCount=wtRecordCount.replace('&nbsp;','');wtRecordCount=wtRecordCount.replace('.','');lookUpSortBy(currentSortByID);dcsMultiTrack("WT.oss_r",wtRecordCount,"WT.cg_n","Gallery Tab Change","WT.z_s",currentSortByID,"WT.z_d",noImgSelected,"WT.z_g",wtView,"WT.z_t",wtTab);}
SetCookieDictionary('ENDECA','PT',theAction,'','/','');SetCookieDictionary('ENDECA','persistSortBy','0','','/','');theGAEvent=$(this).find('.event').text();$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div:first').addClass("inactive_tab_left").removeClass("active_tab");$(this).attr('class','default_tab active_tab');trackWithGA(theGAEvent);makeAjaxCallToGallery("PT="+theAction);$('#galleryHeadlineRecordsCount').html(getCount($(this).find(".tab_text").text()));});var selectedTab=$('#selectedTab').val();var bPersistFilter=GetCookieDictionary("ENDECA","persistFilterBy");if(selectedTab!=''){$('#'+selectedTab).attr('class','default_tab active_tab');SetTabCssAndGetAction(selectedTab);}
else{$('.default_tab:first').removeClass("inactive_tab_left").addClass("active_tab");SetTabCssAndGetAction($('.default_tab:first').attr('id'));}
$('#pageNav').find('img').live('click',function(){SetCookieDictionary('ENDECA','persistSortBy','1','','/','');});$('.pageNavTwoDigitStyle').live('click',function(){SetCookieDictionary('ENDECA','persistSortBy','1','','/','');});$('#showDefaultView').hover(function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/grid_view_selected.png');},function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/grid_view_inactive.png');});$('#showGridView').hover(function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/default_view_selected.png');},function(){$(this).attr('src','http://cache1.allpostersimages.com/images/galleryNav/default_view_inactive.png');});$('.iconOff').bind('click',function(event,dontTrack){$('.iconOn').hide();$('.iconOff').show();$(this).prev('img').show();$(this).hide();if(dontTrack==''||dontTrack==undefined){dontTrack=false;}
if($(this).attr('id')=='showGridView'){if(!dontTrack){trackWithGA('SelectGridView');}
toggleImageGrid('on');$('#gridViewTryOut').hide();hasTriedGridView();wtView="Grid View";}
else if($(this).attr('id')=='showDefaultView'){if(!dontTrack){trackWithGA('SelectGalleryView');}
toggleImageGrid('off');wtView="Gallery View";}
if(wtEnabled=='true'){lookUpSortBy(currentSortByID);if(!dontTrack)dcsMultiTrack("WT.cg_n","Gallery Grid View Change","WT.z_g",wtView,"WT.z_s",currentSortByID,"WT.z_d",noImgSelected,"WT.z_t",wtTab);}});initialView=GetCookieDictionary('ap','galleryView');if(initialView=='imageGrid'){trackWithGA('SelectGridViewPageload');}
else{trackWithGA('SelectGalleryViewPageload');}
initialView=GetCookieDictionary('ap','galleryView');getmargin(initialView);if(initialView=='imageGrid'&&$('.galmin').width()<700){$('.iconOn').hide();$('.iconOff').show();$('#showGridView').trigger('click',[true]);}
else if(initialView!='imageGrid'&&$('.galmin').width()>700){$('.iconOn').hide();$('.iconOff').show();$('#showGridViewOff').show();$('#showGridView').trigger('click',[true]);}
var currentSortBy='';currentSortBy=GetCookieDictionary('ENDECA','Ns');if(currentSortBy!=''){currentSortBy=currentSortBy.replace('|','-');$('.sortBy').each(function(){if($(this).attr('id')==currentSortBy){currentSortByID=$(this).attr('id');newSortByText=$(this).text();$('#customComboBox').text(newSortByText);}});}
else if(galleryImageClick=='y'){SetCookieDictionary('apc','galleryImageClick','n','','/',theDomain);}
var currentColorBy='';currentColorBy=GetCookieDictionary('apc','pColorBy');if(currentColorBy!=''){$('.colorText').each(function(){if($(this).attr('id')==currentColorBy){currentColorBy=$(this).attr('id');newColorByText=$(this).text();filterColorSelected=currentColorBy;if(newColorByText!="all"){$('#customComboBoxColor').text(newColorByText);}}});}
else{SetCookieDictionary('apc','pColorBy',0,'','/',theDomain);filterColorSelected='0';}
var currentShapeBy='';currentShapeBy=GetCookieDictionary('apc','pShapeBy');if(currentShapeBy!=''){$('.shapeText').each(function(){if($(this).attr('id')==currentShapeBy){currentShapeBy=$(this).attr('id');newShapeByText=$(this).text();filterShapeSelected=currentShapeBy;if(newShapeByText!="all"){$('#customComboBoxShape').text(newShapeByText);}}});}
else{SetCookieDictionary('apc','pShapeBy',0,'','/',theDomain);filterShapeSelected='0';}
var currentSizeBy='';currentSizeBy=GetCookieDictionary('apc','pSizeBy');if(currentSizeBy!=''){$('.sizeText').each(function(){if($(this).attr('id')==currentSizeBy){currentSizeBy=$(this).attr('id');newSizeByText=$(this).text();filterSizeSelected=currentSizeBy;if(newSizeByText!="all"){$('#customComboBoxSize').text(newSizeByText);}}});}
else
{SetCookieDictionary('apc','pSizeBy',0,'','/',theDomain);filterSizeSelected='0';}
$('#customComboBoxOptionsContainer > div:first').css({"margin":"15px 0px 0px 0px"});$('#customComboBoxContainer').hover(function(){$('#hoverComboBox').show();},function(){$('#hoverComboBox').hide();}).click(function(){$('#customComboBoxOptionsContainerColor').hide();$('#customComboBoxOptionsContainerShape').hide();$('#customComboBoxOptionsContainerSize').hide();$('#customComboBoxOptionsContainer').toggle();return false;});colorByEventHandling();shapeByEventHandling();sizeByEventHandling();$('#customComboBox').text(($.trim($('#customComboBox').text()).length>19)?$.trim($('#customComboBox').text()).substring(0,16)+'...':$.trim($('#customComboBox').text()));$('.sortBy').bind('click',function(){var comboBoxTxt=$.trim($(this).text());$('#customComboBox').text((comboBoxTxt.length>19)?comboBoxTxt.substring(0,16)+'...':comboBoxTxt);currentSortByID=$(this).attr('id');$('#customComboBoxOptionsContainer').hide();if(wtEnabled=='true'){lookUpSortBy(currentSortByID);dcsMultiTrack("WT.cg_n","Gallery Sort Change","WT.z_s",currentSortByID,"WT.z_g",wtView,"WT.z_d",noImgSelected,"WT.z_t",wtTab);}}).hover(function(){$('.sortBy').css({"backgroundColor":"#FFFFFF"});$(this).css({"backgroundColor":"#dcddde"});},function(){});$('.colorFilter').live('click',function(){var comboBoxTxt=$.trim($(this).text());$('#customComboBoxColor').text((comboBoxTxt.length>19)?comboBoxTxt.substring(0,16)+'...':comboBoxTxt);$('#customComboBoxOptionsContainerColor').hide();filterColorSelected=$(this).attr('id');SetCookieDictionary('apc','pColorBy',filterColorSelected,'','/',theDomain);makeAjaxCallToGallery("COLOR");});$('.colorFilter').live('mouseover',function(){$('.colorFilter').css({"backgroundColor":"#FFFFFF"});$(this).css({"backgroundColor":"#dcddde"});});$('.colorFilter').live('mouseout',function(){$(this).css({"backgroundColor":"#dcddde"});$('.colorFilter').css({"backgroundColor":"#FFFFFF"});});$('.shapeFilter').live('click',function(){var comboBoxTxt=$.trim($(this).text());$('#customComboBoxShape').text((comboBoxTxt.length>19)?comboBoxTxt.substring(0,16)+'...':comboBoxTxt);$('#customComboBoxOptionsContainerShape').hide();filterShapeSelected=$(this).attr('id');SetCookieDictionary('apc','pShapeBy',filterShapeSelected,'','/',theDomain);makeAjaxCallToGallery('SHAPE');});$('.shapeFilter').live('mouseover',function(){$('.shapeFilter').css({"backgroundColor":"#FFFFFF"});$(this).css({"backgroundColor":"#dcddde"});});$('.shapeFilter').live('mouseout',function(){$(this).css({"backgroundColor":"#dcddde"});$('.shapeFilter').css({"backgroundColor":"#FFFFFF"});});$('.sizeFilter').live('click',function(){var comboBoxTxt=$.trim($(this).text());$('#customComboBoxSize').text((comboBoxTxt.length>19)?comboBoxTxt.substring(0,16)+'...':comboBoxTxt);$('#customComboBoxOptionsContainerSize').hide();filterSizeSelected=$(this).attr('id');SetCookieDictionary('apc','pSizeBy',filterSizeSelected,'','/',theDomain);makeAjaxCallToGallery("SIZE");});$('.sizeFilter').live('mouseover',function(){$('.sizeFilter').css({"backgroundColor":"#FFFFFF"});$(this).css({"backgroundColor":"#dcddde"});});$('.sizeFilter').live('mouseout',function(){$(this).css({"backgroundColor":"#dcddde"});$('.sizeFilter').css({"backgroundColor":"#FFFFFF"});});$('.removeFilter').live('click',function(){$('#customComboBoxColor').text($('#0').text());$('#customComboBoxShape').text($('#0').text());$('#customComboBoxSize').text($('#0').text());filterColorSelected='0';filterSizeSelected='0';filterShapeSelected='0';SetCookieDictionary('apc','pColorBy',filterColorSelected,'','/',theDomain);SetCookieDictionary('apc','pShapeBy',filterShapeSelected,'','/',theDomain);SetCookieDictionary('apc','pSizeBy',filterSizeSelected,'','/',theDomain);makeAjaxCallToGallery("RemoveFilter");});$(document).bind('click',function(){$('#quickViewContainer').hide();if($('#customComboBoxOptionsContainer').hide())
$('#customComboBoxOptionsContainer').hide();if($('#customComboBoxOptionsContainerRPP').hide())
$('#customComboBoxOptionsContainerRPP').hide();if($('#customComboBoxOptionsContainerColor').hide())
$('#customComboBoxOptionsContainerColor').hide();if($('#customComboBoxOptionsContainerShape').hide())
$('#customComboBoxOptionsContainerShape').hide();if($('#customComboBoxOptionsContainerSize').hide())
$('#customComboBoxOptionsContainerSize').hide();});var zIndexNumber=1000;$('.galNavBar > div, .FilterByContainer > div').each(function(){$(this).css('zIndex',zIndexNumber);zIndexNumber-=10;});$('#didyoumeanc:empty').hide();$('.gridViewCallOutClose').click(function(){$('#gridViewTryOut').hide();hasTriedGridView();trackWithGA('SelectCloseTryThisCallOut');});var galleryViewCount=$('#galleryViewCount').text();if(galleryViewCount!=''&&galleryViewCount!=undefined){var d=new Date();d.setFullYear(d.getFullYear()+2);d.toGMTString();SetCookieDictionary('ap','galleryViewCount',galleryViewCount,d,'/',theDomain);}
$('#customComboBoxContainerRPP').hover(function(){$('#hoverComboBoxRPP').show();},function(){$('#hoverComboBoxRPP').hide();}).click(function(){var comboboxTop=$(".wrapperRPP").offset().top;var dropdownListHeight=$('#customComboBoxOptionsContainerRPP').outerHeight();var comboboxBottom=(comboboxTop+$(this).outerHeight());var windowScrollTop=jQuery(window).scrollTop();var windowHeight=jQuery(window).height();var availableSpaceBelow=(windowHeight-(comboboxBottom-windowScrollTop));if(availableSpaceBelow<dropdownListHeight){if((comboboxTop-windowScrollTop)>dropdownListHeight){$('#customComboBoxOptionsContainerRPP').css({"top":"-119px","border-top":"1px solid #8A9099"});$('#customComboBoxOptionsContainerRPP > div:last').css({"margin":"0px 0px 15px 0px","border-bottom":"1px solid transparent"});$('#customComboBoxOptionsContainerRPP > div:first').css({"margin":"0px 0px 0px 0px"});}}
else{$('#customComboBoxOptionsContainerRPP').css({"top":"-15px","border-top":"1px solid transparent"});$('#customComboBoxOptionsContainerRPP > div:first').css({"margin":"15px 0px 0px 0px"});$('#customComboBoxOptionsContainerRPP > div:last').css({"margin":"0px 0px 0px 0px"});}
$('#customComboBoxOptionsContainerRPP').toggle();return false;});$('#customComboBoxOptionsContainerRPP').hover(function(){$('#hoverComboBoxRPP').show();},function(){});$('.noOfImages').click(function(){$('#customComboBoxRPP').text($(this).text());noImgSelected=$.trim($(this).text())
$('#customComboBoxOptionsContainerRPP').hide();SetCookieDictionary('ENDECA','persistSortBy','0','','/','');if(wtEnabled=='true'){lookUpSortBy(currentSortByID);dcsMultiTrack("WT.cg_n","Gallery Number Change","WT.z_d",noImgSelected,"WT.z_g",wtView,"WT.z_s",currentSortByID,"WT.z_t",wtTab);}}).hover(function(){$('.noOfImages').css({"backgroundColor":"#FFFFFF"});$(this).css({"backgroundColor":"#dcddde"});},function(){});$('.backMore img').hover(function(){$(this).attr("src",$(this).attr("src").replace('.gif','_over.gif'));},function(){$(this).attr("src",$(this).attr("src").replace('_over.gif','.gif'));});$('img.thmbd').live('mouseover',function(){$('#customComboBoxOptionsContainer').hide();$qvGalItem=$(this).parents('.thmbbxtop1,.thmbbxtop,.thmbbx1,.thmbbx');quickView($qvGalItem);});$('img.thmbd').live('mouseout',function(){clearTimeout(t);});$('#quickViewContainer').bind('mouseleave',function(){hideQuickView();});$('#qvDetails,#qvAdd,.qvFramedActive,#qvMoreSizes').live('mouseover',function(){$(this).addClass('qvHover');});$('#qvDetails,#qvAdd,.qvFramedActive,#qvMoreSizes').live('mouseout',function(){$(this).removeClass('qvHover');});if(galleryImageClick=='y'&&isRequestForm!='y'&&jQuery.support.cssFloat==false)
{SetCookieDictionary('apc','galleryImageClick','n','','/',theDomain);location.reload(true);}
$('.thmbd,.productTitle,.seeLarger,.moreSizes').live('click',function(){SetCookieDictionary('apc','galleryImageClick','y','','/',theDomain);});$('.topblock_right').bind('click',function(){docHeight=$(document).height();docWidth=$(document).width();$('#VbackgroundPopup').css('height',docHeight);$('#VbackgroundPopup').css('width',docWidth);$('#VbackgroundPopup').show();$('.ltbox_cont').show();});$('.ltbox_close').bind('click',function(){$('#VbackgroundPopup').hide();$('.ltbox_cont').hide();});});$(window).load(function(){$('#gridViewTryOut').css('top',(($("#showGridView").offset().top)+17));$('#gridViewTryOut').css('left',(($("#showGridView").offset().left)-($("#gridViewTryOut").width()/2)+8));$('#gridViewTryOut').show();});function getTabAction(tabID){switch(tabID)
{case'tabPreFramed':theAction=4;break;case'tabPosterPrint':theAction=1;break;case'tabTShirt':theAction=13;break;case'tabAll_Items':theAction=0;break;default:theAction='';}
return theAction;}
function getSortByAction(){return currentSortByID;}
function getNumberOfImagesSelected(){return $.trim($('#customComboBoxRPP').text());}
function getGridSelected(){return wtView;}
function getCurrentTabAction(){var currentTabID=$('.active_tab').attr('id');return getTabAction(currentTabID);}
function SetTabCssAndGetAction(tabID){var theAction='';if(tabID=='tabPreFramed'){theAction=4;wtTab="Pre-Framed";$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).addClass("inactive_tab_leftCenter").removeClass("active_tab").removeClass("inactive_tab_rightCenter");$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(3).addClass("inactive_tab_right").removeClass("active_tab");}
else if(tabID=='tabPosterPrint'){theAction=1;wtTab="Poster/Print";$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(3).addClass("inactive_tab_right").removeClass("active_tab");$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).addClass("inactive_tab_rightCenter").removeClass("active_tab").removeClass("inactive_tab_leftCenter");if($('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').length==3)
$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).removeClass("inactive_tab_rightCenter").addClass("inactive_tab_right");}
else if(tabID=='tabTShirt'){theAction=13;wtTab="T-Shirt";$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).attr('class','default_tab inactive_tab_leftCenter');$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).attr('class','default_tab inactive_tab_leftCenter');}
else if(tabID=='tabAll_Items'){theAction=0;wtTab="All Items";$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).addClass("inactive_tab_rightCenter").removeClass("active_tab").removeClass("inactive_tab_leftCenter");if($('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').length==2)
$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(1).attr('class','default_tab inactive_tab_right');$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).addClass("inactive_tab_rightCenter").removeClass("active_tab").removeClass("inactive_tab_leftCenter");if($('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').length==3)
$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(2).removeClass("inactive_tab_rightCenter").addClass("inactive_tab_right");$('#ctl00_ctl00_mc_mc_servicetypeitems_tabs > div').eq(3).addClass("inactive_tab_right").removeClass("active_tab");}
return theAction;}
function AjaxSucceeded(result){document.getElementById('SNFFB').style.display='none';document.getElementById('didyoumeanc').style.display='none';document.getElementById('RNI').style.display='block';}
function AjaxFailed(result){alert(result.status+' '+result.statusText);}
function ValidateForm(Request,Email)
{if(Request==""&&Email=="")
{$("div#errorMsg").show();$("li#email_error").show();$("li#Request_error").show();return false;}
if(Email=="")
{$("div#errorMsg").show();$("li#email_error").show();document.getElementById('Request_error').style.display='none';return false;}
if(Request=="")
{$("div#errorMsg").show();$("li#Request_error").show();document.getElementById('email_error').style.display='none';return false;}
return true;}
function makeAjaxCallToGallery(theAction){$('.galmin').fadeTo('normal',0.5)
defaultParams=$('#URL').text();regexPatternNs=new RegExp('Ns=([^&#]*)');regexPatternNn=new RegExp('Nn=([^&#]*)');regexPatternPage=new RegExp('&page=([^&#]*)');regexPatternOffset=new RegExp('&No=([^&#]*)');regexPatternPageQS=new RegExp('&page=([^&#]*)');regexPatternN=new RegExp('N=([^{&,+}#]*)');regexPatternFullN=new RegExp('N=([^&#]*)');regexPatternPT=new RegExp('[+]6[0]{5}[1-3]');regexPatternPTOnly=new RegExp('N=6[0]{5}[1-3]');regexPatternPTNumber=new RegExp('6[0]{5}[1-3]');regexNumImagesCall=new RegExp('PT=([^&#]*)&Nn=([^&#]*)&Ns=([^&#]*)');regexPatternItemType=new RegExp('&ItemType=([^&#]*)');if(defaultParams.match(regexPatternPage)!=null&&(GetCookieDictionary("ENDECA","Pg")==null||GetCookieDictionary("ENDECA","Pg")==""))
{pgCookie=defaultParams.match(regexPatternPage)[1];SetCookieDictionary('ENDECA','Pg',pgCookie,'','/','');}
if(GetCookieDictionary("ENDECA","Nn")!=null&&GetCookieDictionary("ENDECA","Nn")!="")
{if(defaultParams.toString().indexOf('&Nn=')<0)defaultParams=defaultParams+"&Nn=36";defaultParams=defaultParams.replace(regexPatternNn,"Nn="+GetCookieDictionary("ENDECA","Nn"));}
if(theAction.toString().indexOf('-')>-1)theAction=theAction.toString().replace('-','|');if(theAction.toString().indexOf('Nn')>-1)defaultParams=defaultParams.replace(regexPatternNn,theAction);if(theAction.toString().indexOf('Ns')>-1)
{if(theAction!="Ns=P_SiteRank")
{defaultParams=defaultParams.replace(regexPatternNs,theAction);}
if(theAction.match(regexNumImagesCall)==null)
{No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');}
else if(defaultParams.match(regexPatternNn)!=null&&GetCookieDictionary("ENDECA","Pg")!=null&&GetCookieDictionary("ENDECA","Pg")!="")
{No=(GetCookieDictionary("ENDECA","Pg")-1)*defaultParams.match(regexPatternNn)[1];}
else
{No=0;}
defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);}
if(theAction.toString().indexOf('PT')<0)
{productTypeCookie=GetCookieDictionary("ENDECA","PT");if(theAction!="RemoveFilter"){if(productTypeCookie!="")
theAction="PT="+productTypeCookie;}}
var isSortByFilter_Preserved=false;if(theAction.toString().indexOf('PT')>-1){NValue=defaultParams.match(regexPatternN);var ItemTypeValue=defaultParams.match(regexPatternItemType);if(NValue[1].match(regexPatternPTNumber)!=null)
{NValue[1]=NValue[1].replace(regexPatternPTNumber,'0');}
if(theAction.toString().indexOf('PT=13')>-1){NValueForItemType=NValue[1]+"+"+"6000003";}
else if(theAction.toString().indexOf('PT=4')>-1){NValueForItemType=NValue[1]+"+"+"6000002";}
else if(theAction.toString().indexOf('PT=1')>-1){NValueForItemType=NValue[1]+"+"+"6000001";}
else{defaultParams=defaultParams.replace(regexPatternItemType,"&ItemType=0");}
if(theAction.toString().indexOf('PT=0')<0)
{defaultParams=defaultParams.replace(regexPatternFullN,"N="+NValueForItemType);}
else if(theAction.toString().indexOf('PT=0')>-1)
{defaultParams=defaultParams.replace(regexPatternPT,'');defaultParams=defaultParams.replace(regexPatternPTOnly,'N=0');}
if(theAction.match(regexNumImagesCall)==null)
{No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');}
else if(defaultParams.match(regexPatternNn)!=null&&GetCookieDictionary("ENDECA","Pg")!=null&&GetCookieDictionary("ENDECA","Pg")!="")
{No=(GetCookieDictionary("ENDECA","Pg")-1)*defaultParams.match(regexPatternNn)[1];}
else
{No=0;}
defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);isSortByFilter_Preserved=true;if(GetCookieDictionary("ENDECA","Ns")!="")
{defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}}
if(filterColorSelected!="0"){NValue=defaultParams.match(regexPatternFullN);NValueForItemType=NValue[1]+"+"+filterColorSelected;defaultParams=defaultParams.replace(regexPatternFullN,"N="+NValueForItemType);if(theAction.match(regexNumImagesCall)==null){No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');}
else if(defaultParams.match(regexPatternNn)!=null&&GetCookieDictionary("ENDECA","Pg")!=null&&GetCookieDictionary("ENDECA","Pg")!=""){No=(GetCookieDictionary("ENDECA","Pg")-1)*defaultParams.match(regexPatternNn)[1];}
else{No=0;}
defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);isSortByFilter_Preserved=true;if(GetCookieDictionary("ENDECA","Ns")!=""){defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}}
if(filterShapeSelected!="0"){NValue=defaultParams.match(regexPatternFullN);NValueForItemType=NValue[1]+"+"+filterShapeSelected;defaultParams=defaultParams.replace(regexPatternFullN,"N="+NValueForItemType);if(theAction.match(regexNumImagesCall)==null){No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');}
else if(defaultParams.match(regexPatternNn)!=null&&GetCookieDictionary("ENDECA","Pg")!=null&&GetCookieDictionary("ENDECA","Pg")!=""){No=(GetCookieDictionary("ENDECA","Pg")-1)*defaultParams.match(regexPatternNn)[1];}
else{No=0;}
defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);isSortByFilter_Preserved=true;if(GetCookieDictionary("ENDECA","Ns")!=""){defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}}
if(filterSizeSelected!="0"){NValue=defaultParams.match(regexPatternFullN);NValueForItemType=NValue[1]+"+"+filterSizeSelected;defaultParams=defaultParams.replace(regexPatternFullN,"N="+NValueForItemType);if(theAction.match(regexNumImagesCall)==null){No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');}
else if(defaultParams.match(regexPatternNn)!=null&&GetCookieDictionary("ENDECA","Pg")!=null&&GetCookieDictionary("ENDECA","Pg")!=""){No=(GetCookieDictionary("ENDECA","Pg")-1)*defaultParams.match(regexPatternNn)[1];}
else{No=0;}
defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);isSortByFilter_Preserved=true;if(GetCookieDictionary("ENDECA","Ns")!=""){defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}}
if(theAction=="RemoveFilter"){No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);isSortByFilter_Preserved=true;if(GetCookieDictionary("ENDECA","Ns")!=""){defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}
NValue=defaultParams.match(regexPatternFullN);var temp=NValue[1].split('+');NValueForItemType=temp[0]+'+'+temp[1];var paratemp=$('#URL').text();paratemp=paratemp.replace(regexPatternFullN,"N="+NValueForItemType);SetCookieDictionary('ENDECA','N',NValueForItemType,'','/','');defaultParams=defaultParams.replace(regexPatternFullN,"N="+NValueForItemType);}
if(!isSortByFilter_Preserved){No=0;defaultParams=defaultParams.replace(regexPatternPageQS,'');SetCookieDictionary('ENDECA','Pg','1','','/','');defaultParams=defaultParams.replace(regexPatternOffset,'&No='+No);if(GetCookieDictionary("ENDECA","Ns")!=""){defaultParams=defaultParams.replace(regexPatternNs,"Ns="+GetCookieDictionary("ENDECA","Ns"));}}
theURL='/ADC.NET/Root/Pages/Proxy/Gallery/Results.aspx?'+defaultParams;if(defaultParams.toString().indexOf('&isAjax=true')<0)
theURL=theURL+'&isAjax=true';$.ajax({url:theURL,beforeSend:function(xml){return prepareAjaxCallToGallery(xml);},processData:false,cache:false,type:"GET",dataType:"html",success:function(callback){$('#galleryAjaxContainer').html(callback);x=$('#paginationDiv').html();$('.paginationFloat').html(x);if(_showServiceTypeItems!=""){setServiceTypeShow();}
var currentColorBy='';currentColorBy=GetCookieDictionary('apc','pColorBy');if(theAction!="COLOR"&&currentColorBy==0){x=$('#colorDDNew').html();$('#colorDD').html(x);colorByEventHandling();}
var currentShapeBy='';currentShapeBy=GetCookieDictionary('apc','pShapeBy');if(theAction!="SHAPE"&&currentShapeBy==0){x=$('#shapeDDNew').html();$('#shapeDD').html(x);shapeByEventHandling();}
var currentSizeBy='';currentSizeBy=GetCookieDictionary('apc','pSizeBy');if(theAction!="SIZE"&&currentSizeBy==0){x=$('#sizeDDNew').html();$('#sizeDD').html(x);sizeByEventHandling();}
var initialView='';initialView=GetCookieDictionary('ap','galleryView');getmargin(initialView);if(initialView=='imageGrid'&&$('.galmin').width()<700){$('.iconOn').hide();$('.iconOff').show();$('#showGridView').trigger('click',[true]);}
$('#quickViewContainer').bind('mouseleave',function(){hideQuickView();});$('.galmin').fadeTo('normal',1);$(window).scrollTop(-$(window).scrollTop());if(theAction=="RemoveFilter"){$('.default_tab:first').removeClass("inactive_tab_left").addClass("active_tab");SetTabCssAndGetAction($('.default_tab:first').attr('id'));}},error:function(textStatus,errorThrown){$('.galmin').fadeTo('normal',1);}});}
function prepareAjaxCallToGallery(xml){$('#gTxt_galleryAjax').children('span').each(function(){theName=$(this).attr('id');theName=theName.replace('gTxt_','');theValue=$(this).text();xml.setRequestHeader(theName,theValue);});return true;}
function toggleImageGrid(newState,animation){imageGridCSSFile=document.getElementById('imageGridCSS');imageGridCSSAjaxFile=document.getElementById('imageGridCSSAjax');if(imageGridCSSFile!=null)
imageGridCSSFile.disabled=true;if(imageGridCSSAjaxFile!=null)
imageGridCSSAjaxFile.disabled=true;if(animation==false)
toggleImageGridClasses(newState);else
$('.galmin').fadeTo('normal',0.5,function(){toggleImageGridClasses(newState);$('.galmin').fadeTo('normal',1);});}
function toggleImageGridClasses(newState){if(newState=='on'){$('.galmin').css('width','auto');$('.thmbbxtop1,.thmbbxtop,.thmbbx1,.thmbbx').each(function(){$(this).css('margin','0 5px 5px 0');$(this).css('width','172px');$(this).css('height','205px');$(this).css('border','1px solid #DCDDDE');});getmargin('imageGrid');$('.thumbContainer').height('171px');$('.lnht10').css('line-height','5px');$('.seeLarger').css('display','none');$('.pCntr1').css('display','none');$('.shpdiv').css('display','none');$('.pprdc').css('color','#DC473F');$('.price').css('color','#000000');$('.artist').css('display','none');$('.onSaleImage').css('display','none');$('.moreSizes').css('display','none');$('.holiday_GiftBox_2010').hide();$('.holidayIconGridView').show();var d=new Date();d.setFullYear(d.getFullYear()+2);d.toGMTString();SetCookieDictionary('ap','galleryView','imageGrid',d,'/',theDomain);}
else{$('.galmin').css('width','680px');$('.thmbbxtop1,.thmbbxtop,.thmbbx1,.thmbbx').each(function(){$(this).css('margin','0 5px 5px 0');$(this).css('width','215px');$(this).css('height','395px');$(this).css('border','1px solid #E6E6E6');});$('.thumbContainer').height('166px');$('.lnht10').css('line-height','10px');$('.seeLarger').css('display','block');$('.pCntr1').css('display','block');$('.shpdiv').css('display','block');$('.price').css('color','#000000');$('.artist').css('display','block');$('.onSaleImage').css('display','inline');$('.moreSizes').css('display','block');$('.holiday_GiftBox_2010').show();$('.holidayIconGridView').hide();getmargin('galleryView');var d=new Date();d.setFullYear(d.getFullYear()+2);d.toGMTString();SetCookieDictionary('ap','galleryView','default',d,'/',theDomain);}}
function trackWithGA(eventName){try{console.log('Google tracking : Event ='+eventName);}
catch(e){}
if(typeof(_gaq)!="undefined"){var tmpEventName="\'"+eventName+"\'";_gaq.push(['t1._trackEvent','Gallery',tmpEventName,tmpEventName]);}}
function getTabID(itemType){var retval;switch(itemType){case'1':retval='tabPosterPrint';break;case'4':retval='tabPreFramed';break;case'13':retval='tabTShirt';break;default:retval='tabAll_Items';break;}
return retval;}
function getCount(text){var retVal='';var startRec=text.indexOf("(",0);var endRec=text.indexOf(")",0);if(startRec>0&&endRec>0){retVal=text.substring(startRec+1,endRec);}
return retVal;}
function quickView($theItem){$theImage=$theItem.find('img.thmbd');medImageWidth=$theImage.width();medImageHeight=$theImage.height();var maxImgWidth=350;var maxImgHeight=390;var theImageRatio;if(medImageWidth>=medImageHeight){theImageRatio=medImageHeight/medImageWidth;lrgImageWidth=maxImgWidth;lrgImageHeight=Math.round(lrgImageWidth*theImageRatio);}
else{theImageRatio=medImageWidth/medImageHeight;lrgImageHeight=maxImgHeight;lrgImageWidth=Math.round(lrgImageHeight*theImageRatio);}
theItemImageSrc=$theImage.attr('src');$('#qVImage').attr('src',theItemImageSrc);$('#qVImage').attr('width',lrgImageWidth);$('#qVImage').attr('height',lrgImageHeight);newItemImageSrc=theItemImageSrc.replace('MED','LRG');var pos=theItemImageSrc.indexOf("MXW");if(pos>1){newItemImageSrc=theItemImageSrc.replace(theItemImageSrc.substr(pos,theItemImageSrc.indexOf("MXH")-pos),'MXW:'+maxImgWidth+'+');pos=newItemImageSrc.indexOf("MXH");newItemImageSrc=newItemImageSrc.replace(newItemImageSrc.substr(pos,newItemImageSrc.indexOf("QLT")-pos),'MXH:'+maxImgHeight+'+');}
$('#qVImage').attr('src',newItemImageSrc);var bCanFrame=true;var theProductTitle=$theItem.find('.productTitle').text();var theProductType=$theItem.find('.productType').text();var theSize=$theItem.find('.productSize').text();var moreSizes=$theItem.find('.moreSizes').text();var theArtist=$theItem.find('.artistName').text();var regPrice='';var salePrice='';var theArtistString='';var byTranslation=$('#transForBy').text();if(theArtist!='')
theArtistString=byTranslation+' '+theArtist+'<br />';regPrice=$theItem.find('.galleryPriceStrike').text();if(regPrice!=''){salePrice=$theItem.find('.pprdc').text();priceString='<span id="qvRegPrice">'+regPrice+'</span> <span id="qvSalePrice">'+salePrice+'</span> ';}
else{regPrice=$theItem.find('.price').text();priceString='<span id="qvPrice">'+regPrice+'</span>';}
var shipTime=$theItem.find('.posterShips').text();var productPageHref=$theItem.find('.centerImage').children('a').attr('href');$itemAddToCart=$theItem.find('.iconcart');addToCartLink=$itemAddToCart.attr('onclick');$itemSeeItFramed=$theItem.find('.iconsif');if($itemSeeItFramed.length<1)
bCanFrame=false;else
frameLink=$itemSeeItFramed.attr('onclick');qVTextString='<div id="qvTitle">'+theProductTitle+'</div>'+theArtistString+'<span id="qvProductType">'+theProductType+' -- '+theSize+'</span> <span id="qvMoreSizes">'+moreSizes+'</span><br />'+priceString+' -- '+shipTime;$('#qVText').html(qVTextString);$('#qvDetails,#qVImage,#qvAdd,#qvFramed,.qvFramedActive').die('click');$('#qvFramed').removeClass('qvFramedDisabled');$('#qvDetails,#qVImage,#qvMoreSizes').live('click',function(){SetCookieDictionary('apc','galleryImageClick','y','','/',theDomain);location.href=productPageHref;});$('#qvFramed').live('click',function(){SetCookieDictionary('apc','galleryImageClick','y','','/',theDomain);});$('#qvAdd').live('click',function(){$(this).attr('onclick',null);$(this).attr('onclick',addToCartLink);});var qvFramedObj=document.getElementById('qvFramed');if(bCanFrame){$('#qvFramed').addClass('qvFramedActive');qvFramedObj.onclick=frameLink;$('#qvFramed').attr('title','');}
else{qvFramedObj.onclick=null;$('#qvFramed').removeClass('qvFramedActive');$('#qvFramed').attr('title','This item cannot be framed');$('#qvFramed').addClass('qvFramedDisabled');}
var offset=$theItem.offset();theItemTop=offset.top;theItemLeft=offset.left;qvWidth=lrgImageWidth+42;if(qvWidth<289)
qvWidth=289;$('#quickViewContainer').width(qvWidth);largeImageTop=$theImage.offset().top-(lrgImageHeight-medImageHeight)/2;theItemLeft=theItemLeft-($('#quickViewContainer').width()-$theItem.width())/2;theItemTop=largeImageTop-21;qscreenHeight=document.body.clientHeight;qscreenWidth=document.body.clientWidth;theScrollTop=parseInt(document.body.scrollTop);if((theItemTop-theScrollTop+$('#quickViewContainer').height())>(qscreenHeight)){theItemTop=theScrollTop-(($('#quickViewContainer').height())-qscreenHeight);}
else if(theItemTop<theScrollTop){theItemTop=theScrollTop;}
if((theItemLeft+$('#quickViewContainer').width())>(qscreenWidth)){theItemLeft=qscreenWidth-$('#quickViewContainer').width();}
$('#quickViewContainer').css('top',theItemTop);$('#quickViewContainer').css('left',theItemLeft);t=setTimeout('showQuickView()',500);}
function showQuickView(){$('#quickViewContainer').fadeIn('fast');clearTimeout(t);}
function hideQuickView(){$('#quickViewContainer').hide();}
function hasTriedGridView(){var d=new Date();d.setFullYear(d.getFullYear()+2);d.toGMTString();SetCookieDictionary('ap','hasTriedGridView','true',d,'/',theDomain);}
function getmargin(initialView){if(initialView=='imageGrid'){$('#galleryAjaxContainer').find('.canvaswrap1').each(function(){getLeftMarginForCanvas('GridView',this);});}
if(initialView=='galleryView'){$('#galleryAjaxContainer').find('.canvaswrap1').each(function(){getLeftMarginForCanvas('galleryView',this);});}}
function getLeftMarginForCanvas(view,objInstance){var centerimagewidth=0;var marginleft;centerimagewidth=$(objInstance).find('.centerImage img').attr('width');if(view=='GridView'){marginleft=((172-(centerimagewidth+4))/2);}
else{marginleft=((215-(centerimagewidth+8))/2);}
$(objInstance).attr('style','margin-left:'+marginleft+'!important');}
function lookUpSortBy(){switch(currentSortByID){case"P_ItemWidth-0":currentSortByID="P_ItemWidth|1";break;case"P_ItemWidth-1":currentSortByID="P_ItemWidth";break;case"P_ItemHeight-0":currentSortByID="P_ItemHeight|1";break;case"P_ItemHeight-1":currentSortByID="P_ItemHeight";break;case"P_MasterPrice":currentSortByID="P_PriceHigh|1";break;case"P_MasterPrice-1":currentSortByID="P_PriceLow";break;case"P_ItemDateCreated-1":currentSortByID="P_ItemDateCreated|1";break;}}
function setServiceTypeShow(){if(_showServiceTypeItems!=""){$('.default_tab').hide();var temp=_showServiceTypeItems.split("|");for(var i=0;i<temp.length-1;i++){$('#'+temp[i]).show();var t1='#ShowServiceTypeItems '+'#'+temp[i]+' .tab_text';t='#'+temp[i]+' .tab_text';$(t).text($(t1).text());}
$('#galleryHeadlineRecordsCount').text(getCount($('#tabAll_Items').find(".tab_text").text()));}}
function colorByEventHandling(){$('#customComboBoxOptionsContainerColor > div:first').css({"margin":"15px 0px 0px 0px"});$('#customComboBoxContainerColor').hover(function(){$('#hoverComboBoxColor').show();},function(){$('#hoverComboBoxColor').hide();}).click(function(){$('#customComboBoxOptionsContainer').hide();$('#customComboBoxOptionsContainerShape').hide();$('#customComboBoxOptionsContainerSize').hide();$('#customComboBoxOptionsContainerColor').toggle();return false;});$('#customComboBoxOptionsContainerColor').hover(function(){$('#hoverComboBoxColor').show();},function(){});}
function shapeByEventHandling(){$('#customComboBoxOptionsContainerShape > div:first').css({"margin":"15px 0px 0px 0px"});$('#customComboBoxContainerShape').hover(function(){$('#hoverComboBoxShape').show();},function(){$('#hoverComboBoxShape').hide();}).click(function(){$('#customComboBoxOptionsContainer').hide();$('#customComboBoxOptionsContainerColor').hide();$('#customComboBoxOptionsContainerSize').hide();$('#customComboBoxOptionsContainerShape').toggle();return false;});$('#customComboBoxOptionsContainerShape').hover(function(){$('#hoverComboBoxShape').show();},function(){});}
function sizeByEventHandling(){$('#customComboBoxOptionsContainerSize > div:first').css({"margin":"15px 0px 0px 0px"});$('#customComboBoxContainerSize').hover(function(){$('#hoverComboBoxSize').show();},function(){$('#hoverComboBoxSize').hide();}).click(function(){$('#customComboBoxOptionsContainer').hide();$('#customComboBoxOptionsContainerShape').hide();$('#customComboBoxOptionsContainerColor').hide();$('#customComboBoxOptionsContainerSize').toggle();return false;});$('#customComboBoxOptionsContainerSize').hover(function(){$('#hoverComboBoxSize').show();},function(){});}
function linkForm(action)
{document.getElementById('globalLinkForm').action=action;document.getElementById('globalLinkForm').submit();}
function styledisp(id,disp)
{var id=document.getElementById(id);if(id)
{id.style.display=disp;}}
function curl(url)
{window.location=url.replace(/___/g,"'");}
function ShipSameDayWindow(bOverrideSameDayMessage,customerZoneID,languageID)
{if(languageID==3)
{ShipWindow=window.open('','ShipTime','height=200,width=430,resizable=yes,top=100,left=100');var tmp=ShipWindow.document;tmp.write('<html><head><title>Versandfertigkeit</title>');tmp.write('</head><body><p style=\"font-family:Verdana;font-size:12px;\"><b>Versandfertigkeit</b></p>');if(!bOverrideSameDayMessage)
{if(customerZoneID==3)
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 5:00pm EST.</p>');}
else
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 16:00GMT.</p>');}}
tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Die Versandfertigkeit eines Artikels weist Sie auf die Zeit hin, die benötigt wird, bis der Artikel unser Warenhaus verlässt.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Bestellungen über mehrere Artikeln mit unterschiedlichen Versandterminen, werden anhand des Artikels mit der längsten Auslieferungsdauer verschick.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\"><b>Bitte beachten Sie: der Versandtermin ist abhängig von der gewählten Bezahlart.</b></p>');tmp.write('</body></html>');tmp.close();}
else if(languageID==2)
{ShipWindow=window.open('','ShipTime','height=200,width=430,resizable=yes,top=100,left=100');var tmp=ShipWindow.document;tmp.write('<html><head><title>Délai d\'expédition\</title>');tmp.write('</head><body><p style=\"font-family:Verdana;font-size:12px;\"><b>Délai d\'expédition\</b></p>');if(!bOverrideSameDayMessage)
{if(customerZoneID==3)
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 5:00pm EST.</p>');}
else
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 16:00GMT.</p>');}}
tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Le délai d\'expédition\ est le nombre de jours ouvrés avant que les articles quittent nos entrepôts. Ce délai n\'inclut\ pas le délai de livraison depuis notre entrepôt jusqu\'à l\'adresse du destinataire.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Les commandes qui contiennent des articles multiples avec des délais d\'expédition\ différents seront envoyés selon l\'article\ avec le délai d\'expédition le plus long.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\"><b>Veuillez noter ceci : Les délais de livraison dépendent de la méthode de paiement choisie.</b></p>');tmp.write('</body></html>');tmp.close();}
else
{ShipWindow=window.open('','ShipTime','height=200,width=430,resizable=yes,top=100,left=100');var tmp=ShipWindow.document;tmp.write('<html><head><title>Ship Time</title>');tmp.write('</head><body><p style=\"font-family:Verdana;font-size:12px;\"><b>Ship Time</b></p>');if(!bOverrideSameDayMessage)
{if(customerZoneID==3)
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 5:00pm EST.</p>');}
else
{tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Items that are designated by "Usually ships within 24 hours" normally leave our facilities on the same business day if the order is placed before 16:00GMT.</p>');}}
tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Ship time indicates the typical number of business days it takes for your item(s) to leave our facilities but does not include transit time from our facilities to the final destination.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\">Orders that contain multiple items with different ship times will be shipped out based on the item with the longest ship time.</p>');tmp.write('<p style=\"font-family:Verdana;font-size:12px;line-height:120%\"><b>Please note: Ship time is determined based on the method of payment chosen.</b></p>');if(!isTrustedDomain()){tmp.write("<p><div style=\"font-family:Verdana;font-size:12px;cursor:pointer;color:#000077\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\" onclick=\"window.open('\/asp\/customerservice\/shipping.asp','','height=678,width=900,scrollbars=yes,resizable=yes,titlebar=yes,toolbar=yes,menubar=yes')\">Shipping FAQ</div>");tmp.write("<div style=\"font-family:Verdana;font-size:12px;cursor:pointer;color:#000077\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\" onclick=\"window.open('\/asp\/ship_rates.asp','','height=678,width=900,scrollbars=yes,resizable=yes,titlebar=yes,toolbar=yes,menubar=yes')\">Shipping Rates</div><br/></p>");}
tmp.write('</body></html>');tmp.close();}}
function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+value+
((expiredays==null)?"":";expires="+exdate.toGMTString())+";path=/";}
function getCookie(c_name)
{if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function checkcookie()
{alert("all cookie:"+document.cookie);alert("ENDECA cookie:"+getCookie("ENDECA"));}
function selectNs(val)
{setEndecaCookie(val,"&Ns=");var url=redirectNtt(changePg(window.location,1));window.location=url;}
function selectNn(toRecordPerpage,curRecordPerpage,curPageNumber,totalRecords)
{var toPageNumber=calcPageNumber(toRecordPerpage,curRecordPerpage,curPageNumber,totalRecords);var url=redirectNtt(changePg(window.location,toPageNumber));var PT="PT="+getCurrentTabAction();var Nn="&Nn="+toRecordPerpage;var Ns="&Ns="+getSortByAction();SetCookieDictionary('ENDECA','Nn',toRecordPerpage,'','/','');if(getCurrentTabAction()=="")PT="PT=0";makeAjaxCallToGallery(PT+Nn+Ns);}
function calcPageNumber(toRecordPerpage,curRecordPerpage,curPageNumber,totalRecords)
{var toRecordPerpage=parseInt((parseInt(curRecordPerpage)*parseInt(curPageNumber-1))/parseInt(toRecordPerpage))+1;return toRecordPerpage;}
function redirectNtt(url)
{if(ntt&&ntt.length>0&&url.indexOf("searchstring")==-1)
{var index=url.lastIndexOf("/");if(index>-1)
{url=url.substring(0,index)+url.substring(index)+"&searchstring="+ntt;}}
return url;}
var ntt;function addSearchString(ntt)
{this.ntt=ntt;}
function gobacktosearch(ntt)
{this.ntt=ntt;var url=window.location.toString();url=url.replace(/___/g,"'");window.location=redirectNtt(url);}
function setEndecaCookie(val,pname)
{var endeca=getCookie("ENDECA");if(endeca.length>0)
{endeca=endeca.replace(/\+\&\+/g,"___");var tokens=endeca.split("&");var new_endeca="";var found=false;for(var i=0;i<tokens.length;i++)
{if(tokens[i].indexOf(pname)==0)
{tokens[i]=pname+val;found=true;}
new_endeca+="&"+tokens[i];}
endeca=new_endeca.substring(1);if(!found)
{endeca+="&"+pname+val;}}
else
{endeca=pname+val;}
endeca=endeca.replace(/&&/g,"&");endeca=endeca.replace(/___/g,escape("+&+"));setCookie("ENDECA",endeca,365);}
function changePg(url,pg)
{var sUrl=url.toString();var aPos=sUrl.indexOf("_p");var finalUrl="";var aPosGal=sUrl.indexOf("page=")
if(aPosGal>0)
{var newPageno="page="+pg;var regex=/page=\d+\b/;finalUrl=sUrl.replace(regex,newPageno);}
if(pg==1)
{if(aPos>0)
{var aStr=sUrl.substring(0,aPos);var cPos=sUrl.indexOf(".",aPos);var bStr=sUrl.substring(cPos);sUrl=url;}}
if(pg>1)
{var bPos=sUrl.lastIndexOf("_p");if(bPos>0)
{var dPos=sUrl.indexOf(".",bPos);var dStr=sUrl.substring(dPos);sUrl=sUrl.substring(0,bPos)+"_p"+pg+"_"+dStr;}}
if(finalUrl.length>0)
{sUrl=finalUrl;}
return sUrl;}
var XMLHttpFactories=[function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){var xmlhttp=false;for(var i=0;i<XMLHttpFactories.length;i++){try{xmlhttp=XMLHttpFactories[i]();}
catch(e){continue;}
break;}
return xmlhttp;}
function getuid()
{var uid=document.getElementById("uid");if(uid)return uid.value;else return"";}
function hidePromo()
{hideElem("dhtml_Email_Container");hideElem("CSModuleChangeLanguageContainer");hideElem("CSModuleChangeCountryContainer");}
function hideElem(id)
{var elm=document.getElementById(id);if(elm)elm.style.display="none";}
var reqObj,req,theURL;function fireSearch(boxid){var searchbox=document.getElementById(boxid);if(searchbox)
{var term=searchbox.value;term=term.replace(/@/g,"").replace(/#/g,"").replace(/$/g,"").replace(/%/g,"").replace(/^/g,"");term=term.replace(/^\s+|\s+$/g,"");if(term.length==0)
{document.getElementById("yoursearch").innerHTML="Please enter a valid search term.";searchbox.value="";return;}
var f=document.forms['globalLinkForm'];if(!f){f=document.aspnetForm;}
window.location.href="/gallery.asp?startat=/gallery.asp&CID="+gup("CID")+"&txtSearch="+escape(term);f.submit();}}
function gup(name)
{name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];}
function popOpen(url,name,attributes)
{windowHandle=window.open(url,name,attributes);}
function popOpen(url,name,attributes)
{windowHandle=window.open(url,name,attributes);}
function openPop(pURL,pName,pWidth,pHeight,new_pop){var winWidth=420;var winHeight=325;var winName="newWin";if(pWidth>0){winWidth=pWidth;}
if(pHeight>0){winHeight=pHeight;}
if(pName.length>0){winName=pName;}
var newWin=window.open(pURL,winName,'width='+winWidth+',height='+winHeight+',status=no,toolbar=no,scrollbars=yes,resizable=yes,left=1,top=1')
if(new_pop==0)
{if(window.focus)
{newWin.focus()}}
else
{var newWin2=window.open(pURL,winName,'width='+winWidth+',height='+winHeight+',status=no,toolbar=no,scrollbars=yes,resizable=yes,left=1,top=1')
if(window.focus)
{newWin2.focus()}}}
var mycarousel_itemList=new Array();function fnLoadImages(){if($('#ctl00_ctl00_mc_mc_dimsrch_hdnImageUrl').length>0){var separationChar="~|~";var hdnImageUrlArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnImageUrl').text().split(separationChar);var hdnGalleryUrlArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnGalleryUrl').text().split(separationChar);var hdnAltTextArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnAltText').text().split(separationChar);var hdnDimensionNameArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnDimensionName').text().split(separationChar);var hdnImageHghtArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnImageHght').text().split(separationChar);var hdnImageWidthArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnImageWidth').text().split(separationChar);var hdnImageMarginTopArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnImageMarginTop').text().split(separationChar);var hdnDimensionCntArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnDimensionCnt').text().split(separationChar);var hdnGalleryItemStrArray=$('#ctl00_ctl00_mc_mc_dimsrch_hdnGalleryItemStr').text().split(separationChar);for(i=0;i<hdnImageUrlArray.length-1;i++){var obj=new Object();obj.ImgSrc=hdnImageUrlArray[i];obj.GalUrl=hdnGalleryUrlArray[i];obj.AltTxt=hdnAltTextArray[i];obj.DimName=hdnDimensionNameArray[i];obj.ImgHeight=hdnImageHghtArray[i];obj.ImgWidth=hdnImageWidthArray[i];obj.ImgMarginTop=hdnImageMarginTopArray[i];obj.ItemCount=hdnDimensionCntArray[i];obj.ParentPath=hdnGalleryItemStrArray[i];mycarousel_itemList[i]=obj;if(i==9){obj.SeeAllCategory=document.getElementById("hdnSeeAllText").innerHTML;obj.GalUrl=document.getElementById("hdnSeeAllURL").innerHTML;}}}}
function mycarousel_itemLoadCallback(carousel,state){for(var i=carousel.first;i<=carousel.last;i++){if(carousel.has(i)){continue;}
if(i>mycarousel_itemList.length){break;}
carousel.add(i,mycarousel_getItemHTML(mycarousel_itemList[i-1]));}
$('.jcarousel-next').hover(function(){$(this).addClass('jcarousel-next-horizontal-hover');},function(){$(this).removeClass('jcarousel-next-horizontal-hover');});$('.jcarousel-prev').hover(function(){$(this).addClass('jcarousel-prev-horizontal-hover');},function(){$(this).removeClass('jcarousel-prev-horizontal-hover');});$('img.catimg').hoverIntent({over:DSqVhoverCarouselImage,timeout:500,interval:300,out:hideDSQuickView()});};function fnRedirectToUrl(link){location.href=link;}
function mycarousel_getItemHTML(item){if(item.ImgHeight>=100){item.ImgHeight=100;}
var htmlstring='';if(item.SeeAllCategory!=undefined&&item.SeeAllCategory!=''){htmlstring+='<a class="jcarousel-atag" href="'+item.GalUrl+'" title="'+item.SeeAllCategory+'">';htmlstring+='<div class="jcarousel-seeAllCategory" onclick="fnRedirectToUrl(\''+item.GalUrl+'\');"><table cellspacing="0px" cellpadding="0px"><tr><td>'+item.SeeAllCategory+'</td></tr></table></div>';htmlstring+='</a>';}
else{htmlstring+='<a onclick="setDMCookie()" class="jcarousel-atag" href="'+item.GalUrl+'" title="'+item.AltTxt+' Gallery"><div class="jcarousel-imgParent"><table cellspacing="0px" cellpadding="0px"><tr><td class="jcarousel-itemBox"><img class="catimg" src="'+item.ImgSrc+'" width="'+item.ImgWidth+'" height="'+item.ImgHeight+'" alt="'+item.AltTxt+'" onclick="fnRedirectToUrl(\''+item.GalUrl+'\');" /></td></tr></table></div>';htmlstring+='<div class="jcarousel-text" >'+item.DimName+'</div>';htmlstring+='</a><span class="jcarousel-itemCount" style="display:none;">'+item.ItemCount+'</span><span class="jcarousel-itemURL" style="display:none;">'+item.GalUrl+'</span>';}
return htmlstring;};jQuery(document).ready(function(){fnLoadImages();jQuery('#mycarousel').jcarousel({size:mycarousel_itemList.length,scroll:5,visible:5,itemLoadCallback:{onBeforeAnimation:mycarousel_itemLoadCallback}});$(document).bind('click',function(){$('#DSquickViewContainer').hide();});$('#DSquickViewContainer').bind('mouseleave',function(){hideDSQuickView();});$('#DSqvTitle,#DSqvCatTitle').live('mouseover',function(){$(this).addClass('DSqvHover');});$('#DSqvTitle,#DSqvCatTitle').live('mouseout',function(){$(this).removeClass('DSqvHover');});$('#DSqvAdd').live('mouseover',function(){$(this).css('text-decoration','underline');});$('#DSqvAdd').live('mouseout',function(){$(this).css('text-decoration','none');});});function createonclickforli(){$('.jcarousel-item').each(function(i){var onclick="curl('"+$(this).find('.jcarousel-atag').attr('href')+"')";$(this).attr('onclick',onclick);});}
function DSqVhoverCarouselImage(){$qvCatItem=$(this).parents('.jcarousel-item-1,.jcarousel-item-2,.jcarousel-item-3,.jcarousel-item-4,.jcarousel-item-5,.jcarousel-item-6,.jcarousel-item-7,.jcarousel-item-8,.jcarousel-item-9');qVCarousel($qvCatItem);}
function qVCarousel($theItem){$theImage=$theItem.find('img.catimg');medImageWidth=$theImage.width();medImageHeight=$theImage.height();var maxImgWidth=160;var maxImgHeight=160;var theImageRatio;if(medImageWidth>=medImageHeight){theImageRatio=medImageHeight/medImageWidth;lrgImageWidth=maxImgWidth;lrgImageHeight=Math.round(lrgImageWidth*theImageRatio);}
else{theImageRatio=medImageWidth/medImageHeight;lrgImageHeight=maxImgHeight;lrgImageWidth=Math.round(lrgImageHeight*theImageRatio);}
theItemImageSrc=$theImage.attr('src');$('#DSqVImage').attr('src',theItemImageSrc);$('#DSqVImage').attr('width',lrgImageWidth);$('#DSqVImage').attr('height',lrgImageHeight);newItemImageSrc=theItemImageSrc.replace('MED','LRG');$('#DSqVImage').attr('src',newItemImageSrc);var bCanFrame=true;var theProductTitle=$theItem.find('.jcarousel-text').text();var theProductType=$theItem.find('.jcarousel-itemCount').text()+($theItem.find('.jcarousel-itemCount').text()=="1"?" item":" items");qVTextString='<div id="DSqvTitle"><a href="">'+$("#hdnSearchText").text()+'</a></div>'+'<span id="qvProductType">in </span><span id="DSqvCatTitle"><a href="">'+theProductTitle+'</a></span>'+'<br> <span id="DSqvProductType">'+theProductType+'</span>';$('#DSqVText').html(qVTextString);$('#DSqvAdd a, #DSqvImageContainer a, #DSqvTitle a, #DSqvCatTitle a').attr('href',$theItem.find('.jcarousel-itemURL').text());var offset=$theItem.offset();theItemTop=offset.top;theItemLeft=offset.left;qvWidth=lrgImageWidth+42;if(qvWidth<173)
qvWidth=173;$('#DSquickViewContainer').width(qvWidth);largeImageTop=$theImage.offset().top-(lrgImageHeight-medImageHeight)/2;theItemLeft=theItemLeft-($('#DSquickViewContainer').width()-$theItem.width())/2;theItemTop=largeImageTop-21;qscreenHeight=document.body.clientHeight;qscreenWidth=document.body.clientWidth;theScrollTop=parseInt(document.body.scrollTop);if((theItemTop-theScrollTop+$('#DSquickViewContainer').height())>(qscreenHeight)){theItemTop=theScrollTop-(($('#DSquickViewContainer').height())-qscreenHeight);}
else if(theItemTop<theScrollTop){theItemTop=theScrollTop;}
if((theItemLeft+$('#DSquickViewContainer').width())>(qscreenWidth)){theItemLeft=qscreenWidth-$('#DSquickViewContainer').width();}
$('#DSquickViewContainer').css('top',theItemTop);$('#DSquickViewContainer').css('left',theItemLeft);t=setTimeout('showDSQuickView()',500);}
function showDSQuickView(){$('#DSquickViewContainer').fadeIn('fast');clearTimeout(t);}
function hideDSQuickView(){$('#DSquickViewContainer').hide();}
function setDMCookie(){Set_wt_Cookie('WTDS','1',365,'/','','')}
function Set_wt_Cookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
$(".P2AGPModuleImg").live('mouseenter',function(){var newSrc=$(this).attr("src").replace("MyPhotosGP.png","MyPhotosGP_RO.png");$(this).attr("src",newSrc);});$(".P2AGPModuleImg").live('mouseleave',function(){var newSrc=$(this).attr("src").replace("MyPhotosGP_RO.png","MyPhotosGP.png");$(this).attr("src",newSrc);});$(".P2AGPModule").live('click',function(){var hostName=window.location.hostname;hostName=hostName.toLowerCase();_gaq.push(['t1._trackPageview','/p2a-cta/gallery-page']);var aPos=hostName.indexOf(".allposters.fr");if(aPos>0){setTimeout(function(){window.location.href="/mesphotos/";},300);}
else{setTimeout(function(){window.location.href="/myphotos/";},300);}});
