function getXMLHTTP(){var a=false;try{a=new XMLHttpRequest}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){a=false}}}return a}function getAccessory(a){a="http://"+location.hostname+"/modules/findaccessory.php?model="+a;var b=getXMLHTTP();if(b){b.onreadystatechange=function(){if(b.readyState==4)document.getElementById("accessorycontent").innerHTML=b.responseText};b.open("GET",a,true);b.send(null)}} function showHide(a){if(document.getElementById(a))if(document.getElementById(a+"-show").style.display!="none"){document.getElementById(a+"-show").style.display="none";document.getElementById(a).style.display="block"}else{document.getElementById(a+"-show").style.display="inline";document.getElementById(a).style.display="none"}}var msgError="",hasj={},formDebug=false; function isNull(a){if(typeof a=="undefined")return true;if(a===null)return true;if(a=="")return true;if(a==0)return true;return false}function ifNull(a,b){if(isNull(a)===true)return b;return a}function getCSSobj(a,b){var c={};for(i in a)c[i]=$(b).css(i);return c} function setBorder(a,b){var c={"background-color":"rgb(255, 150, 150)",color:"maroon","border-width":"1px","border-style":"solid","border-color":"red"},d=a.id;if(isNull(d)===true)msgError+="DEVELOPER ALERT: your element ["+ifNull(a.name,"??")+"] has not got an ID\n";if(/checkbox/.test(a.type)===true)a=$(a).parent().get(0);if(b===true){if(isNull(hasj[d])===false){$(a).css(hasj[d]);delete hasj[d]}}else{if(isNull(hasj[d])===true)hasj[d]=getCSSobj(c,a);$(a).css(c)}} function chPassword(a){var b=0,c=true;$(a).find(":password").each(function(d){if(isNull(this.value)===true)c=false;else{if(b==0)b=this.value;else if(b!==this.value){msgError="Passwords do not match!\n";c=false;return}if(/^([a-z]+|[A-Z]+|\d+|\s+)$/.test(this.value)||this.value.length<5){msgError="Password too simple..";c=false}}});return c} function chValue(a){var b="";b=/checkbox/.test(a.type)?a.checked===true?1:null:a.value;if(isNull(b)===true&&isNull($(a).attr("allownull"))===true){setBorder(a,false);if(formDebug===true)msgError+=a.name+" = empty\n";if(isNull($(a).attr("errortext"))===false)msgError+=$(a).attr("errortext")+"\n";return false}else{setBorder(a,true);return true}} function chForm(a,b){if(b===true)formDebug=true;var c=true;isNull(a);var d=ifNull($(a).find(":password").length,0);$(a).find(":input").each(function(f){if(/password|hidden|submit|button/.test(this.type)===false)if(chValue(this)===false)c=false;if(d==1&&/password/.test(this.type)===true)if(chValue(this)===false)c=false});if(d>1){var e=chPassword(a);if(e===false)c=false;$(a).find(":password").each(function(f){setBorder(this,e)})}if(msgError&&!c){alert(msgError);msgError=""}return c};