function getElementsByClassName(g,h){var b=[];var f=new RegExp("\\b"+h+"\\b");var e=g.getElementsByTagName("*");for(var d=0,c=e.length;d<c;d++){if(f.test(e[d].className)){b.push(e[d])}}return b}function googleMapsInit(){if(document.getElementById&&document.getElementsByTagName){if(document.getElementById("GoogleMaps")){var a="";loadGoogleMap(a)}}}function popupInit(){if(document.getElementById&&document.getElementsByTagName){popup=new PopUp();popup.addType({name:"pdf",width:800,height:900,location:true,title:"This PDF Document opens in a new window"});popup.addType({name:"doc",width:100,height:100,resizable:true,title:"This Word Document opens in a new window"});popup.addType({name:"extern",width:1000,height:600,scrollbars:true,center:false,location:true,resizable:true,status:true,title:"This link points to another domain and opens in a new window"});popup.addType({name:"rate",width:500,height:700,scrollbars:true,center:true,location:true,resizable:true,status:false,title:"This link points to another domain and opens in a new window"});popup.addType({name:"chat",width:600,height:550,scrollbars:false,center:true,location:false,resizable:false,status:false,title:""});popup.addType({name:"order",width:595,height:842,scrollbars:true,center:false,title:"This Order opens in a new window"});popup.addType({name:"info",width:300,height:300,top:300,status:true});popup.apply()}}function jscss(b,f,d,c){switch(b){case"swap":f.className=!jscss("check",f,d)?f.className.replace(c,d):f.className.replace(d,c);break;case"add":if(!jscss("check",f,d)){f.className+=f.className?" "+d:d}break;case"remove":var e=f.className.match(" "+d)?" "+d:d;f.className=f.className.replace(e,"");break;case"check":return new RegExp("\\b"+d+"\\b").test(f.className);break}}function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}var selected;var submitter=null;function submitFunction(){submitter=1}function popupWindow(a){window.open(a,"popupWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150")}function selectRowEffect(a,b){if(!selected){if(document.getElementById){selected=document.getElementById("defaultSelected")}else{selected=document.all.defaultSelected}}if(selected){selected.className="moduleRow"}a.className="moduleRowSelected";selected=a;if(document.getElementById("payment"[0])){document.getElementById("payment"[b]).checked=true}else{}}function rowOverEffect(a){if(a.className=="moduleRow"){a.className="moduleRowOver"}}function rowOutEffect(a){if(a.className=="moduleRowOver"){a.className="moduleRow"}}function popupImageWindow(a){window.open(a,"popupImageWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150")}function check_form_optional(b){var d=b;var e=d.elements.firstname.value;var c=d.elements.lastname.value;var a=d.elements.street_address.value;if(e==""&&c==""&&a==""){return true}else{return check_form(b)}}function check_form(){var e=unescape("Missing necessary information!\nPlease fill in correctly.\n\n");var f=false;var g;var d=document.getElementById("advanced_search").keywords.value;var b=document.getElementById("advanced_search").pfrom.value;var c=document.getElementById("advanced_search").pto.value;var h;var a;if((d==""||d.length<1)&&(b==""||b.length<1)&&(c==""||c.length<1)){e=e+unescape("One of the following fields must be filled:\n    Keywords\n    Date added from\n    Date added to\n    Price over\n    Price up to\n");g=document.getElementById("advanced_search").keywords;f=true}if(b.length>0){h=parseFloat(b);if(isNaN(h)){e=e+unescape("Price over, must be a number\n");g=document.getElementById("advanced_search").pfrom;f=true}}else{h=0}if(c.length>0){a=parseFloat(c);if(isNaN(a)){e=e+unescape("Price up to, must be a number\n");g=document.getElementById("advanced_search").pto;f=true}}else{a=0}if((b.length>0)&&(c.length>0)){if((!isNaN(h))&&(!isNaN(a))&&(a<h)){e=e+unescape("Price up to must be larger or same size as Price over.\n");g=document.getElementById("advanced_search").pto;f=true}}if(f==true){alert(e);g.focus();return false}}function popupWindow(a){window.open(a,"popupWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150")}function checkFormReview(){var b=0;var c=unescape("Missing necessary information!\nPlease fill in correctly.\n\n");var a=document.getElementById("product_reviews_write").review.value;if(a.length<50){c=c+unescape("The text must consist at least of 50 alphabetic characters..\n");b=1}if(!((document.getElementById("product_reviews_write").rating[0].checked)||(document.getElementById("product_reviews_write").rating[1].checked)||(document.getElementById("product_reviews_write").rating[2].checked)||(document.getElementById("product_reviews_write").rating[3].checked)||(document.getElementById("product_reviews_write").rating[4].checked))){c=c+unescape("Enter your review.\n");b=1}if(b==1){alert(c);return false}else{return true}}function switchJSElements(){if(document.getElementsByName){getElementsByClassName(document,"jsNone");for(i=0;i<getElementsByClassName(document,"jsNone").length;i++){jscss("swap",getElementsByClassName(document,"jsNone")[i],"jsNone","jsBlock")}}}function hideSubmitButton(){btn=document.getElementById("checkout_confirm_button");btn2=document.getElementById("checkout_confirm_button_top");hint=document.getElementById("checkout_confirm_hint");hint2=document.getElementById("checkout_confirm_hint_top");jscss("add",btn,"jsNone","");jscss("add",btn2,"jsNone","");jscss("swap",hint,"none","jsblock");jscss("swap",hint2,"none","jsblock")}function breakFrames(){if(top.frames.length>0){top.location.href="http://www.erzgebirge-palace.de/"}}function globalInit(){switchJSElements();popupInit();googleMapsInit();if(document.getElementById("checkout_confirm_button")){btn=document.getElementById("checkout_confirm_button");btn2=document.getElementById("checkout_confirm_button_top");addEvent(btn,"click",hideSubmitButton);addEvent(btn2,"click",hideSubmitButton)}if(document.getElementById("utmform")){__utmSetTrans()}}addEvent(window,"load",globalInit);
