//<!--
//\include\js\stores\store_customization.js@@\main\23

window.StoreCustomPageContents=typeof(window.StoreCustomPageContents)!="undefined"?window.StoreCustomPageContents:"StoreCustomPageContents";window.ThemesForm=typeof(window.ThemesForm)!="undefined"?window.ThemesForm:"ThemesForm";window.EditThemesForm=typeof(window.EditThemesForm)!="undefined"?window.EditThemesForm:"EditThemesForm";function popupUpgrade(url)
{if(target=="_self")
return false;var target='blank';var h=600;var w=600;LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+'yes'+',resizable='+'no'+'';win=window.open(url,target,settings);}
function popup(url)
{if(target=="_self")
return false;var target='blank';var h=400;var w=400;LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+'yes'+',resizable='+'no'+'';win=window.open(url,target,settings);}
function createPopUp(url)
{if(target=="_self")
return false;var target='blank';var h=540;var w=465;LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+'yes'+',resizable='+'no'+'';win=window.open(url,target,settings);}
function goToPage(pageID,formID,siteID){if((formID=='DetailsForm')&&(pageID=='BUILD_STORE_THEME')){setDetailsForm(siteID,pageID);}
var frm=eval("document.forms['"+formID+"']");if(frm){frm.destinationpage.value=pageID;frm.submit();}}
function goToChangeLayout(pageID,formID){var frm=eval("document.forms['"+formID+"']");if(frm){frm.destinationpage.value=pageID;onSubmit();frm.submit();}}
function changeCriteria(command,targetwidgetid,searchtype,suffix)
{if(typeof(suffix)=="undefined")
{var suffix="";}
if(searchtype!=null){document[window.StoreCustomPageContents]["searchtype"+suffix].value=searchtype;}
document[window.StoreCustomPageContents]["targetwidgetid"+suffix].value=targetwidgetid;document[window.StoreCustomPageContents]["actionmode"+suffix].value=command;document[window.StoreCustomPageContents]["destinationpage"+suffix].value="VIEW_PAGE_CONTENT";if(typeof(onSubmit)!="undefined")
onSubmit();document[window.StoreCustomPageContents].submit();}
function itemAction(widgetId,itemId,action,searchtype,position,suffix)
{if(typeof(suffix)=="undefined")
{var suffix="";}
document[window.StoreCustomPageContents]["searchtype"+suffix].value=searchtype;document[window.StoreCustomPageContents]["itemposition"+suffix].value=position;document[window.StoreCustomPageContents]["targetwidgetid"+suffix].value=widgetId;document[window.StoreCustomPageContents]["actionmode"+suffix].value=action;document[window.StoreCustomPageContents]["itemid"+suffix].value=itemId;document[window.StoreCustomPageContents]["destinationpage"+suffix].value="VIEW_PAGE_CONTENT";if(typeof(onSubmit)!="undefined")
onSubmit();document[window.StoreCustomPageContents].submit();}
function previewLogo(selectObj,imgName)
{autoCheck(0);var i=0;for(i=0;strArray.length>i;i++){var idLogoArray=strArray[i].split(":");if(idLogoArray[0]==selectObj){document.images[imgName].src=urlStr+idLogoArray[1];}}
return;}
function previewCustomLogo()
{if(document.LogoForm.customgraphic.value){autoCheck(1);var imageUrl=document.LogoForm.customgraphic.value;var endIndex=imageUrl.length-1;if((imageUrl.indexOf('http://'))>=0)
{document.images.custom.src=imageUrl;document.images.custom.height.value=90;document.images.custom.width.value=310;}
else
{document.images.custom.src='http://'+imageUrl;document.images.custom.height.value=90;document.images.custom.width.value=310;}}
return;}
function autoCheck(index)
{if(index!=-1){document.LogoForm.storegraphic[index].checked='true';}}
function storefrontpopup(url)
{if(target=="_self")
return false;var target='blank';var h=550;var w=600;LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',statusbar='+'no'+',toolbar='+'no'+',scrollbars='+'yes'+',resizable='+'yes'+'';win=window.open(url,target,settings);}
function setPageIds(sourceId,destId,formId)
{var frm=eval("document.forms['"+formId+"']");frm.sourcepage.value=sourceId;frm.destinationpage.value=destId;}
function popupAdvancedPreview(themeid){var obj=eval('document[ window.ThemesForm ].storecolorschemeid'+themeid+'.options');var ind=eval('document[ window.ThemesForm ].storecolorschemeid'+themeid+'.selectedIndex');var selectStr=obj[ind].value;var strArray=parseSelectValue(selectStr);popupPreview(thumbPath+strArray[2]);}
function popupAdvancedPreview_1_5(themeid,includesarray,themename,themetype){var obj=eval('document[ window.ThemesForm ].storecolorschemeid'+themeid+'.options');var ind=eval('document[ window.ThemesForm ].storecolorschemeid'+themeid+'.selectedIndex');var selectStr=obj[ind].value;var strArray=parseSelectValue(selectStr);popupPreview(thumbPath+strArray[2],includesarray,themename,themetype);}
function setHiddenSelectArray(themeId,selectStr){var strArray=parseSelectValue(selectStr);selectRadio(themeId);changeThumb(themeId,strArray[1]);}
function setHiddenRadioArray(themeId,selectStr){var strArray=parseSelectValue(selectStr);}
function selectRadio(radioId){var len=document[window.ThemesForm].storethemeid.length;for(i=0;i<len;i++){if(document[window.ThemesForm].storethemeid[i].id==radioId){document[window.ThemesForm].storethemeid[i].checked='true';}}}
function parseSelectValue(selectStr){var strArray=selectStr.split("|");return strArray;}
function changeThumb(themeId,thumbURL){eval("document.images['Thumb"+themeId+"'].src ='"+thumbPath+thumbURL+"';");}
var useAccent=typeof(accentVisible)!="boolean"?false:accentVisible;function showAccentLayers(pShow)
{useAccent=pShow;changeColor();}
function updateAccentColor()
{changeColor();}
function changeBackground(divID,frmID,pNoPreview){var d=getStoreElement(divID);if(typeof(d)=="undefined")
{return false;}
if(frmID.indexOf("#")==-1)
{var frm="#"+eval('document[ window.EditThemesForm ].'+frmID).value;}
else
{var frm=frmID;}
if(frm.length==7)
{d.style.backgroundColor=frm;if(!pNoPreview)
{colorPickerPreview();}}}
function changeFontColorCheck(divID,frmID){var d=getStoreElement(divID);var frm=eval('document[ window.EditThemesForm ].'+frmID);if(frm.value.length==6){d.style.color="#"+frm.value;}}
function changeColor()
{changeBackground('primarySection1','primarysectioncolor');changeBackground('primarySection2','primarysectioncolor');changeBackground('primarySection3','primarysectioncolor');changeBackground('secondarySection1','secondarysectioncolor');changeBackground('secondarySection2','secondarysectioncolor');changeBackground('secondarySection3','secondarysectioncolor')
changeBackground('secondarySection4','secondarysectioncolor')
if(useAccent)
{changeBackground('accentSection1','accentsectioncolor');changeBackground('accentSection1_divider','#FFFFFF');changeBackground('accentSection2','accentsectioncolor');changeBackground('accentSection3','accentsectioncolor');}
else
{changeBackground('accentSection1','primarysectioncolor');changeBackground('accentSection1_divider','primarysectioncolor');changeBackground('accentSection2','primarysectioncolor');changeBackground('accentSection3','primarysectioncolor');}}
function changeFontFace(){if(document.all){var d=document.all;}else if(document.layers){var d=document.layers;}else{var d=document.getElementById;var frm=document[window.EditThemesForm];document.getElementById('primarySection1').style.fontFamily=frm.storenamefontface.options[frm.storenamefontface.selectedIndex].text;document.getElementById('primarySection2NN').style.fontFamily=frm.sectiontitlefontface.options[frm.sectiontitlefontface.selectedIndex].text;document.getElementById('primarySection3NN').style.fontFamily=frm.sectiontitlefontface.options[frm.sectiontitlefontface.selectedIndex].text;document.getElementById('secondarySection1').style.fontFamily=frm.storedescriptionfontface.options[frm.storedescriptionfontface.selectedIndex].text;}
if(document.all||document.layers){var frm=document[window.EditThemesForm];d.primarySection1.style.fontFamily=frm.storenamefontface.options[frm.storenamefontface.selectedIndex].text;d.primarySection2NN.style.fontFamily=frm.sectiontitlefontface.options[frm.sectiontitlefontface.selectedIndex].text;d.primarySection3NN.style.fontFamily=frm.sectiontitlefontface.options[frm.sectiontitlefontface.selectedIndex].text;d.secondarySection1.style.fontFamily=frm.storedescriptionfontface.options[frm.storedescriptionfontface.selectedIndex].text;}}
function fontSizeMap(fontSizeValue){var fontSizeText;switch(fontSizeValue){case'1':fontSizeText='xx-small';break;case'2':fontSizeText='x-small';break;case'3':fontSizeText='small';break;case'4':fontSizeText='medium';break;case'5':fontSizeText='large';break;case'6':fontSizeText='x-large';break;case'7':fontSizeText='xx-large';break;}
return fontSizeText;}
function changeFontSize(){if(document.all){var d=document.all;}else if(document.layers){var d=document.layers;}else{var d=document.getElementById;var frm=document[window.EditThemesForm];document.getElementById('primarySection1').style.fontSize=fontSizeMap(frm.storenamefontsize.options[frm.storenamefontsize.selectedIndex].value);document.getElementById('primarySection2NN').style.fontSize=fontSizeMap(frm.sectiontitlefontsize.options[frm.sectiontitlefontsize.selectedIndex].value);document.getElementById('primarySection3NN').style.fontSize=fontSizeMap(frm.sectiontitlefontsize.options[frm.sectiontitlefontsize.selectedIndex].value);document.getElementById('secondarySection1').style.fontSize=fontSizeMap(frm.storedescriptionfontsize.options[frm.storedescriptionfontsize.selectedIndex].value);}
if(document.all||document.layers){var frm=document[window.EditThemesForm];d.primarySection1.style.fontSize=fontSizeMap(frm.storenamefontsize.options[frm.storenamefontsize.selectedIndex].value);d.primarySection2NN.style.fontSize=fontSizeMap(frm.sectiontitlefontsize.options[frm.sectiontitlefontsize.selectedIndex].value);d.primarySection3NN.style.fontSize=fontSizeMap(frm.sectiontitlefontsize.options[frm.sectiontitlefontsize.selectedIndex].value);d.secondarySection1.style.fontSize=fontSizeMap(frm.storedescriptionfontsize.options[frm.storedescriptionfontsize.selectedIndex].value);}}
function changeFontColor(){changeFontColorCheck('primarySection1','storenamefontcolor');changeFontColorCheck('primarySection2NN','sectiontitlefontcolor');changeFontColorCheck('primarySection3NN','sectiontitlefontcolor');changeFontColorCheck('secondarySection1','storedescriptionfontcolor');colorPickerChange('storenamefontcolor');colorPickerChange('sectiontitlefontcolor');colorPickerChange('storedescriptionfontcolor');}
function colorPickerChange(frmID){var d=null;var frm=eval('document[ window.EditThemesForm ].'+frmID);switch(frmID){case'primarysectioncolor':d=getStoreElement('primarySectionCell');break;case'accentsectioncolor':d=getStoreElement('accentSectionCell');break;case'secondarysectioncolor':d=getStoreElement('secondarySectionCell');break;case'storenamefontcolor':d=getStoreElement('storeNameCell');break;case'sectiontitlefontcolor':d=getStoreElement('sectionTitleCell');break;case'storedescriptionfontcolor':d=getStoreElement('storeDescriptionCell');break;}
if(frm.value.length==6){d.style.backgroundColor="#"+frm.value;}}
function getStoreElement(id){if(document.all){var d=document.all[id];}else if(document.layers){var d=document.layers[id];}else{var d=document.getElementById(id);}
return d;}
function colorPickerPreview(){colorPickerChange('primarysectioncolor');colorPickerChange('accentsectioncolor');colorPickerChange('secondarysectioncolor');colorPickerChange('storenamefontcolor');colorPickerChange('sectiontitlefontcolor');colorPickerChange('storedescriptionfontcolor');}
function previewSearch(actionType,formID){var frm=eval("document.forms['"+formID+"']");if(frm){frm.actionmode.value=actionType;frm.submit();}}
function doFileChange(radioIndex){autoCheck(radioIndex);document.LogoForm.pmaddgraphic.value='';}
function doSelectFile(radioIndex){autoCheck(radioIndex);document.PicManSelect.showSelect.click();}
function previewAllCustomLogo(fieldName,radioIndex)
{switch(fieldName)
{case"addLogo":field=document.LogoForm.pmaddgraphic;imgField=document.images.addLogo;break;case"selectLogo":field=document.LogoForm.pmselectgraphic;imgField=document.images.selectLogo;break;default:field=document.LogoForm.customgraphic;imgField=document.images.custom;}
var fieldValue=field.value;if(fieldValue&&imgField){autoCheck(radioIndex);var imageUrl=field.value;var endIndex=imageUrl.length-1;imgField.height.value=90;imgField.width.value=310;if((imageUrl.indexOf('http://'))>=0)
{imgField.src=imageUrl;}
else
{imgField.src='http://'+imageUrl;}}
return;}
function onSave(siteId,pageID){setDetailsForm(siteId,pageID);submitForm('Continue');}
function submitForm(calledFrom){if(calledFrom=='Preview'){var file=document.forms["LogoForm"].d.value;var url=document.forms["LogoForm"].pmaddgraphic.value;if((file!='')&&(url.indexOf("ebayimg")==-1)){setLogoAction();document.forms["LogoForm"].submit();}}else if(calledFrom=='OnError'){document.forms["DetailsForm"].submit();}else{var file=document.forms["LogoForm"].d.value;var url=document.forms["LogoForm"].pmaddgraphic.value;if((document.LogoForm.storegraphic[1].checked)&&(file!='')&&(url.indexOf("ebayimg")==-1))
{setLogoAction();document.forms["DetailsForm"].callFromContinue.value="Y";document.forms["LogoForm"].submit();}
else
{document.forms["DetailsForm"].submit();}}}
function setDetailsForm(siteId,pageID){document.DetailsForm.storename.value=document.TitleForm.storename.value;document.DetailsForm.storedesc.value=document.TitleForm.storedesc.value;if(pageID!=''){document.DetailsForm.destinationpage.value=pageID;}
if(siteId=='196'||siteId=='223'){document.DetailsForm.storeurl.value=document.TitleForm.storeurl.value;}
for(count=0;count<5;count++){if(document.LogoForm.storegraphic[count].checked){document.DetailsForm.storegraphic.value=document.LogoForm.storegraphic[count].value;break;}}
document.DetailsForm.predefinedgraphic.value=document.LogoForm.predefinedgraphic.options[document.LogoForm.predefinedgraphic.selectedIndex].value;document.DetailsForm.pmaddgraphic.value=document.LogoForm.pmaddgraphic.value;if(document.LogoForm.d.value!=''){document.DetailsForm.uploadLogoFileName.value=document.LogoForm.d.value;}
var selectGraphic=eval("document.LogoForm.pmselectgraphic");if(selectGraphic){document.DetailsForm.pmselectgraphic.value=document.LogoForm.pmselectgraphic.value;}
document.DetailsForm.customgraphic.value=document.LogoForm.customgraphic.value;}
function getLogoUrl(normalUrl,logoSuffix){var lastIndex=normalUrl.lastIndexOf("_");var logoUrl=normalUrl;var typeIndex=normalUrl.lastIndexOf(".");if((lastIndex!=-1)&&(typeIndex!=-1)){if(normalUrl.charAt(lastIndex-2)=="_"){logoUrl=normalUrl.substring(0,lastIndex-1)+logoSuffix+normalUrl.substring(typeIndex,normalUrl.length);}else{logoUrl=normalUrl.substring(0,lastIndex+1)+logoSuffix+normalUrl.substring(typeIndex,normalUrl.length);}}
return logoUrl;}
function epsBasicResponse(normalUrl,error,graphicAdd,siteId){url=getLogoUrl(normalUrl,"11");if(error!=''){document.forms["DetailsForm"].elements["errorCode"].value=error;setDetailsForm(siteId,'');submitForm('OnError','');}else{var de=document.forms["LogoForm"].elements["pmaddgraphic"];de.value=url;previewAllCustomLogo('addLogo',graphicAdd);if(document.forms["DetailsForm"].callFromContinue.value=="Y"){document.DetailsForm.pmaddgraphic.value=document.LogoForm.pmaddgraphic.value;submitForm('Continue');}}}
function setEPSProtocolVersion(protocolVersion){}
function onPreviewContinue(calledFrom){submitForm(calledFrom);}
function showRTEPictureManager(userName,inputName,serverName)
{this.RTEInputName=inputName;this.RTEName='RTE_'+inputName;var cmdName=serverName+'StoreEditTheme';var url=cmdName.concat("&userName=",userName);var h=700;var w=552;if((country=="es")||(country=="it")||(country=="fr")||(country=="nl")||(country=="benl")||(country=="befr"))
{h=710;}
else if((country=="de"))
{h=710;}
else if((country=="cn"))
{h=710;}
else if((country=="at"))
{h=710;}
else if((country=="ch"))
{h=710;}
if(country=="tw"){h=726;}
if(is.nav&&(is.ver>5)){h-=5;}
var agt2=navigator.userAgent.toLowerCase();var is_ns2=(agt2.indexOf("netscape")!=-1);if(is_ns2&&agt2.indexOf("7.0")!=-1)
{h+=20;}
ebPMWindow=ebayShowPopupWindow(url,"picManRTE",w,h,0,0,0,0,0,0);}
function getDateFormat(siteId){var dateFormat='dd-mm-yy';if(siteId==0||siteId==1||siteId==2){dateFormat='mm/dd/yy';}else if(siteId==196||siteId==223){dateFormat='yy/mm/dd';}
return dateFormat;}
function disableSVHRTE(){var vacationHoldForm=document.forms["VacationHold"];vacationHoldForm.actionmode.value="useste";vacationHoldForm.disableRTE.value="2";vacationHoldForm.submit();return false;}
function customKeywordPreview(actionId,formName){if(typeof(formName)=='undefined')
return false;var url="about:blank";var h=550;var w=600;var previewPop=ebayShowPopupWindow(url,"keywordPreview",w,h,0,0,0,0,1,0);document.forms[formName].action=actionId;document.forms[formName].target="keywordPreview";document.forms[formName].submit();}
function popupPreviewVacationDate(url)
{if(target=="_self")
return false;var target='blank';var h=300;var w=800;var LeftPosition=(screen.width)?(screen.width-w)/2:0;var TopPosition=(screen.height)?(screen.height-h)/2:0;var settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+'no'+',resizable='+'no'+'';var win=window.open(url,target,settings);}
function popupPreviewStoreVacationMsg(url)
{if(target=="_self")
return false;var target='blank';var h=300;var w=805;var LeftPosition=(screen.width)?(screen.width-w)/2:0;var TopPosition=(screen.height)?(screen.height-h)/2:0;var settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+'yes'+',resizable='+'no'+'';var win=window.open(url,target,settings);}
// -->

