
var bEmptyQuickSearch=false
var hWnd=null;var bLoadAll=false;var strAgent=navigator.userAgent;var strPlatform=navigator.platform;var scrolltimer=null;var bSearchField=false;var bSelectLoaded=false;var bSelectVisible=false;var selecttimer=null;this.name="artoffer";function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function getAbsoluteX(obj)
{var x=0;if(obj&&typeof obj.offsetParent!="undefined"){while(obj&&typeof obj.offsetLeft=="number"){x+=obj.offsetLeft;obj=obj.offsetParent;}}
return x;}
function getAbsoluteY(obj)
{var y=0;if(obj&&typeof obj.offsetParent!="undefined"){while(obj&&typeof obj.offsetTop=="number"){y+=obj.offsetTop;obj=obj.offsetParent;}}
return y;}
function getMouseY(e)
{if(e)y=e.clientY;}
function checkDate(nDay,nMonth,nYear,msg)
{if(nDay!=0&&nMonth!=0&&nYear!=0)
{var bInvalid=false;if(nDay==31)
{if(nMonth==2||nMonth==4||nMonth==6||nMonth==9||nMonth==11)bInvalid=true}
else if(nMonth==2)
{if(nDay==30)bInvalid=true
if(nDay==29)
{if(parseInt(nYear/4)!=nYear/4)bInvalid=true}}
if(bInvalid==false)return true
else
{if(msg)alert(msg)
return false;}}
else
{if(msg)alert(msg);return false;}}
function checkTime(nHour,nMinute,msg){if(nHour>23||nMinute>59){if(msg)alert(msg);return false;}else{return true;}}
function compareDate(nDay1,nMonth1,nYear1,nDay2,nMonth2,nYear2)
{nDay1=parseInt(nDay1)
nMonth1=parseInt(nMonth1)
nYear1=parseInt(nYear1)
nDay2=parseInt(nDay2)
nMonth2=parseInt(nMonth2)
nYear2=parseInt(nYear2)
if(nYear2<nYear1)return false
else if(nYear1==nYear2)
{if(nMonth2<nMonth1)return false;else if(nMonth1==nMonth2)
{if(nDay2<=nDay1)return false
else return true}
else if(nMonth1<nMonth2)return true}
else if(nYear1<nYear2)return true}
function checkEmail(strEmail)
{if(strEmail!="")
{if(strEmail.search(/@.+/)==-1 || strEmail.search(/\s/) >= 0)return false
else if(strEmail.search(/@.+/)==-1)return false
{strArrEmail=strEmail.split(".");if(!strArrEmail[1])return false
else return true}}
else return false}
function OpenImageUpload(url)
{breite=600;hoehe=670;var l=(screen.availWidth-breite)/2;var t=(screen.availHeight-hoehe)/2;ClosePopup();hWnd=window.open(url,"upload","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=no,width="+breite+",height="+hoehe+",left="+l+",top="+t+";")}
function OpenImageUpload2(url)
{breite=600;hoehe=600;var l=(screen.availWidth-breite)/2;var t=(screen.availHeight-hoehe)/2;ClosePopup();hWnd=window.open(url,"upload","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=no,width="+breite+",height="+hoehe+",left="+l+",top="+t+";")}
newwindow=false;function OpenPopup(url,nWidth,nHeight)
{if(nWidth>0)breite=nWidth
else breite=400;if(nHeight>0)hoehe=nHeight
else hoehe=350;if(newwindow&&newwindow.closed==false)
newwindow.close()
var l=(screen.availWidth-breite)/2;var t=(screen.availHeight-hoehe)/2;newwindow=window.open(url,"newwindow","width="+breite+",height="+hoehe+",left="+l+",top="+t+";");newwindow.focus();}
function OpenPopup2(url,nWidth,nHeight)
{if(nWidth>0)breite=nWidth
else breite=400;if(nHeight>0)hoehe=nHeight
else hoehe=350;if(newwindow&&newwindow.closed==false)
newwindow.close()
var l=(screen.availWidth-breite)/2;var t=(screen.availHeight-hoehe)/2;window.open(url,"newwindow","width="+breite+",height="+hoehe+",left="+l+",top="+t+",scrollbars=yes");}
function ClosePopup()
{if(navigator.appName!="Microsoft Internet Explorer"||parseInt(navigator.appVersion)>=4)
if(hWnd!=null)
if(!hWnd.closed)
hWnd.close();}
function hideAll()
{var i=0;while(document.getElementsByTagName("div")[i])
{if(document.getElementsByTagName("div")[i].name=="divPopup")document.getElementsByTagName("div")[i].style.visibility="hidden";i++;}}
function openDivPopup(bOpen,nWindownr,nDivWidth,nDivHeight){var objDiv=getObj("divPopup#"+nWindownr);if(bOpen&&objDiv){var nAvailWidth=screen.availWidth;if(nAvailWidth>1024)nAvailWidth=1024;var nLeft=(nAvailWidth-nDivWidth)/2;var nTop=(screen.availHeight-nDivHeight)/2;var nPageOffset=0
if(self.pageYOffset)
nPageOffset=self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)
nPageOffset=document.documentElement.scrollTop;else if(document.body)
nPageOffset=document.body.scrollTop;objDiv.style.top=nTop+nPageOffset;objDiv.style.left=nLeft;objDiv.style.position="absolute";objDiv.style.visibility="visible";}else if(objDiv){hideAll();objDiv.style.visibility="hidden";}}
function checkResolution()
{if((screen.width<1024)&&(screen.height<768))return true;else return false;}
function checkFlash(bVersion)
{flash_versions=20;var flash=new Object();flash.installed=false;flash.version='0.0';if(navigator.plugins&&navigator.plugins.length){for(x=0;x<navigator.plugins.length;x++){if(navigator.plugins[x].name.indexOf('Shockwave Flash')!=-1){flash.version=navigator.plugins[x].description.split('Shockwave Flash ')[1];flash.installed=true;break;}}}
else if(window.ActiveXObject){for(x=4;x<=flash_versions;x++){try{oFlash=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+x+"');");if(oFlash){flash.installed=true;flash.version=x+'.0';}}
catch(e){}}}
flash.ver=Array();for(i=4;i<=flash_versions;i++){eval("flash.ver["+i+"] = (flash.installed && parseInt(flash.version) >= "+i+") ? true : false;");}
if(bVersion==true)return flash.version
else return flash.installed}
function initLayers(strIds)
{var y;var test1=document.body.scrollHeight;var test2=document.body.offsetHeight
if(test1>test2)y=document.body.scrollHeight
else y=document.body.offsetHeight;var strArrId=strIds.split("#")
for(i=0;i<strArrId.length;i++)
{if(getObj(strArrId[i]))getObj(strArrId[i]).style.height=y-getAbsoluteY(getObj(strArrId[i]))}}
function initGreetingSelect()
{if(getObj("artistSelect"))getObj("artistSelect").options[0].selected=true;}
function initSelect(strDefault)
{if(getObj("artistSelect"))getObj("artistSelect").options[0].selected="true"
if(getObj("DD1_1_field"))getObj("DD1_1_field").value=strDefault}
function initQuickSearch(strText)
{if(getObj("quickSearch"))
{if(trim(getObj("quickSearch").value) == ""){getObj("quickSearch").focus();getObj("quickSearch").value=strText;}}}
function emptyQuickSearch(strQuickSearchInit) {getObj("quickSearch").value = getObj("quickSearch").value.replace(eval('/'+strQuickSearchInit+'/g'),"");}
function getObject(strId)
{if(getObj(strId))return getObj(strId)
else return false}
function hover(strId,strClass,bOver,bGroup)
{if(bGroup)
{var i=0
while(document.getElementsByName(strId)[i])
{if(bOver)document.getElementsByName(strId)[i].className=strClass
else document.getElementsByName(strId)[i].className=strClass
i++;}}
else getObject(strId).className=strClass}
function getObj(strId)
{if(document.getElementById(strId))return document.getElementById(strId)
else return false;}
function trim(strString){if(strString){if(strString.replace(/^\s+|\s+$/g,"")!="")return strString.replace(/^\s+|\s+$/g,"")
else return false}else return false}
function replaceHtmlEntities(strString)
{var strTemp
if(strString)
{strTemp=strString.replace(/&auml;/g,"ä")
strTemp=strTemp.replace(/&ouml;/g,"ö")
strTemp=strTemp.replace(/&uuml;/g,"ü")
strTemp=strTemp.replace(/&nbsp;/g," ")
return strTemp}}
function addSeparators(nStr,inD,outD,sep)
{nStr+='';var dpos=nStr.indexOf(inD);var nStrEnd='';if(dpos!=-1){nStrEnd=outD+nStr.substring(dpos+1,nStr.length);nStr=nStr.substring(0,dpos);}
var rgx=/(\d+)(\d{3})/;while(rgx.test(nStr)){nStr=nStr.replace(rgx,'$1'+sep+'$2');}
return nStr+nStrEnd;}
function verScroll(dir,spd,loop,maxHeight)
{loop=true;direction="up";speed=1000;if(document.layers)
{var page=eval(document.contentLayer);}
else
{if(document.getElementById)
{var page=eval("document.getElementById('contentLayer').style");}
else
{if(document.all)
{var page=eval(document.all.contentLayer.style);}}}
if(strAgent.indexOf("MSIE")>0&&strPlatform.indexOf("Mac")>=0)page.position="absolute"
direction=dir;speed=parseInt(spd);var y_pos=parseInt(page.top);maxH=parseInt(maxHeight)
if(loop==true)
{if(direction=="dn")
{if(y_pos>-maxH)
page.top=(y_pos-(speed));else
page.top=372;}
else
{if(direction=="up"&&y_pos<0)
{page.top=(y_pos+(speed));}
else
{if(direction=="top")
{page.top=10;}}}
scrolltimer=setTimeout("verScroll(direction,speed,true,maxH)",50);}}
function stopScroll()
{if(scrolltimer)
{loop=false;clearTimeout(scrolltimer);}}
function maxLength(obj,nMaxLength,bConsiderBreaks){if(bConsiderBreaks){var nBreaksCount=0;var strValue=String(obj.value);var Result=strValue.match(/\n.+/g);if(Result)nBreaksCount=Result.length;nMaxLength=nMaxLength-(nBreaksCount*4)}
if(parseInt(obj.value.length)>=parseInt(nMaxLength))obj.value=obj.value.substr(0,nMaxLength-1)}
function formatNumber(number,format,print)
{var separator="'";var decpoint=".";var percent="%";var currency="$";if(print)document.write("formatNumber("+number+", \""+format+"\")<br>");if(number-0!=number)return null;var useSeparator=format.indexOf(separator)!=-1;var usePercent=format.indexOf(percent)!=-1;var useCurrency=format.indexOf(currency)!=-1;var isNegative=(number<0);number=Math.abs(number);if(usePercent)number*=100;format=strip(format,separator+percent+currency);number=""+number;var dec=number.indexOf(decpoint)!=-1;var nleftEnd=(dec)?number.substring(0,number.indexOf(".")):number;var nrightEnd=(dec)?number.substring(number.indexOf(".")+1):"";dec=format.indexOf(decpoint)!=-1;var sleftEnd=(dec)?format.substring(0,format.indexOf(".")):format;var srightEnd=(dec)?format.substring(format.indexOf(".")+1):"";if(srightEnd.length<nrightEnd.length){var nextChar=nrightEnd.charAt(srightEnd.length)-0;nrightEnd=nrightEnd.substring(0,srightEnd.length);if(nextChar>=5)nrightEnd=""+((nrightEnd-0)+1);while(srightEnd.length>nrightEnd.length){nrightEnd="0"+nrightEnd;}
if(srightEnd.length<nrightEnd.length){nrightEnd=nrightEnd.substring(1);nleftEnd=(nleftEnd-0)+1;}}else{for(var i=nrightEnd.length;srightEnd.length>nrightEnd.length;i++){if(srightEnd.charAt(i)=="0")nrightEnd+="0";else break;}}
sleftEnd=strip(sleftEnd,"#");while(sleftEnd.length>nleftEnd.length){nleftEnd="0"+nleftEnd;}
if(useSeparator)nleftEnd=separate(nleftEnd,separator);var output=nleftEnd+((nrightEnd!="")?"."+nrightEnd:"");output=((useCurrency)?currency:"")+output+((usePercent)?percent:"");if(isNegative){output=(useCurrency)?"("+output+")":"-"+output;}
return output;}
function strip(input,chars)
{var output="";for(var i=0;i<input.length;i++)
if(chars.indexOf(input.charAt(i))==-1)
output+=input.charAt(i);return output;}
function separate(input,separator)
{input=""+input;var output="";for(var i=0;i<input.length;i++){if(i!=0&&(input.length-i)%3==0)output+=separator;output+=input.charAt(i);}
return output;}
function showSelect(strShow,strDefaultSearch){if(getObj("divSelect")&&bSelectLoaded){var bClearTimeout=true;if(strShow=="switch"){if(!bSelectVisible)strShow=true;else strShow=false;bClearTimeout=false;}
if(strShow==true){if(bClearTimeout)clearTimeout(selecttimer);getObj("divSelect").style.visibility="visible";bSelectVisible=true;}else{getObj("divSelect").style.visibility="hidden";bSelectVisible=false;getObj("tdSearch").className="";getSearchField(false,strDefaultSearch);}}}
function getSearchField(strFormAction,strDefaultSearch){strSearchField='<form action="'+strFormAction+'" method="post"><input id="inputKeyword" type="text" name="keyword" class="select"><input type="submit" value="Go" class="select_submit"><input type="hidden" name="searchText" value="-1"></form>';if(!bSearchField&&!strDefaultSearch)
{getObj("tdSearch").innerHTML=strSearchField;getObj("inputKeyword").focus();bSearchField=true;}else if(strDefaultSearch){getObj("tdSearch").innerHTML="<a>"+strDefaultSearch+"</a>";bSearchField=false;}}
function changeClassSelect(obj,strClass){obj.className=strClass;if(obj&&obj.firstChild)obj.firstChild.className=strClass;if(bSearchField)getObj("tdSearch").className="over";}
function initSwitch(){if(typeof(window["arrImage"])!="undefined"){nStart=parseInt(Math.random()*arrImage.length);setTimeout(switchImage,1500);}}
function getTimeZoneOffset(){var now=new Date();var diff=now.getTimezoneOffset()/60;return diff;}
function padDigits(n,totalDigits){n=n.toString();var pd='';if(totalDigits>n.length){for(i=0;i<(totalDigits-n.length);i++){pd+='0';}}
return pd+n.toString();}
function initArtBlogs(){if(self.location.hash=="#artblogs")window.scrollTo(0,1340);}
function getXmlHttpObj(){var objXmlHttp=null;if(typeof XMLHttpRequest!='undefined'){objXmlHttp=new XMLHttpRequest();}
if(!objXmlHttp){try{objXmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{objXmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){objXmlHttp=null;}}}
if(objXmlHttp){return objXmlHttp}else{return false;}}
function checkPassword(strPassword){var strArrInvalidChars=new Array(" ","ä","ö","ü","Ä","Ö","Ü");var i=0;var bFailed=false;for(i=0;i<strArrInvalidChars.length;i++){if(strPassword.indexOf(strArrInvalidChars[i])>-1){bFailed=true;break;}}
if(!bFailed)return true;}
function helo(){alert("helo")}
function showAdBanner(){if((obj=getObj('divLogoExtrafilm'))||(obj=getObj('divLogoMadrigal'))||(obj=getObj('divLogoMostpopular'))||(obj=getObj('divLogoEdelweissair'))||(obj=getObj('divLogoCornercard'))||(obj=getObj('divLogoCornercard-2'))||(obj=getObj('divLogoArtLover'))||(obj=getObj('divLogoArtpromotion'))){if(typeof strAdBanner!='undefined'){obj.innerHTML=strAdBanner;}}}