function EditItem1(){window.document.Form_Submenu.editSM.value=1;window.document.Form_Submenu.submit();}
function SubmitChangedItem(){window.document.Form_Submenu.editSM.value=1;window.document.Form_Submenu.submit();}
function KeyEnterPressed(){if(window.event.keyCode==13){SubmitChangedItem();}}
function OpenWindow(sFile,name,par){hWndHandle=window.open(sFile,name,par);hWndHandle.focus();}
var ImageWND=null;function CloseViewer(){if(ImageWND){}}
function ShowImage(id,img_x,img_y,istxt,mod){img_x=img_x+20;img_y=img_y+70;if(self.innerHeight)img_y+=15;if(istxt)img_y=img_y+60;if(img_x<200)img_x=200;var1='/file.php?f=modules/gallery/showimage.php&id='+id+'&module='+mod;var2='\'ImageViewer\'';var3='\'scrollbars=no,width=1,height=1\'';ImageWND=window.open(var1,'ImageViewer',var3);ImageWND.resizeTo(img_x,img_y);ImageWND.focus();}
function PopupImg(file,w,h){ImageWND=window.open(file,'ImageViewer','scrollbars=no,width='+w+',height='+h);ImageWND.focus();}
function ShowShopImage(url,img_x,img_y){img_x=img_x+20;img_y=img_y+20;var1='mydata/images/'+url;var3='\'scrollbars=no,width='+img_x+',height='+img_y+'\'';ImageWND=window.open(var1,'ItemViewer',var3);ImageWND.focus();}
function CheckAll(par){var count=document.getElementsByName("NumChecks")[0].value;for(var i=0;i<count;i++){document.getElementsByName('files[]')[i].checked=par;}}
function SetChecks(){if(window.document.getElementsByName("Btn_ChangeChecks")[0].checked==true){CheckAll(true);}else{CheckAll(false);}}
function SubmitGuestbook(v1,v2,v3){string="";if(window.document.Form_Guestbook.name.value=="")string+=v2;if(window.document.Form_Guestbook.text.value==""){if(string!="")string+=", ";string+=v3;}
if(string==""){window.document.Form_Guestbook.submit();}else{alert(v1+": "+string);}}
function AddSmilie(smile){window.document.Form_Guestbook.text.value+=smile;window.document.Form_Guestbook.text.focus();}
function SubmitContactForm(myform,values,markers,info,email){if(values){if(!info)info="Bitte alle Pflichtfelder ausfüllen!";val=values.split(";");nr=markers.split(",");empty_field=0;email_error=0;if(email&&document.forms[myform].elements['email']){if(CheckEmail(document.forms[myform].elements['email'].value)==0)email_error=1;}
for(i=0;i<val.length;i++){document.getElementById("formitem_"+nr[i]).style.color="inherit";if(document.forms[myform].elements[val[i]].value==""){empty_field=1;document.getElementById("formitem_"+nr[i]).style.color="red";}}
if(empty_field){alert(info);}else if(email_error){document.getElementById("formitem_"+email).style.color="red";alert("Bitte E-Mail Adresse prüfen!");}else{document.forms[myform].submit();}}else{document.forms[myform].submit();}}
function GetImage(box,img,w,h){innerbox=box+'_inner';imgid=box+'img';$(box).update('<div id="'+innerbox+'" style="height:'+h+'px; "> </div>');$(box).innerHTML;$(innerbox).update('<img id="'+imgid+'" src="'+img+'" width="'+w+'" height="'+h+'" style="display:none" />');$(innerbox).innerHTML;new Effect.Appear(imgid,{duration:1.0});}
function ChangePrice(id,value){prop_price=0.00;prop_ship=0.00;parseFloat(prop_price);parseFloat(prop_ship);for(i=1;i<=5;i++){if(document.getElementById(id+'prop'+i)){str=document.getElementById(id+'prop'+i).value;if(str.match('_#_')){arr=str.split('_#_');priceadd=arr[1];prop_price+=parseFloat(priceadd);prop_ship+=parseFloat(arr[2]);}}}
oldprice=document.forms['shopitem'+id].baseprice.value;newprice=parseFloat(oldprice)+parseFloat(prop_price);newprice=newprice.toFixed(2);oldship=document.forms['shopitem'+id].baseshipping.value;newship=parseFloat(oldship)+parseFloat(prop_ship);newship=newship.toFixed(2);document.forms['shopitem'+id].price.value=newprice;document.getElementById('price_'+id).innerHTML=newprice.replace(/\./g,",");document.forms['shopitem'+id].shipping.value=newship;}
function CheckPaymentSubmit(){if(document.getElementById("pay128")!=null){if(document.getElementById("pay128").checked==true){document.form_payment.action='https://www.gemoney.at/genome/wkf/calc';}}
document.form_payment.submit();}
function SubmitMcTest(myform,values,info){if(values){if(!info)info="Bitte alle Fragen beantworten!";val=values.split(",");empty_field=0;for(i=0;i<val.length;i++){radio=document.forms[myform].elements['radio_'+val[i]];checked=0;for(j=0;j<radio.length;j++){if(radio[j].checked)checked=1;}
if(!checked){empty_field=1;document.getElementById("question_"+val[i]).style.color="red";}}
if(empty_field){alert(info);}else{document.forms[myform].submit();}}else{document.forms[myform].submit();}}
function CheckEmail(email){var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if(filter.test(email))return 1;else return 0;}