var isPageOwner=false;
try{var WTO=false,scroll=0;Event.observe(window,"click",function(){});function correctElementHeight(){var a=[],e=$$(".column");if(e.size()==0)e=$$(".grey");e.each(function(b){if(b.hasClassName("last")){a.push(b);equalHeight(a);a=[]}else a.push(b)})}function validate(a){var e=false,b="";a=a;var d=a.name,c=a.value;try{if(c!=null)c=c.strip()}catch(f){}if(d=="title"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Es muss ein Titel eingegeben werden"}if(d=="txtUsername"||
d=="username"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet der Benutzername?"}if(d=="txtPassword"||d=="pass"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet das Passwort?";pass=c}if(d=="txtPassword2"||d=="pass2"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet das Passwort?";if(c!=$("password").value)b+="Das Passwort unterscheidet sich..."}if(d=="profNewPass"){if(c.length>
45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet das Passwort?";if(c!=$("profNewPass2").value)b+="Die neuen Passw&ouml;rter unterscheiden sich..."}if(d=="value"){zeichenketten=c;reg_ex5=/^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(\,[0-9]{1,2})?$/;if(reg_ex5.test(zeichenketten)==false&&c!="")b+="Falscher Wert eingegeben "}if(d=="category")if(c==0||c=="0"||c==null)b+="Kategorie fehlt";if(d=="description")if(c==""||c==null)b+="Es muss eine Beschreibung eingegeben werden";if(d=="first"||
d=="userfirst"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet der Vorname?"}if(d=="email"){reg_ex5=/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/;reg_ex5.test(c)||(b+="Die Emailadresse ist falsch! ");if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet ihre Email-Adresse?"}if(d=="last"||d=="userlast"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Wie lautet der Nachname?"}if(d==
"capt")if(c==""||c==null)b+="Bitte das Bild abtippen";if(d=="street"||d=="userstreet"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(c==""||c==null)b+="Bitte Strasse eingeben"}if(d=="txtEmail")if(c==""||c==null)b+="Bitte Email-Adresse eingeben";if(d=="plz"||d=="userplz"){reg_ex5=/\d{5}/;if(c.length>5)b+="Bitte weniger als 5 Zeichen eingeben ";reg_ex5.test(c)||(b+="Falsche PLZ eingegeben. ");if(c==""||c==null)b+="Bitte PLZ eingeben"}if(d=="city"||d=="usercity"){if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";
if(c==""||c==null)b+="Bitte Ort eingeben"}if(d=="icq")if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(d=="aim")if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(d=="msn")if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(d=="skype")if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(d=="homepage")if(c.length>45)b+="Bitte weniger als 45 Zeichen eingeben ";if(d=="books")if(c.length>255)b+="Bitte weniger als 255 Zeichen eingeben ";if(d=="movies")if(c.length>
255)b+="Bitte weniger als 255 Zeichen eingeben ";if(d=="music")if(c.length>255)b+="Bitte weniger als 255 Zeichen eingeben ";if(d=="agb")a.checked||(b+="Bitte zustimmen");if(d=="name")a.checked||(b+="Bitte zustimmen");if(b!=""){e=true;document.getElementById("error_"+d)==null&&a.insert({before:'<p class="error" id="error_'+d+'">'+b+"</p>"})}else document.getElementById("error_"+d)!=null&&document.getElementById("error_"+d).remove();return e}function profPass(){var a="profile_personal_update.jsp",e=
$("passform").serialize();a=new Ajax.Request(a,{method:"get",parameters:e,onComplete:function(b){if(b.responseText.match(1)){alert("Neues Passwort erfolgreich gesetzt!");Element.toggle("passbox")}else alert("Ein Fehler ist aufgetreten, bitte versuchen Sie es erneut!")}})}function loadcat(){Element.show("subt1");Element.hide("subt2");Element.hide("subt3");var a="readcategories.jsp",e="no=2&id="+escape($F("category")),b="category2";a=new Ajax.Updater(b,a,{method:"get",parameters:e,onComplete:function(){typeof refresh_ad==
"function"&&refresh_ad()}})}function loadcat2(){Element.show("subt2");Element.hide("subt3");var a="readcategories.jsp",e="no=3&id="+escape($F("category2")),b="category3";a=new Ajax.Updater(b,a,{method:"get",parameters:e,onComplete:function(){typeof refresh_ad=="function"&&refresh_ad()}})}function loadcat3(){Element.show("subt3");var a="readcategories.jsp",e="no=4&id="+escape($F("category3")),b="category4";a=new Ajax.Updater(b,a,{method:"get",parameters:e,onComplete:function(){typeof refresh_ad=="function"&&
refresh_ad()}})}function loadcat4(){typeof refresh_ad=="function"&&refresh_ad()}var formWatcher=Class.create();formWatcher.prototype={initialize:function(a,e){this.options=Object.extend({onSubmit:true,onChange:true},e||{});this.form=$(a);this.options.onSubmit&&Event.observe(this.form,"submit",this.onSubmit.bind(this),false);this.options.onChange&&Event.observe(this.form,"submit",this.onChange.bind(this),false)},onSubmit:function(a){for(var e=0;e<this.form.length;e++)validate(this.form.elements[e])&&
Event.stop(a)},onChange:function(){validate(this.form)}};function item_load_3(a,e){a="id="+e+"&type=3&profile=1&next="+a;a=new Ajax.Updater("myItems","module/item.jsp",{onComplete:function(){},method:"post",postBody:a,asynchronous:true})}function item_load_2(a,e){a="id="+e+"&type=2&profile=1&next="+a;a=new Ajax.Updater("myInterests","module/item.jsp",{onComplete:function(){$("myInterests").scrollTop=0;Element.toggle("loading");return false},method:"post",postBody:a,asynchronous:true})}function item_load_1(a,
e){a="id="+e+"&type=1&profile=1&next="+a;a=new Ajax.Updater("myItems","module/item.jsp",{onComplete:function(){},method:"post",postBody:a,asynchronous:true})}function friend_load(a,e,b){Element.toggle("loading");a="id="+e+"&type="+b+"&next="+a;a=new Ajax.Updater("myFriends","module/friend.jsp",{onComplete:function(){Element.toggle("loading");return false},method:"post",postBody:a,asynchronous:true});return false}function calc_distance(a,e){try{var b=userLon/180*Math.PI,d=userLat/180*Math.PI;a=a/180*
Math.PI;e=e/180*Math.PI;a=a-b;b=e-d;var c=Math.sin(b/2)*Math.sin(b/2)+Math.cos(d)*Math.cos(e)*Math.sin(a/2)*Math.sin(a/2),f=2*Math.asin(Math.min(1,Math.sqrt(c)));f=Math.round(f*6378.137);document.write(f+" km")}catch(g){document.write("Es ist ein Fehler aufgetreten. Ist ihre PLZ wirklich korrekt eingegeben?")}return false}var start=0;function editor(a,e){var b="",d="";switch(e){case 1:b="[b]";d="[/b]";break;case 2:b="[i]";d="[/i]";break;case 3:b="[u]";d="[/u]";break;case 4:b="[del]";d="[/del]";break;
case 5:b="[sub]";d="[/sub]";break;case 6:b="[sup]";d="[/sup]";break}a=$(a);if(document.selection){a.focus();sel=document.selection.createRange();sel.text=b+sel.text+d}else if(a.selectionStart||a.selectionStart=="0"){e=a.selectionStart;var c=a.selectionEnd;a.value=a.value.substring(0,e)+b+a.value.substring(e,c)+d+a.value.substring(c,a.value.length)}else a.value+=myValue}function write_msg(a){var e=Form.serialize("message_form_"+a)+"&type=2";Form.reset("message_form_"+a);new Ajax.Request("profile_message_update.jsp",
{method:"post",postBody:e,asynchronous:true,onComplete:function(){alert("Nachricht gesendet!")}});return false}function msg_open(){Element.toggle("msgcenter");fixSelect();if(start=="0"){var a="next=0&type=0",e="next=0&type=1";Element.toggle("msgload");a=new Ajax.Updater("msgcenter_div0","module/msg_center.jsp",{onComplete:function(){new Ajax.Updater("msgcenter_div1","module/msg_center.jsp",{onComplete:function(){checkTextarea();Element.toggle("msgload");return false},method:"post",postBody:e,asynchronous:true});
return false},method:"post",postBody:a,asynchronous:true});start=1}return false}function msg_reader(){var a="next=0&type=0",e="next=0&type=1";Element.toggle("msgload");a=new Ajax.Updater("msgcenter_div0","module/msg_center.jsp",{onComplete:function(){new Ajax.Updater("msgcenter_div1","module/msg_center.jsp",{onComplete:function(){checkTextarea();Element.toggle("msgload");return false},method:"post",postBody:e,asynchronous:true});return false},method:"post",postBody:a,asynchronous:true});return false}
function msg_marker(a){var e="id="+a;if($("msg_info_"+a).hasClassName("read")==false)e=new Ajax.Request("markmessages.jsp",{asynchronous:true,postBody:e,onComplete:function(){$("msg_info_"+a).addClassName("read")}});return false}function msg_next(a,e){checkTextarea();a="next="+a+"&type="+e;a=new Ajax.Updater("msgcenter_div"+e,"module/msg_center.jsp",{onComplete:function(){$("msgcenter_div"+e).scrollTop=0;Element.toggle("msgload");return false},method:"post",postBody:a,asynchronous:true});return false}
function msg_center_delete(a){if(confirm("Nachricht entfernen?")){var e=new Ajax.Request("module/msg_center_edit.jsp",{method:"post",postBody:"messageId="+a,onComplete:function(){var b="next=0";b=new Ajax.Updater("msgcenter_div","module/msg_center.jsp",{onComplete:function(){Element.toggle("msg_content_"+a);Element.toggle("msgload");return false},method:"post",postBody:b,asynchronous:true});return false}});return false}else Element.toggle("msgload")}function add_friend(a,e){a="id="+a+"&type="+e;Element.toggle("loading");
a=new Ajax.Updater("profile_friend_add","profile_add_friends.jsp",{onComplete:function(){msg_reader();Element.toggle("loading");Element.toggle("msgload");msg_next(0);new Effect.Highlight("msgcenter_div");return false},method:"post",postBody:a,asynchronous:true});return false}function remove_friend(a,e){a="id="+a+"&type="+e;Element.toggle("loading");a=new Ajax.Request("profile_remove_friends.jsp",{onComplete:function(){msg_reader();Element.toggle("loading");Element.toggle(this);Element.toggle("msgload");
msg_next(0);new Effect.Highlight("msgcenter_div");return false},method:"post",postBody:a,asynchronous:true});return false}function checkTextarea(){Element.getElementsBySelector("textarea").each(function(a){var e=a.readAttribute("id");if(e!=null&&a.hasClassName("txtedit")==false){e='<input type="button" accesskey="b" name="addcode1" value="  " style="background:#fff url(images/icons/text_bold.png) no-repeat center;" onClick="editor(\''+e+'\',1);"/><input type="button" accesskey="i" name="addcode2" value="  " style="background:#fff url(images/icons/text_italic.png) no-repeat center;"  onClick="editor(\''+
e+'\',2)"/><input type="button" accesskey="u" name="addcode3" value="  " style="background:#fff url(images/icons/text_underline.png) no-repeat center;"  onClick="editor(\''+e+'\',3)"/><input type="button" accesskey="d" name="addcode4" value="  " style="background:#fff url(images/icons/text_strikethrough.png) no-repeat center;"  onClick="editor(\''+e+"',4)\"/><br/>";a.addClassName("txtedit");a.insert({before:e})}})}function help_open(){var a="faq2.jsp",e="help_faq";a=new Ajax.Updater(e,a,{method:"get"})}
function checkforms(){checkTextarea();for(var a=0;a<document.forms.length;a++){new formWatcher(document.forms[a],{onSubmit:true});for(var e=0;e<document.forms[a].elements.length;e++)new formWatcher(document.forms[a].elements[e],{onChange:true})}a=$("container").getElementsBySelector(".inplace_input");a.length>0&&a.each(function(b){b.id!=""&&b.id.startsWith("profile_about_")&&new Ajax.InPlaceEditor(b,"profile_personal_update.jsp",{paramName:b.id.gsub("profile_about_","").gsub("-inplaceeditor",""),
onFormCustomization:function(d,c){new formWatcher(c,{onSubmit:true})}});b.id!=""&&b.id.startsWith("item_descr_")&&new Ajax.InPlaceEditor(b,"module/item_edit.jsp",{Size:200,rows:15,cols:40,paramName:"text",onEnterEditMode:function(d){$("item_"+d.element.id.gsub("item_descr_","")).setStyle({height:"250px"});var c=new Ajax.Request("module/item_edit.jsp",{method:"post",asynchronous:true,postBody:"type=1&editorId="+d.element.id,onComplete:function(f){$(d.element.id+"-inplaceeditor").down().value=f.responseText.strip()}})},
onLeaveEditMode:function(d){$("item_"+d.element.id.gsub("item_descr_","")).setStyle({height:"85px"});var c=new Ajax.Request("module/item_edit.jsp",{method:"post",asynchronous:true,postBody:"type=2&editorId="+d.element.id,onComplete:function(f){$(d.element.id+"-inplaceeditor").down().value=f.responseText.strip()}})},onComplete:function(d,c){c.innerHTML=c.innerHTML.strip().substring(0,100)},onFormCustomization:function(d,c){new formWatcher(c,{onSubmit:true});for(d=0;d<c.elements.length;d++)new formWatcher(c.elements[d],
{onChange:true})}})});a=$("container").getElementsBySelector(".inplace_text");a.length>0&&a.each(function(b){b.id!=""&&b.id.startsWith("profile_about_")&&new Ajax.InPlaceEditor(b,"profile_personal_update.jsp",{rows:15,cols:15,paramName:b.id.gsub("profile_about_","").gsub("-inplaceeditor",""),onFormCustomization:function(d,c){new formWatcher(c,{onSubmit:true});for(d=0;d<c.elements.length;d++)new formWatcher(c.elements[d],{onChange:true})}});b.id!=""&&b.id.startsWith("info_")&&new Ajax.InPlaceEditor(b,
"module/messageboard_edit.jsp",{rows:15,cols:40,paramName:"text",onEnterEditMode:function(d){var c=new Ajax.Request("module/messageboard_edit.jsp",{method:"post",asynchronous:true,postBody:"type=1&editorId="+d.element.id,onComplete:function(f){$(d.element.id+"-inplaceeditor").down().value=f.responseText.strip()}})},onLeaveEditMode:function(d){var c=new Ajax.Request("module/messageboard_edit.jsp",{method:"post",asynchronous:true,postBody:"type=2&editorId="+d.element.id,onComplete:function(f){$(d.element.id+
"-inplaceeditor").down().value=f.responseText.strip()}})},onComplete:function(d,c){c.innerHTML=c.innerHTML.strip()},onFormCustomization:function(d,c){new formWatcher(c,{onSubmit:true});for(d=0;d<c.elements.length;d++)new formWatcher(c.elements[d],{onChange:true})}})});return false}function makedraggable(){var a=$("container").getElementsBySelector("drag");a.each(function(e){new Draggable(e,{handle:"handle",starteffect:null,endeffect:null})});return false}var Reflector={reflect:function(a,e){a=$(a);
options=$H({amount:1/3,opacity:1/3}).merge(e||{});var b=a.parentNode,d=a.nextSibling,c=1/(a.height*options.amount);(a.height*options.amount).times(function(f){var g=Builder.node("div",{style:"height:1px;overflow:hidden"},[Builder.node("img",{src:a.src,style:"margin-top:-"+(a.height-f-1)+"px"})]);b.insertBefore(g,d);$(g).setOpacity((1-c*f)*options.opacity)})}};function insert_tag(a){a=new Ajax.Updater("tags","module/tag.jsp",{onload:$("tags").update("Lade..."),method:"post",parameters:a})}function fixSelect(){if(Prototype.Browser.IE){var a=
false,e=Element.getElementsBySelector("body","select"),b=$("container").getElementsBySelector("window");b.each(function(d){if(d.visible())a=true});a==false&&e.each(function(d){d.show()})}}}catch(e$$5){};
