function change_site(a,b,c,d,e,f){tavern_chat&&tavern_chat.stop();pe&&window.clearInterval(pe);UnTip();new Ajax.Updater("main_content",a,{method:"post",parameters:f,evalScripts:!0});$("global_site").value=a}
function do_register(){var a=Form.serialize("form_register");$("username").value==""||$("password1").value==""||$("password2").value==""||$("email").value==""?showDialog("Fehlende Angaben","Es sind nicht alle Pflichtfelder ausgef\u00fcllt!","error","fade","fade","none"):$("betakey")&&$("betakey").value==""?showDialog("Beta-Key fehlt","Du musst einen Beta-Key eingeben!","error","fade","fade","none"):new Ajax.Request("ajax/set_register.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},
onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request. (do_register)\n\n"+c);return!0}})}function save_profile(){var a=Form.serialize("form_profile");new Ajax.Request("ajax/set_profile.php",{method:"post",parameters:a,asynchronous:!0,onComplete:eval_request})}function test_graphicpack(){var a=$("user_gp_path").value;$("gp_graphic").innerHTML="<img src='"+a+"/images/misc/status_active.png'>"}
function change_view_npc(a,b){if(a!=$("npc_view").value||b==1)if($("npc_view").value=a,$("npc_window").update('<img src="images/misc/ajax-loader.gif">'),a==1)$("npc_header").innerHTML="Gespr\u00e4ch",new Ajax.Updater("npc_window","ajax/get_npc.php",{asynchronous:!0,evalScripts:!0,onComplete:function(a){$("npc_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.(change_view_npc-1)\n\n"+b);return!0}});else if(a==2){var c="view=2";
$("npc_header").innerHTML="Verkaufen";new Ajax.Updater("npc_window","ajax/get_npc_trade.php",{method:"post",parameters:c,asynchronous:!0,evalScripts:!0,onComplete:function(a){$("npc_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.(change_view_npc-2)\n\n"+b);return!0}})}else if(a==3)c="view=3",$("npc_header").innerHTML="Kaufen",new Ajax.Updater("npc_window","ajax/get_npc_trade.php",{method:"post",parameters:c,asynchronous:!0,
evalScripts:!0,onComplete:function(a){$("npc_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.(change_view_npc-3)\n\n"+b);return!0}})}
function npc_trade(a,b){var c=1;if($("item_amount_box_"+b))c=$("item_amount_box_"+b).value;new Ajax.Request("ajax/set_npc_trade.php",{method:"post",parameters:"action="+a+"&item_id="+b+"&amount="+c,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request. (npc_trade)\n\n"+b);return!0}})}
function set_event(a,b){new Ajax.Request("ajax/set_npc_quest.php",{method:"post",parameters:"action="+a+"&event="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request. (set_event)\n\n"+b);return!0}})}
function load_map(a){$("loader").update('<img src="images/misc/ajax-loader.gif">');a==0?new Ajax.Updater("map_window","ajax/get_map.php",{method:"post",evalScripts:!0,asynchronous:!0,onSuccess:function(){$("loader").update("")},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}}):a==1&&(msec=500,new Effect.Fade($("map_window"),{duration:0.2}),window.setTimeout("new Ajax.Updater('map_window', 'ajax/get_map.php',{ onComplete:function(){ new Effect.Appear('map_window'); },asynchronous:true, evalScripts:true});",
msec))}function send_map(a){$("timer_navigation").value==0?(a="dir="+a,$("info_box_object").innerHTML="",navbutton_stat("all",3),$("loader").update('<img src="images/misc/ajax-loader.gif">'),new Ajax.Request("ajax/set_map.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText);$("loader").update("")},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request (send_map)\n\n"+c);return!0}})):alert("Haha")}
function calc_map(a,b,c,d){var e=0,f=0;$("user_map_x").update(a);$("user_map_y").update(b);e=Math.round(180/c*a)+1;f=Math.round(180/d*b)+1;$("player_pos").style.left=""+e+"px";$("player_pos").style.top=""+f+"px"}var pe;
function countdown_show(a){if(a==1){text2=$("timer_navigation").value!=1?"Du kannst in "+(($("timer_navigation").value-1)/60>=1?Math.floor(($("timer_navigation").value-1)/60)+" Minuten und ":"")+($("timer_navigation").value-1)%60+" Sekunden weiterreisen":"";if($("global_site").value=="grimlords_world.php")$("timer_navigation_show").innerHTML=text2;$("timer_navigation").value--;$("timer_navigation").value<=0&&(window.clearInterval(pe),$("global_site").value=="grimlords_world.php"&&navbutton_stat("all",
2))}if(a==2||a==3)$("timer_navigation").value!=0&&($("action_progbar").getWidth(),$("action_progbar_wrapper").getWidth(),$("action_progbar").getWidth(),$("timer_navigation")),$("timer_navigation").value--,$("timer_navigation").value<=0&&(window.clearInterval(pe),a==2&&work(),a==3&&view());if(a==4)$("camp_hp").value>0?($("camp_hp").value--,time_left_hp=$("camp_hp").value,hours_hp=Math.floor(time_left_hp/3600),time_left_hp%=3600,minutes_hp=Math.floor(time_left_hp/60),time_left_hp%=60,seconds_hp=time_left_hp,
text_hp="<b>"+hours_hp+"</b> Stunden <b>"+minutes_hp+"</b> Minuten <b>"+seconds_hp+"</b> Sekunden",$("camp_hp").value==0?update_bar("camp_hp",3,parseInt($("bar_value_max_camp_hp").innerHTML)):(a=parseInt($("user_hp").value)+parseInt($("bar_value_max_camp_hp").innerHTML)/100*(parseInt($("camp_duration").value)/108),update_bar("camp_hp",3,Math.floor(a)))):text_hp="Vollst\u00e4ndig erholt",$("camp_mana").value>0?($("camp_mana").value--,time_left_mana=$("camp_mana").value,hours_mana=Math.floor(time_left_mana/
3600),time_left_mana%=3600,minutes_mana=Math.floor(time_left_mana/60),time_left_mana%=60,seconds_mana=time_left_mana,text_mana="<b>"+hours_mana+"</b> Stunden <b>"+minutes_mana+"</b> Minuten <b>"+seconds_mana+"</b> Sekunden",$("camp_mana").value==0?update_bar("camp_mana",3,parseInt($("bar_value_max_camp_mana").innerHTML)):(a=parseInt($("user_mana").value)+parseInt($("bar_value_max_camp_mana").innerHTML)/100*(parseInt($("camp_duration").value)/72),update_bar("camp_mana",3,Math.floor(a)))):text_mana=
"Vollst\u00e4ndig erholt",$("camp_au").value>0?($("camp_au").value--,time_left_au=$("camp_au").value,hours_au=Math.floor(time_left_au/3600),time_left_au%=3600,minutes_au=Math.floor(time_left_au/60),time_left_au%=60,seconds_au=time_left_au,text_au="</b> <b>"+hours_au+"</b> Stunden <b>"+minutes_au+"</b> Minuten <b>"+seconds_au+"</b> Sekunden",$("camp_au").value==0?update_bar("camp_au",3,parseInt($("bar_value_max_camp_au").innerHTML)):(a=parseInt($("user_au").value)+parseInt($("bar_value_max_camp_au").innerHTML)/
100*(parseInt($("camp_duration").value)/36),update_bar("camp_au",3,Math.floor(a)))):text_au="Vollst\u00e4ndig erholt",$("camp_time_min").value>0?($("camp_time_min").value--,time_left_min=$("camp_time_min").value,hours_min=Math.floor(time_left_min/3600),time_left_min%=3600,minutes_min=Math.floor(time_left_min/60),time_left_min%=60,seconds_min=time_left_min,text_min="<b>"+hours_min+"</b> Stunden <b>"+minutes_min+"</b> Minuten <b>"+seconds_min+"</b> Sekunden"):(text_min="Zeit ist abgelaufen",$("camp_button").innerHTML=
'<a class="buttonhover_fireoff" href="javascript: void(0);" onclick="camp(0);"></a>'),$("hp_duration_text").innerHTML=text_hp,$("mana_duration_text").innerHTML=text_mana,$("au_duration_text").innerHTML=text_au,$("camp_text").innerHTML=text_min,$("camp_duration").value=parseInt($("camp_duration").value)+1}
function countdown(a){if(a==1)$("north").hide(),$("north_east").hide(),$("north_west").hide(),$("east").hide(),$("south").hide(),$("south_east").hide(),$("south_west").hide(),$("west").hide(),$("action_window").hide(),window.clearInterval(pe),$("timer_navigation_show").innerHTML="Du kannst in "+($("timer_navigation").value/60>=1?Math.floor($("timer_navigation").value/60)+" Minuten und ":"")+$("timer_navigation").value%60+" Sekunden weiterreisen",pe=window.setInterval("countdown_show(1)",1E3);if(a==
2||a==3)window.clearInterval(pe),pe=window.setInterval("countdown_show("+a+")",1E3);a==4&&(window.clearInterval(pe),countdown_show(a),pe=window.setInterval("countdown_show("+a+")",1E3))}
function countdown_craft(){window.clearInterval(pe);time_left_craft=$("timer_recipe").value;hours_craft=Math.floor(time_left_craft/3600);time_left_craft%=3600;minutes_craft=Math.floor(time_left_craft/60);time_left_craft%=60;seconds_craft=time_left_craft;text_craft="<b>"+hours_craft+"</b> Stunden <b>"+minutes_craft+"</b> Minuten <b>"+seconds_craft+"</b> Sekunden";$("progbar_time").innerHTML=text_craft;pe=window.setInterval("countdown_craft_show()",1E3)}
function countdown_craft_show(){if($("timer_recipe").value>0&&($("timer_recipe").value--,time_left_craft=$("timer_recipe").value,hours_craft=Math.floor(time_left_craft/3600),time_left_craft%=3600,minutes_craft=Math.floor(time_left_craft/60),time_left_craft%=60,seconds_craft=time_left_craft,text_craft="<b>"+hours_craft+"</b> Stunden <b>"+minutes_craft+"</b> Minuten <b>"+seconds_craft+"</b> Sekunden",$("progbar_time").innerHTML=text_craft,$("timer_recipe").value<=0))window.clearInterval(pe),$("action_text").innerHTML=
'<a href="javascript: void(0);" class="buttonhover_finish" onclick="$(this).hide(); craft_item(2, 0);"></a>',params="recipe_id=0&mode=2&skill_head_id=0",$("recipe_list").update('<img src="images/misc/ajax-loader.gif">'),new Ajax.Updater("recipe_list","ajax/get_crafting.php",{method:"post",parameters:params,evalScripts:!0,asynchronous:!0,onSuccess:function(){$("recipe_list").update("")},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function start_action(a){var b="type="+a;$("bar_value_user_au").innerHTML>0?($("north").hide(),$("north_east").hide(),$("north_west").hide(),$("east").hide(),$("south").hide(),$("south_east").hide(),$("south_west").hide(),$("west").hide(),$("action_window").hide(),a==1?new Ajax.Request("ajax/set_action.php",{method:"post",parameters:b,asynchronous:!0,onComplete:after_action_view}):(a==2||a==3||a==4||a==5||a==6||a==7)&&new Ajax.Request("ajax/set_action.php",{method:"post",parameters:b,asynchronous:!0,
onComplete:after_action_work})):showDialog("Ausdauerpunkte","Du hast nicht genug Ausdauerpunkte um diese Aktion durchzuf\u00fchren","info","fade","fade","none")}
function update_bar(a,b,c){var d="bar_fill_"+a,e="bar_back_"+a,f="bar_value_"+a,a="bar_value_max_"+a;if(b==1)$(d).style.width=(parseInt($(f).innerHTML)+c)/parseInt($(a).innerHTML)*$(e).getWidth()+"px",$(f).update(parseInt($(f).innerHTML)+c);if(b==2)$(d).style.width=(parseInt($(f).innerHTML)-c)/parseInt($(a).innerHTML)*$(e).getWidth()+"px",$(f).update(parseInt($(f).innerHTML)-c);if(b==3)$(d).style.width=parseInt(c)/parseInt($(a).innerHTML)*$(e).getWidth()+"px",$(f).update(c)}
function s_t(a,b,c){$("tile_"+a).style.backgroundPosition=""+b+"px "+c+"px"}
function c_o(a,b,c,d,e){if(a==1)var f="object",g="images/objects/",h=2;a==2&&(f="npc",g="images/graphic/npc/",h=3);a=Element("div",{id:""+f+"_"+b+"","class":"layer_1",style:"height:"+d+"px; width:"+e+"px; border: 0px dotted yellow; background-repeat:no-repeat; background-position: bottom;  background-image: url("+g+c+"); position: absolute; z-index: "+b+""});$("map_window_rel").appendChild(a);set_position(""+f+"_"+b+"",b,h)}
function c_m(a,b,c){b=Element("div",{id:"monster_"+a+"","class":"layer_1",style:"height:100px; width:100px; border: 0px dotted yellow; background-position: "+c+"px 0px; background-image: url(images/graphic/monster/"+b+"); position: absolute; z-index: "+a+""});$("map_window_rel").appendChild(b);set_position("monster_"+a+"",a,4)}
function set_position(a,b,c){var d=0,e=0;b==0&&(e=d=0);b==1&&(d=-64,e=32);b==2&&(d=-128,e=64);b==3&&(d=-192,e=96);b==4&&(d=-256,e=128);b==5&&(d=64,e=32);b==6&&(d=0,e=64);b==7&&(d=-64,e=96);b==8&&(d=-128,e=128);b==9&&(d=-192,e=160);b==10&&(d=128,e=64);b==11&&(d=64,e=96);b==12&&(d=0,e=128);b==13&&(d=-64,e=160);b==14&&(d=-128,e=192);b==15&&(d=192,e=96);b==16&&(e=d=128);b==17&&(d=64,e=160);b==18&&(d=0,e=192);b==19&&(d=-64,e=224);b==20&&(d=256,e=128);b==21&&(d=192,e=160);b==22&&(d=128,e=192);b==23&&(d=
64,e=224);b==24&&(d=0,e=256);c==1&&(d+=20,e-=50);c==2&&(d+=20,e-=100);c==3&&(d+=20,e-=50);c==4&&(d+=20,e-=50);$(a).style.left=""+d+"px";$(a).style.top=""+e+"px"}
function navbutton_stat(a,b){var c=0;if(b==1)return a=="north"?c=1:a=="north_east"?c=2:a=="east"?c=3:a=="south_east"?c=4:a=="south"?c=5:a=="south_west"?c=6:a=="west"?c=7:a=="north_west"&&(c=8),$(a).className="buttonhover_"+a,$(a).onclick=function(){send_map(c)},!0;else if(b==0)return $(a).className="buttonhover_"+a+"_disable",$(a).onclick=function(){},!0;else b==2?a=="all"&&($("north").show(),$("north_east").show(),$("north_west").show(),$("east").show(),$("south").show(),$("south_east").show(),$("south_west").show(),
$("west").show(),$("action_window").show()):b==3&&a=="all"&&($("north").hide(),$("north_east").hide(),$("north_west").hide(),$("east").hide(),$("south").hide(),$("south_east").hide(),$("south_west").hide(),$("west").hide(),$("action_window").hide())}
function take_item(a,b,c,d){a="type="+a+"&item_id="+b+"&item_number="+c+"&log_id="+d;$("item_take_"+b+"_"+c+"").onclick=function(){};new Ajax.Request("ajax/set_item.php",{method:"post",parameters:a,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request. (take_item)\n\n"+b);return!0}})}
function insert_battle(a){new Ajax.Request("ajax/set_battle_static.php",{method:"post",parameters:"monster_id="+a,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request. (insert_battle)\n\n"+c);return!0}})}function after_action_view(a){eval(a.responseText)}function view(){new Ajax.Updater("action_item","ajax/get_view.php",{asynchronous:!0,evalScripts:!0})}function after_action_work(a){eval(a.responseText)}
function work(){new Ajax.Updater("action_item","ajax/get_work.php",{asynchronous:!0,evalScripts:!0})}
function change_view_help(a){if(a!=$("help_view").value)$("help_view").value=a,$("help_window").update('<img src="images/misc/ajax-loader.gif">'),new Ajax.Updater("help_window","ajax/get_help.php",{asynchronous:!0,parameters:"topic="+a,onComplete:function(a){$("help_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}});else return!1}var animId;
function showAnim(a,b,c){$(c).style.backgroundPosition=-(a*100)+"px "+-(b*100)+"px"}function doRotateAnim(a,b){clearTimeout(animId);showAnim(a%8,0,""+b+"");var c=parseInt(a)+1;c>=9&&(c=1);animId=setTimeout("doRotateAnim('"+c+"','"+b+"');",200)}function stopRotateAnim(a){clearTimeout(animId);$(a).style.backgroundPosition="0px 0px"}
function change_view_pm(a){var b="folder="+a;if(a!=$("message_view").value){$("message_view").value=a;for(i=0;i<=4;i++)el_out($("msg_"+i));el_hover($("msg_"+a));$("message_window").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("message_window","ajax/get_message.php",{asynchronous:!0,parameters:b,onComplete:function(a){$("message_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}});
$("message_read").update("")}else return!1}function read_pm(a){a="msg_id="+a;$("message_read").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("message_read","ajax/get_message_read.php",{asynchronous:!0,parameters:a,evalScripts:!0,onComplete:function(a){$("message_read").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function action_pm(a,b){new Ajax.Request("ajax/set_message.php",{method:"post",parameters:"action="+a+"&msg_id="+b,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function reply_pm(a,b){var c="folder=0&msg_id="+a+"&msg_send="+b;$("message_window").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("message_window","ajax/get_message.php",{asynchronous:!0,parameters:c,onComplete:function(a){$("message_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function send_pm(){var a=Form.serialize("form_new_pm")+"&action=1";new Ajax.Request("ajax/set_message.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function save_pm_options(){var a=Form.serialize("form_options")+"&action=5";new Ajax.Request("ajax/set_message.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function change_view_equip(a,b){var c="view="+a;if(a!=$("item_view").value||b==1){$("item_view").value=a;$("items").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("items","ajax/get_inventory.php",{method:"post",parameters:c,asynchronous:!0,onComplete:function(a){$("items").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}});switch(a){case 1:$("item_cat").update("R\u00fcstung");break;case 2:$("item_cat").update("Waffen");
break;case 3:$("item_cat").update("Zauber");break;case 4:$("item_cat").update("Schmuck");break;case 5:$("item_cat").update("Nahrung");break;case 6:$("item_cat").update("Werkzeug");break;case 7:$("item_cat").update("Ressourcen");break;case 8:$("item_cat").update("Sonstiges")}return!0}else return!1}
function equip_item(a,b){var c="action=1&item_id="+a+"&primsec="+b;UnTip();new Ajax.Request("ajax/set_inv_equip.php",{method:"post",parameters:c,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function unequip_item(a,b){new Ajax.Request("ajax/set_inv_equip.php",{method:"post",parameters:"action=2&item_id="+a+"&primsec="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function trash_item(a,b,c){a="action=3&item_id="+a+"&item_parent_id="+b+"&item_stack="+c;UnTip();new Ajax.Request("ajax/set_inv_action.php",{method:"post",parameters:a,asynchronous:!0,evalScripts:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function check_trash(a,b,c){showConfirm("Wegwerfen","Willst du den Gegenstand wirklich wegwerfen?","fade","none","trash_item("+a+", "+b+", "+c+")")}function eat_item(a){a="action=4&item_id="+a;UnTip();new Ajax.Request("ajax/set_inv_action.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function learn_item(a){a="action=5&item_id="+a;UnTip();new Ajax.Request("ajax/set_inv_action.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function levelup(a){new Ajax.Request("ajax/set_inv_action.php",{method:"post",parameters:"action=6&attr="+a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function read_item(a){a="action=7&item_id="+a;UnTip();showRead("","fade","none");$("read").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Request("ajax/set_inv_action.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}function get_at(a,b,c){return Math.round((a+a+b+c)/5)}function get_pa(a,b,c,d){return Math.round((a+b+c+d)/5)}
function get_ms(a,b,c){return Math.round((a+a+b+c)/5)}function get_mr(a,b,c,d){return Math.round((a+b+c+d)/5)}function get_sr(a,b,c){return Math.round((a+a+b+c)/5)}function get_ini(a,b,c){return Math.round((a+a+b+c)/5)}
function calc_fight_values(){$("user_at").innerHTML=get_at(parseInt($("user_strength_complete").innerHTML),parseInt($("user_agility_complete").innerHTML),parseInt($("user_stage").innerHTML));$("user_pa").innerHTML=get_pa(parseInt($("user_intuition_complete").innerHTML),parseInt($("user_agility_complete").innerHTML),parseInt($("user_strength_complete").innerHTML),parseInt($("user_stage").innerHTML));$("user_ms").innerHTML=get_ms(parseInt($("user_brainpower_complete").innerHTML),parseInt($("user_charisma_complete").innerHTML),
parseInt($("user_stage").innerHTML));$("user_mr").innerHTML=get_mr(parseInt($("user_constitution_complete").innerHTML),parseInt($("user_brainpower_complete").innerHTML),parseInt($("user_charisma_complete").innerHTML),parseInt($("user_stage").innerHTML));$("user_sr").innerHTML=get_sr(parseInt($("user_constitution_complete").innerHTML),parseInt($("user_charisma_complete").innerHTML),parseInt($("user_stage").innerHTML));$("user_ini").innerHTML=get_ini(parseInt($("user_intuition_complete").innerHTML),
parseInt($("user_agility_complete").innerHTML),parseInt($("user_stage").innerHTML));return!0}
function update_attribute(a,b,c,d,e,f,g,h,l,m,k,n){g=a-g;h=b-h;l=c-l;m=d-m;k=e-k;n=f-n;$("user_strength_complete").update(""+a+"");update_attribute_color(g,"strength");$("user_agility_complete").update(""+b+"");update_attribute_color(h,"agility");$("user_intuition_complete").update(""+c+"");update_attribute_color(l,"intuition");$("user_brainpower_complete").update(""+d+"");update_attribute_color(m,"brainpower");$("user_charisma_complete").update(""+e+"");update_attribute_color(k,"charisma");$("user_constitution_complete").update(""+
f+"");update_attribute_color(n,"constitution")}function update_attribute_color(a,b){if(a<0)$("user_"+b+"_bonus").innerHTML='<span style="color: #B04453;">'+a+"</span>";else if(a>0)$("user_"+b+"_bonus").innerHTML='<span style="color: #65A13D;">+'+a+"</span>";else if(a==0)$("user_"+b+"_bonus").innerHTML='<span style="color: #FAECC5;">'+a+"</span>"}
function load_recipe(a,b,c){if(a!=$("recipe_select").value)params="recipe_id="+a+"&mode="+c+"&skill_head_id="+b,$("recipe_view").update('<img src="images/misc/ajax-loader.gif">'),$("recipe_select").value=a,new Ajax.Updater("recipe_view","ajax/get_crafting.php",{asynchronous:!0,parameters:params,onComplete:function(a){$("recipe_view").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function craft_item(a,b){new Ajax.Request("ajax/set_crafting.php",{method:"post",parameters:"craft_mode="+a+"&recipe_id="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function change_view_skill(a,b){var c="view="+a;if(a!=$("skill_view").value||b==1)$("skill_view").value=a,new Ajax.Updater("skill_window","ajax/get_skill.php",{method:"post",parameters:c,asynchronous:!0,onComplete:function(a){$("skill_window").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}});else return!1}
function save_skill(a,b){var c="skill="+a+"&type="+b;$("skillup_"+a+"").onclick=function(){};new Ajax.Request("ajax/set_skill.php",{method:"post",parameters:c,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.(save_skill)\n\n"+b);return!0}})}function eval_request_skill(a){eval(a.responseText);change_view_skill($("skill_view").value,1)}
function change_view_shop(a){var b="view="+a;if(a!=$("shop_view").value){$("shop_view").value=a;$("shop_window").update('<img src="images/misc/ajax-loader.gif">');if(a==1)$("shop_window_header").innerHTML="Kaufen";if(a==2)$("shop_window_header").innerHTML="Verkaufen";if(a==3)$("shop_window_header").innerHTML="Reparieren";new Ajax.Updater("shop_window","ajax/get_shop.php",{asynchronous:!0,parameters:b,evalScripts:!0,onComplete:function(a){$("shop_window").update(a.responseText)},onFailure:function(){show_request_failure()},
onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}}
function sell_item_shop(a){var b=1;if($("item_amount_box_"+a))b=$("item_amount_box_"+a).value;b>0&&b<=9?new Ajax.Request("ajax/set_shop.php",{method:"post",parameters:"action=2&item_id="+a+"&amount="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}}):showDialog("Ung\u00fcltige Anzahl","Es sind nur Werte zwischen 1 und 9 g\u00fcltig!","error","fade","fade","none")}
function repair_item_shop(a){new Ajax.Request("ajax/set_shop.php",{method:"post",parameters:"action=3&item_id="+a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function buy_item_shop(a){var b=$("item_amount_box_"+a).value;b>0&&b<=9?new Ajax.Request("ajax/set_shop.php",{method:"post",parameters:"action=1&item_id="+a+"&amount="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}}):showDialog("Ung\u00fcltige Anzahl","Es sind nur Werte zwischen 1 und 9 g\u00fcltig!","error","fade","fade","none")}
function calc_total_shop(a){$("item_gold_total_"+a).innerHTML=$("item_gold_"+a).value*$("item_amount_box_"+a).value;$("item_weight_total_"+a).innerHTML=$("item_weight_"+a).value*$("item_amount_box_"+a).value}function check_sell(a){if($("item_amount_box_"+a).value>parseInt($("item_amount_"+a).innerHTML))$("item_amount_box_"+a).value=$("item_amount_"+a).innerHTML;calc_total_shop(a)}
function portal(a,b){new Ajax.Request("ajax/set_portal.php",{method:"post",parameters:"action="+a+"&object_id="+b,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}var tavern_chat;function init_tavern(){tavern_chat=new Ajax.PeriodicalUpdater("tavern_chat","ajax/get_tavern.php",{method:"post",frequency:3,decay:1.5})}
function load_tavern_msg(){new Ajax.Updater("tavern_chat","ajax/get_tavern.php",{onComplete:function(a){$("tavern_chat").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}})}
function send_tavern_msg(){var a="msg="+encodeURIComponent($F("msg"));new Ajax.Request("ajax/set_tavern.php",{method:"post",parameters:a,asynchronous:!0,onSuccess:eval_request_tavern,onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}function eval_request_tavern(a){eval(a.responseText);$("msg").value="";$("count").innerHTML="<b>80</b>";load_tavern_msg()}
function check_tavern_msg(){var a=$("msg").value.length;if(a==1&&$("msg").value.substring(0,1)==" ")$("msg").value="",a=0;a>80?($("msg").value=$("msg").value.substring(0,80),CharsLeft=0):CharsLeft=80-a;$("count").innerHTML="<b>"+CharsLeft+"</b>"}
function camp(a){new Ajax.Request("ajax/set_camping.php",{method:"post",parameters:"mode="+a,asynchronous:!0,onSuccess:function(a){eval(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function change_view_journal(a){$("page_2").update("");$("page_1").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("page_1","ajax/"+a,{method:"post",asynchronous:!1,onComplete:function(a){$("page_1").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function detail_recipe(a){params="recipe_id="+a;$("page_2").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("page_2","ajax/get_recipe.php",{method:"post",parameters:params,evalScripts:!0,asynchronous:!1,onComplete:function(a){$("page_2").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function detail_quest(a){params="quest_id="+a;$("page_2").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("page_2","ajax/get_quest.php",{method:"post",parameters:params,evalScripts:!0,asynchronous:!1,onComplete:function(a){$("page_2").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function detail_monster(a){params="monster_id="+a;$("page_2").update('<img src="images/misc/ajax-loader.gif">');new Ajax.Updater("page_2","ajax/get_monster.php",{method:"post",parameters:params,asynchronous:!1,onComplete:function(a){$("page_2").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,c){alert("Fehler in Request.\n\n"+c);return!0}})}
function showDialog(a,b,c,d,e,f){c||(c="none");d||(d="none");e||(e="none");f||(f="none");var g,h,l,m,k;$("dialog")?(g=$("dialog"),h=$("dialog_title"),l=$("dialog_message"),m=$("dialog_action"),k=$("dialog_overlay"),k.show()):(g=new Element("div",{id:"dialog"}),h=new Element("div",{id:"dialog_title"}),l=new Element("div",{id:"dialog_message"}),m=new Element("a",{id:"dialog_action",style:"position: absolute; top: 180px; left: 120px;","class":"buttonhover_ok"}),k=new Element("div",{id:"dialog_overlay"}),
$("main_content").appendChild(g),$("main_content").appendChild(k),g.appendChild(h),g.appendChild(l),g.appendChild(m),d!="none"&&g.hide());switch(c){case "none":dialogImage="";break;case "info":dialogImage="<img src='images/misc/symbol_info.png' align='left'>";break;case "success":dialogImage="<img src='images/misc/symbol_success.png' align='left'>";break;case "warning":dialogImage="<img src='images/misc/symbol_warning.png' align='left'>";break;case "error":dialogImage="<img src='images/misc/symbol_error.png' align='left'>";
break;case "redirect":dialogImage="<img src='images/misc/symbol_info.png' align='left'>"}c=="redirect"?$("dialog_action").onclick=function(){change_site(""+f+"","","none")}:$("dialog_action").onclick=function(){hideDialog(e)};h.innerHTML=a;l.innerHTML=dialogImage+b;d=="none"?g.show():d=="fade"?new Effect.Appear(g,{duration:0.5}):d=="grow"&&new Effect.Grow(g,{duration:0.5})}
function hideDialog(a){a=="none"?($("dialog").hide(),$("dialog_overlay").hide()):a=="fade"?new Effect.Fade($("dialog"),{duration:0.5,afterFinish:function(){$("dialog_overlay").hide()}}):a=="blindup"?new Effect.BlindUp($("dialog"),{duration:0.5,afterFinish:function(){$("dialog_overlay").hide()}}):a=="fade_nav"&&new Effect.Fade($("dialog"),{duration:0.5,afterFinish:function(){$("dialog_overlay").hide();navbutton_stat("all",2)}})}
function showConfirm(a,b,c,d,e){c||(c="none");d||(d="none");e||(e="none");if($("confirm"))f=$("confirm"),g=$("confirm_title"),h=$("confirm_message"),l=$("confirm_action_yes"),m=$("confirm_action_no"),k=$("confirm_overlay"),k.show(),$("confirm_action_yes").onclick=function(){eval(""+e+"");hideConfirm(d)};else{var f=new Element("div",{id:"confirm"}),g=new Element("div",{id:"confirm_title"}),h=new Element("div",{id:"confirm_message"}),l=new Element("a",{id:"confirm_action_yes","class":"buttonhover_ja"}),
m=new Element("a",{id:"confirm_action_no","class":"buttonhover_nein"}),k=new Element("div",{id:"confirm_overlay"});$("main_content").appendChild(f);$("main_content").appendChild(k);f.appendChild(g);f.appendChild(h);f.appendChild(l);f.appendChild(m);c!="none"&&f.hide();$("confirm_action_yes").onclick=function(){eval(""+e+"");hideConfirm(d)};$("confirm_action_no").onclick=function(){hideConfirm(d)}}g.innerHTML=a;h.innerHTML=b;c=="none"?f.show():c=="fade"?new Effect.Appear(f,{duration:0.5}):c=="grow"&&
new Effect.Grow(f,{duration:0.5})}function showRead(a,b){if($("read"))c=$("read"),d=$("read_overlay"),d.show();else{var c=new Element("div",{id:"read"}),d=new Element("div",{id:"read_overlay"});$("main_content").appendChild(c);$("main_content").appendChild(d);c.onclick=function(){c.hide();$("read_overlay").hide()};b!="none"&&c.hide()}b=="none"?c.show():b=="fade"?new Effect.Appear(c,{duration:0.5}):b=="grow"&&new Effect.Grow(c,{duration:0.5})}
function hideConfirm(a){a=="none"?($("confirm").hide(),$("confirm_overlay").hide()):a=="fade"?new Effect.Fade($("confirm"),{duration:0.5,afterFinish:function(){$("confirm_overlay").hide()}}):a=="blindup"&&new Effect.BlindUp($("confirm"),{duration:0.5,afterFinish:function(){$("confirm_overlay").hide()}})}
function showAction(a,b,c){if($("action"))d=$("action"),n=$("action_overlay"),e=$("action_title"),f=$("action_content_wrapper"),g=$("action_content"),h=$("action_item"),l=$("action_progbar_wrapper"),m=$("action_progbar"),$("action_progbar").style.width="1px",h.update(""),k=$("action_action"),n.show(),c=="ok"&&k.hide();else{var d=new Element("div",{id:"action"}),e=new Element("div",{id:"action_title"}),f=new Element("div",{id:"action_content_wrapper"}),g=new Element("div",{id:"action_content"}),h=
new Element("div",{id:"action_item"}),l=new Element("div",{id:"action_progbar_wrapper"}),m=new Element("div",{id:"action_progbar"});if(c=="ok"){var k=new Element("a",{id:"action_action",style:"position: absolute; top: 270px; left: 140px; display: none;","class":"buttonhover_ok"});k.onclick=function(){hideAction("fade")}}if(c=="error")k=new Element("a",{id:"action_action",style:"position: absolute; top: 270px; left: 140px;","class":"buttonhover_ok"}),k.onclick=function(){hideAction("fade")};var n=
new Element("div",{id:"action_overlay"});$("main_content").appendChild(d);$("main_content").appendChild(n);d.appendChild(e);d.appendChild(f);f.appendChild(g);f.appendChild(h);d.appendChild(l);l.appendChild(m);d.appendChild(k)}a||(a="");e.innerHTML=""+a+"";g.innerHTML=""+b+"";new Effect.Appear(d,{duration:0.5})}
function hideAction(a){a=="none"?($("action").hide(),$("action_overlay").hide()):a=="fade"?new Effect.Fade($("action"),{duration:0.5,afterFinish:function(){$("action_overlay").hide()}}):a=="blindup"&&new Effect.BlindUp($("action"),{duration:0.5,afterFinish:function(){$("action_overlay").hide()}});navbutton_stat("all",2)}
function load_view(){new Ajax.Updater("content","ajax/get_create.php",{asynchronous:!0,evalScripts:!0,onComplete:function(a){$("content").update(a.responseText)},onFailure:function(){show_request_failure()},onException:function(a,b){alert("Fehler in Request.\n\n"+b);return!0}});return!0}
function slide_race(a){new Effect.Fade($("race_"+$("user_race").value),{duration:0.4,queue:"end",afterFinish:function(){new Effect.Appear($("race_"+$("user_race").value),{duration:0.4})}});$("user_race").value=parseInt($("user_race").value)+1;if($("user_race").value>a)$("user_race").value=1}
function slide_class(a){new Effect.Fade($("class_"+$("user_class").value),{duration:0.4,queue:"end",afterFinish:function(){new Effect.Appear($("class_"+$("user_class").value),{duration:0.4})}});$("user_class").value=parseInt($("user_class").value)+1;if($("user_class").value>a)$("user_class").value=1}
function finish_step_1(a,b,c,d){d="step=1&user_age="+a+"&user_sex="+b+"&user_ethos="+c+"&user_desc="+d;return b==0?(showDialog("Unvollst\u00e4ndig","W\u00e4hle ein <b>Geschlecht</b>!","error","fade","fade"),!1):c==0?(showDialog("Unvollst\u00e4ndig","W\u00e4hle eine <b>Gesinnung</b>!","error","fade","fade"),!1):a==""?(showDialog("Unvollst\u00e4ndig","Gib ein <b>Alter</b> an!","error","fade","fade"),!1):a<16||a>100?(showDialog("Ung\u00fcltig","Das Alter muss zwischen 16 und 100 Jahren liegen!","error",
"fade","fade"),!1):isNaN(a)?(showDialog("Ung\u00fcltig","Beim Alter sind nur <b>Zahlen</b> zul\u00e4ssig!","error","fade","fade"),!1):(new Effect.Move($("stepper"),{x:120,duration:0.1,mode:"relative"}),new Ajax.Request("ajax/set_create.php",{method:"post",parameters:d,asynchronous:!0,onComplete:eval_request_create}),!0)}
function finish_step_2(a){a="step=2&user_race="+a;new Effect.Move($("stepper"),{x:120,duration:0.1,mode:"relative"});new Ajax.Request("ajax/set_create.php",{method:"post",parameters:a,asynchronous:!0,onComplete:eval_request_create});return!0}function finish_step_3(a){a="step=3&user_class="+a;new Effect.Move($("stepper"),{x:120,duration:0.1,mode:"relative"});new Ajax.Request("ajax/set_create.php",{method:"post",parameters:a,asynchronous:!0,onComplete:eval_request_create});return!0}
function finish_step_4(a,b){var c="step=4&user_avatar="+a+"&user_graphic="+b;return a==0?(showDialog("Unvollst\u00e4ndig","W\u00e4hle einen Avatar !","error","fade","fade"),!1):b==0?(showDialog("Unvollst\u00e4ndig","W\u00e4hle eine Spielfigur !","error","fade","fade"),!1):(new Effect.Move($("stepper"),{x:120,duration:0.1,mode:"relative"}),new Ajax.Request("ajax/set_create.php",{method:"post",parameters:c,asynchronous:!0,onComplete:eval_request_create}),!0)}
function finish_step_5(a,b,c,d,e,f,g,h,l,m,k,n,o,q,r,s,t,u,v){b="step=5&points="+a+"&hp_points="+b+"&mana_points="+c+"&au_points="+d+"&strength_points="+e+"&agility_points="+f+"&brainpower_points="+g+"&constitution_points="+h+"&charisma_points="+l+"&intuition_points="+m+"&user_hp="+k+"&user_mana="+n+"&user_au="+o+"&user_strength="+q+"&user_agility="+r+"&user_brainpower="+s+"&user_constitution="+t+"&user_charisma="+u+"&user_intuition="+v;if(a!=0)showDialog("Unvollst\u00e4ndig","Es sind noch nicht alle Punkte vergeben !",
"error","fade","fade");else return new Effect.Move($("stepper"),{x:120,duration:0.1,mode:"relative"}),new Ajax.Request("ajax/set_create.php",{method:"post",parameters:b,asynchronous:!0,onComplete:eval_request_create}),!0}function finish_create(){new Ajax.Request("ajax/set_create.php",{method:"post",parameters:"step=6",asynchronous:!0,onComplete:function(){change_site("grimlords_world.php","","fade")}});return!0}
function step_back(){new Effect.Move($("stepper"),{x:-120,duration:0.1,mode:"relative"});new Ajax.Request("ajax/set_create.php",{method:"post",parameters:"step=9",asynchronous:!0,onComplete:eval_request_create});return!0}function eval_request_create(a){load_view();eval(a.responseText)}
function plus(a,b){$(b+"_minus").innerHTML="<a href='javascript:void(0)' onclick='minus(\""+b+'_minus","'+b+"\")' class='buttonhover_minus'></a>";if($("points").value>0){if($(b+"_points").value=parseInt($(b+"_points").value)+1,$(b+"_result").value=parseInt($(b+"_result").value)+1,$("points").value=parseInt($("points").value)-1,$("points").value==0)$("hp_plus").innerHTML="",$("mana_plus").innerHTML="",$("au_plus").innerHTML="",$("strength_plus").innerHTML="",$("agility_plus").innerHTML="",$("brainpower_plus").innerHTML=
"",$("constitution_plus").innerHTML="",$("charisma_plus").innerHTML="",$("intuition_plus").innerHTML=""}else return!1}
function minus(a,b){$("hp_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"hp_plus\",\"hp\")' class='buttonhover_plus'></a>";$("mana_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"mana_plus\",\"mana\")' class='buttonhover_plus'></a>";$("au_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"au_plus\",\"au\")' class='buttonhover_plus'></a>";$("strength_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"strength_plus\",\"strength\")' class='buttonhover_plus'></a>";
$("agility_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"agility_plus\",\"agility\")' class='buttonhover_plus'></a>";$("brainpower_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"brainpower_plus\",\"brainpower\")' class='buttonhover_plus'></a>";$("constitution_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"constitution_plus\",\"constitution\")' class='buttonhover_plus'></a>";$("charisma_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"charisma_plus\",\"charisma\")' class='buttonhover_plus'></a>";
$("intuition_plus").innerHTML="<a href='javascript:void(0)' onclick='plus(\"intuition_plus\",\"intuition\")' class='buttonhover_plus'></a>";if($("points").value>=0){if($(b+"_points").value=parseInt($(b+"_points").value)-1,$(b+"_result").value=parseInt($(b+"_result").value)-1,$("points").value=parseInt($("points").value)+1,$(b+"_points").value==0)$(a).innerHTML=""}else return!1}
function ranking(a){new Ajax.Updater("search_result","ajax/set_ranking.php",{parameters:"search_page="+a,evalScripts:!0})}function disable_menu(){$("menu").hide()}function enable_menu(){$("menu").show()}
function clear_menu(){$("menu").innerHTML="<a href='javascript: void(0);' class='marmor_11' onclick='change_site(\"grimlords.php\",\"\",\"fade\");'>Startseite</a> - <a href='javascript: void(0);' class='marmor_11' onclick='change_site(\"grimlords_rules.php\",\"\",\"fade\");'>Regeln</a> - <a href='http://forum.grimlords.de' target='_blank' class='marmor_11'>Forum</a> - <a href='javascript: void(0);' class='marmor_11' onclick='change_site(\"grimlords_screenshots.php\",\"\",\"fade\");'>Screenshots</a> - <a href='javascript: void(0);' class='marmor_11' onclick='change_site(\"grimlords_ranking.php\",\"\",\"fade\");'>Rangliste</a> - <a href='javascript: void(0);' class='marmor_11' onclick='change_site(\"grimlords_help.php\",\"\",\"fade\");'>Hilfe</a> ";$("logout").remove()}
function el_hover(a){if(a)a.style.backgroundImage="url(images/misc/trans_000000_25.png)"}function el_out(a){if(a)a.style.backgroundImage="url(images/misc/trans_000000_0.png)"}function show_request_failure(a){alert("Server meldet Fehler:"+a.statusText)}function eval_request(a){eval(a.responseText)}
function getElementsByClass(a,b,c){b==null&&(b=document);c==null&&(c="*");var d=[],b=b.getElementsByTagName(c),a=" "+a+" ";for(j=i=0;i<b.length;i++)(" "+b[i].className+" ").indexOf(a)!=-1&&(d[j++]=b[i]);return d}function radio(a,b){var c=getElementsByClass(b);for(i=0;i<c.length;i++)c[i].style.borderColor="#333";$(a).style.borderColor="#9EC17B"}function in_array(a,b){for(p=0;p<b.length;p++)if(a==b[p])return 1;return 0}
function addText(a,b,c){if(document.selection){var d=document.selection.createRange().text;document.forms.form_new_pm.elements[a].focus();document.selection.createRange().text=b+d+c}else if(typeof document.forms.form_new_pm.elements[a].selectionStart!="undefined"){var a=document.forms.form_new_pm.elements[a],e=a.textLength,f=a.selectionStart,g=a.selectionEnd,d=a.scrollTop,h=a.value.substring(0,f),f=a.value.substring(f,g),e=a.value.substring(g,e);a.value=h+b+f+c+e;a.selectionStart=h.length;a.selectionEnd=
h.length+f.length+b.length+c.length;a.scrollTop=d;a.focus()}else insertText(a,b+c)}
function insertText(a,b){if(document.forms.form_new_pm.elements[a].createTextRange)document.forms.form_new_pm.elements[a].focus(),document.selection.createRange().duplicate().text=b;else if(typeof document.forms.form_new_pm.elements[a].selectionStart!="undefined"){var c=document.forms.form_new_pm.elements[a],d=c.selectionEnd,e=c.value.length,f=c.value.substring(0,d),d=c.value.substring(d,e),e=c.scrollTop;c.value=f+b+d;c.selectionStart=f.length+b.length;c.selectionEnd=f.length+b.length;c.scrollTop=
e;c.focus()}else document.forms.form_new_pm.elements[a].value+=b,document.forms.form_new_pm.elements[a].focus()};
