var w3c=false;var ie=false;var timerID=null;var timerOn=false;if(document.getElementById){var w3c=true;}
if(document.all){var ie=true;}
function displayLayer(strName,displayType){if(document.getElementById(strName)&&displayType!='')
{resetTimer();document.getElementById(strName).style.display=displayType;}}
function noneLayer(strName){if(document.getElementById(strName))
{document.getElementById(strName).style.display='none';}}
function resetTimer(){if(timerOn){clearTimeout(timerID);timerID=null;timerOn=false;}}
function showDropMenu(strName,displayType){displayLayer(strName,displayType);}
function hideDropMenu(strName){if(timerOn==false){timerID=setTimeout('noneLayer("'+strName+'")',1000);timerOn=true;}}
function swapImage(imgName,imgSrc){document.getElementById(imgName).src=imgSrc;}
function logInFormValue(which,theValue){if(document.getElementById(which).value==theValue){document.getElementById(which).value='';}else if(document.getElementById(which).value==''){document.getElementById(which).value=theValue;}}
function rollArrow(chosen,objectID){if(chosen=="active"){document.getElementById(objectID).className="arrowActive";}
else{document.getElementById(objectID).className="arrow";}}
function setStyle(objId,style,styleValue){document.getElementById(objId).style[style]=styleValue;}
function changeClass(objectID,toClass){document.getElementById(objectID).className=toClass;}
function submitIt(theFormName,parameter1,value1){document.getElementById(parameter1).value=value1;temp="document."+theFormName+".submit()"
eval(temp);}
function search(frmName){frm=document.getElementById(frmName);if(frm.onsubmit()){frm.submit();}}
function checkSearch(searchForm){while(searchForm.query.value.charAt(searchForm.query.value.length-1)==' ')searchForm.query.value=searchForm.query.value.substring(0,searchForm.query.value.length-1);if(searchForm.query.value!=""){return true;}else{return false;}}
var ie7=(document.documentElement&&typeof document.documentElement.style.maxHeight!="undefined")?true:false;function tagVisibility(tag,visibility){if(ie&&!ie7){var numOfForms=document.forms.length;for(var f=0;f<numOfForms;f++){theForm=document.forms[f];for(var i=0;i<theForm.length;i++){var theElement=theForm.elements[i];if(theElement.tagName==tag){if(visibility=='hide'){hideElement(theElement);}else if(visibility=='show'){showElement(theElement);}}}}}}
function showElement(obj){obj.style.visibility="visible";}
function hideElement(obj){obj.style.visibility="hidden";}
var w3c=(document.getElementById)?true:false;var ie=(document.all)?true:false;var ns=(document.layers)?true:false;if(document.images){var arrow_over=new Image();arrow_over.src="http://www.ikea.com/ms/img/navigation/goBtn_over.gif";var arrow=new Image();arrow.src="http://www.ikea.com/ms/img/navigation/goBtn.gif";}
function init(initVal){var selectID="select1";var catID="catid";if(!optionTestIt(selectID)){alert(js_fn_NOT_VALID_BROWSER);return false;}
if(document.getElementById){tmp=document.getElementById(selectID);tmp2=document.getElementById(catID);}else if(document.all){tmp=document.all[selectID];tmp2=document.all[catID];}else{alert(js_fn_NOT_VALID_BROWSER);return false;}
tmp2.value=pifCatalogId;tmp.options[0]=new Option(initVal,'#');for(var i=0;i<aText.length;i++){tmp.options[i+1]=new Option(aText[i],aValue[i]);}
tmp.selectedIndex=0;}
function initNews(initVal,newVal){var selectID="select1";var catID="catid";if(!optionTestIt(selectID)){alert(js_fn_NOT_VALID_BROWSER);return false;}
if(document.getElementById){tmp=document.getElementById(selectID);tmp2=document.getElementById(catID);}else if(document.all){tmp=document.all[selectID];tmp2=document.all[catID];}else{alert(js_fn_NOT_VALID_BROWSER);return false;}
tmp2.value=pifCatalogId;tmp.options[0]=new Option(initVal,'#');tmp.options[1]=new Option(newVal,'NEW');for(var i=0;i<aText.length;i++){tmp.options[i+2]=new Option(aText[i],aValue[i]);}
tmp.selectedIndex=0;}
function openNewPage(argFieldId){if(document.getElementById){tmp=document.getElementById(argFieldId);}else if(document.all){tmp=document.all[argFieldId];}else{alert(js_fn_NOT_VALID_BROWSER);return false;}
if(tmp.selectedIndex<1)
return false;document.location.href=aValue[tmp.selectedIndex];}
function optionTestIt(argFieldId)
{optionTest=true;if(document.getElementById){tmp=document.getElementById(argFieldId);}else if(document.all){tmp=document.all[argFieldId];}else{optionTest=false;}
lgth=tmp.options.length-1;tmp.options[lgth]=null;if(tmp.options[lgth])
optionTest=false;return optionTest;}
function out(imgName){if(document.images)
eval('document.'+imgName+'.src = '+imgName.substr(0,imgName.length-1)+'.src')}
function over(imgName){if(document.images)
eval('document.'+imgName+'.src = '+imgName.substr(0,imgName.length-1)+'_over.src')}
function go(){if(document.selecter.prod.options[document.selecter.prod.selectedIndex].value!="none"){location=document.selecter.prod.options[document.selecter.prod.selectedIndex].value}}
function browseIt(formId,selectId){if(w3c){if(document.getElementById(selectId).value!="#"){if(document.getElementById(selectId).value.indexOf(";;")!=-1){var hc_link=document.getElementById(selectId).value;var keyVals=hc_link.split(";;");document.getElementById(formId).storeId.value=keyVals[0];document.getElementById(formId).langId.value=keyVals[1];document.getElementById(selectId).options[document.getElementById(selectId).options.length]=new Option("Cross Link",keyVals[2],true,true);}
else if(document.getElementById(selectId).value.indexOf("NEW")!=-1){document.getElementById(formId).action='http://www.ikea.com/webapp/wcs/stores/servlet/IkeamsNews';}
document.getElementById(formId).submit();}}else{if(document.all[selectId].value!="#"){document.all[formId].submit();}}}
function selectBrowse(frameName,formName,selectName){var temp="document."+formName+"."+selectName+".options[document."+formName+"."+selectName+".options.selectedIndex].value";if(eval(temp)!="do_nothing"){if(frameName==""){location.href=eval(temp);}else if(frameName=="new"){window.open(eval(temp))}else{temp=frameName+".location.href = "+temp;eval(temp);}}}
function changeLangId(langId){var x=location.href.indexOf('langId');var y=location.href.indexOf('&',x);var newHref=location.href.substring(0,x);newHref=newHref.concat('langId=',langId);if(x<y){newHref=newHref.concat(location.href.substring(y));}
location.href=newHref;}
function selectStore(storeId,langId,storeNumber){location.href='http://www.ikea.com/webapp/wcs/stores/servlet/IkeaNearYouView?storeId='+storeId+'&langId='+langId+'&StoreNumber='+storeNumber;}
function selectStoreF(locale,storeNumber){setCookie('selected_store_'+locale,storeNumber,null,'/');if(arguments[2]){location.href=location.href+'&localStore='+arguments[2];}else{location.reload(true);}}

