﻿function Browser(){var userAgent,str,i
this.isIE=false;this.isNS=false;this.isIE9=false;this.iOS=false;this.version=null;userAgent=navigator.userAgent;str="MSIE";if((i=userAgent.indexOf(str))>=0){if((i=userAgent.indexOf('MSIE 9'))>=0){this.isIE9=true;}
this.isIE=true;return;}
str="Netscape6/";if((i==userAgent.indexOf(str))>=0){this.isNS=true;return;}
str="Gecko";if((i=userAgent.indexOf(str))>=0){this.isNS=true;return;}
if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))){this.iOS=true;}}
var browser=new Browser();var FavText="mitohnekochen.com";var LieblingsRezeptError="Das Rezept konnte nicht zu Ihren Lieblingsrezepten hinzugefügt werden!";function init(){addEvent(window,'load',start_init);addEvent(window,'load',start_init);}
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
function initGoogleAnalytics(){var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-12568198-1']);_gaq.push(['_setDomainName','.mitohnekochen.com']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();}
function start_init(){init_overlay();addtoFavorits();initTabs();initSh();init_profilescroll();initOther();}
function initOther(){share_pid_box=document.getElementById('s_pids');fl=document.getElementById('fakelogin');rl=document.getElementById('reallogin');if(fl!=null){fl.style.display='none';}
if(rl!=null){rl.style.display='block';}
open_comment_reply();show_al_th()}
function send_alert(val){try{document.getElementById('hf_alert').value=val;document.forms['frm_alert'].submit();}catch(err){}
return false;}
function show_al_th(){try{if(thal==true){alert("Vielen Dank für Ihren Hinweise!\nWir werden Ihre Meldung umgehend prüfen!");}}catch(err){return;}}
var tb=false;function show_comment_reply(id){document.getElementById('commentid').value=id;try{TopUp.displayTopUp('#reply1','width = 720, type = dom, layout = dashboard, resizable = 0, shaded = 1, modal = 1');}catch(err){if(tb!=true){tb=true;}}
return false;}
function open_comment_reply(){try{if(srep==true){TopUp.displayTopUp('#reply1','width = 720, type = dom, layout = dashboard, resizable = 0, shaded = 1, modal = 1');}}catch(err){}}
function clearrply(){try{document.getElementById('rtxt_name').value='';}catch(err){}
try{document.getElementById('rtxt_email').value='';}catch(err){}
try{document.getElementById('rtxt_comment').value='';}catch(err){}
try{document.getElementById('commentid').value='-1';}catch(err){}
try{document.getElementById('rpe').style.visibility='hidden';}catch(err){}}
var t=false;function init_overlay(){try{if(showol!=true){return;}}catch(err){return;}
if(document.URL.indexOf(olname)<0){return;}
try{addEvent(document.getElementById('oly'),'click',overlay_tofilter);addEvent(document.getElementById('oln'),'click',close_overlay);}catch(err){return;}
try{TopUp.displayTopUp('#choverlayl','width = 920, type = dom, layout = dashboard, resizable = 0, shaded = 1, modal = 1');}catch(err){if(t!=true){t=true;window.setTimeout(init_overlay,10);}}}
function overlay_tofilter(){window.location=document.URL.replace(olname,olr);}
function overlay_nottoday(){var d=new Date();d=new Date(d.getTime()+1000*60*60*1);document.cookie='nool=true; expires='+d.toGMTString()+'; path=/;';close_overlay();}
function close_overlay(){TopUp.close();}
var prr;var form;var haftung;var haftungr;function init_profilescroll(){try{prr=document.getElementById('prr');if(prr=='undefined'||prr==null){return;}
form=document.getElementById('cmd_subma').form;if(form=='undefined'||form==null){form=document.getElementById('save_profil').form;if(form=='undefined'||form==null){return;}}
document.getElementById('bottomprofile').style.display='none';prr.style.display='block';haftungr=document.getElementById('chkhaftungr');if(haftungr!='undefined'&&haftungr!=null){haftung=document.getElementById('chkhaftung');addEvent(document.getElementById('chkhaftungr'),'click',chghaftung);}
addEvent(document.getElementById('rsright'),'click',pfssubmit);addEvent(document.getElementById('save_profil_r'),'click',pfspsubmit);addEvent(window,'scroll',scrollprofile);scrollprofile();}catch(err){return;}}
function chghaftung(){haftung.checked=haftungr.checked;}
function pfssubmit(){form.submit();}
function pfspsubmit(){document.getElementById('ps').removeChild(document.getElementById('save_profil'));hf=document.createElement('input');hf.setAttribute('type','hidden');hf.setAttribute('name','save_profil');hf.setAttribute('id','save_profil');if(browser.isIE){hf.name='save_profil';hf.id='save_profil';}
hf.setAttribute('value','1');form.appendChild(hf);form.submit();}
function scrollprofile(){scroll=getScrollXY()[1];if(scroll>364){prr.className="box boxfloat";}else{prr.className="box";}}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
function switch_passwordbox(){pwbox='<input class="textbox" type="password" name="login_password" id="login_password" value="" />';document.getElementById('password_box').innerHTML=pwbox;document.getElementById('login_password').focus();document.getElementById('login_password').setActive();}
function addtoFavorits(){link=document.getElementById("addtoFav");if(typeof link==="undefined"||link==null){return;}
if(browser.isIE){link.style.display="inline";}
if(browser.isNS){if(window.opera||window.sidebar){link.style.display="inline";}}
link.href="javascript:addBookmark(FavText, location.href);";}
function addBookmark(title,url){if(window.sidebar){window.sidebar.addPanel(title,url,'');}else if(window.opera){var a=document.createElement("A");a.rel="sidebar";a.target="_search";a.title=title;a.href=url;a.click();}else if(document.all){window.external.AddFavorite(url,title);}}
var req_l=null;function add_lieblingsrezept(rid){if(rid==null){return;}
req_l=createRequest();if(req_l==null){alert(LieblingsRezeptError);return;}
var url='/_mok/addlr.php?rid='+rid;req_l.open("GET",url,true);req_l.onreadystatechange=lr_call;req_l.send(null);return false;}
function lr_call(){if(req_l==null){return;}
if(req_l.readyState==4){if(req_l.status==200){if(req_l.responseText=='true'){alert('Das Rezept wurde zu den Lieblingsrezepten hinzugefügt!');}
else{alert(LieblingsRezeptError);}
window.location.href=parse_url(window.location.href);}
else{alert(LieblingsRezeptError);}
req_l=null;}}
var share_pid_box=null;function toggle_share_pids(el){if(el==null||share_pid_box==null){return;}
tpid=parseInt(el.id.substring(2));if(share_pid_box.value==''){share_pid_box.value=tpid;return;}
vals=share_pid_box.value.split(';');var inside=false;var new_vals=new Array();for(var i=0;i<vals.length;i++){if(vals[i]==tpid){inside=true;}
else{new_vals[i]=vals[i];}}
if(!inside){new_vals[new_vals.length]=tpid;}
share_pid_box.value=new_vals.join(';');}
var req_s=null;var share_error='Leider ist ein Fehler aufgetreten, der verhindert, dass Sie Ihr Profil versenden können!\nWir sind um eine rasche Behebung des Fehlers bemüht.';function share_submit(){var share_user=document.getElementById('send_mail');var share_pids=document.getElementById('s_pids');req_s=createRequest();if(share_user==null||share_pids==null||req_s==null){alert(share_error);return;}
if(share_user.value==''){alert('Sie müssen einen Benutzer oder dessen E-Mailadresse angeben, an den Sie das Profil versenden möchten!');return;}
if(share_pids.value==''){alert('Sie müssen wenigstens ein Profil zum Versenden auswählen!');return;}
var url='/_mok/share.php?user='+share_user.value+'&pids='+share_pids.value;req_s.open("GET",url,true);req_s.onreadystatechange=share_call;req_s.send(null);}
function share_call(){if(req_s==null){return;}
if(req_s.readyState==4){if(req_s.status==200){if(req_s.responseText.indexOf('true')>=0){res_arr=req_s.responseText.split(';');if(res_arr.length==2&&res_arr[1]!=''){alert('Ihr Profil wurde erfolgreich an '+res_arr[1]+' verschickt!');}
else{alert('Ihr Profil wurde erfolgreich verschickt!');}}
else{alert(share_error);}}
else{alert(share_error);}
req_s=null;}}
function highlight_label(el){if(el==null){return;}
hl=el;hl_label=smo_input_get_label(el);toggle_submit(hl_label);}
var hl=null;function color_label(){if(hl==null){return;}
hl_label=smo_input_get_label(hl)
if(hl.checked){hl_label.className='highlighted';}
else{hl_label.className='black';}
hl==null;}
var req_a=null;var req_toggle='';function toggle_submit(el){req_a=createRequest();if(req_a==null||el==null||el.id==''){if(el.id!=''){req_toggle=el.id.substring(2);toggle_by_url();}
return;}
tid=req_toggle=el.id.substring(2);if(typeof toggle_URL!=undefined&&typeof toggle_URL!='undefined'){if(toggle_URL==true){toggle_by_url();return;}}
var url='/_mok/toggle.php?ptoggle='+parseInt(tid);req_a.open("GET",url,true);req_a.onreadystatechange=toggle_call;req_a.send(null);}
function toggle_call(){if(req_a==null){return;}
if(req_a.readyState==4){if(req_a.status==200){color_label();}
else{toggle_by_url()}
req_a=null;}}
function toggle_by_url(){if(req_toggle==''){return;}
document.getElementById('ptoggle').value=req_toggle;document.forms['sub_ptoggle'].submit();}
function parse_url(url){if(url==''||url.indexOf('?',0)<=0||url.indexOf('&')<=0){return url;}
var urlparts=url.split('?');var queryparts=urlparts[1].split('&');var newquerys='?';var i=0;for(i=0;i<queryparts.length;i++){if(queryparts[i].indexOf('rezepte_id')>=0||queryparts[i].indexOf('rezepte_details')>=0||queryparts[i].indexOf('rezepte')>=0){if(newquerys=='?'){newquerys=newquerys+queryparts[i];}
else{newquerys=newquerys+'&'+queryparts[i];}}}
return urlparts[0]+newquerys;}
function smo_input_get_label(inputElem){if(inputElem.parentNode){if(inputElem.parentNode.tagName=='label'){return inputElem.parentNode;}}
var labels=document.getElementsByTagName("label"),i;for(i=0;i<labels.length;i++){if(labels[i].htmlFor==inputElem.id){return labels[i];}}
return false;}
function addFbLike(objid,url,type){obj=document.getElementById(objid);if(obj==null||obj.nodeName.toLowerCase()!='div'){return;}
if(url==null||url==''){url='http://www.facebook.com/#!/pages/wwwmitohnekochencom/182439074576';}
dtype='button_count';switch(type){case 1:dtype='box_count';break;case 0:default:dtype='button_count';break;}
var fb='<fb:like href="'+url+'" layout="'+dtype+'" show_faces="false" width="70" font="verdana"></fb:like>';obj.innerHTML=fb;var js=document.createElement('script');js.async=true;js.src=document.location.protocol+'//connect.facebook.net/en_US/all.js#xfbml=1';js.type='text/javascript';obj.appendChild(js);}
function addAmazon(objid,data){obj=document.getElementById(objid);if(obj==null||obj.nodeName.toLowerCase()!='div'||data==null||data==''){return;}
var code=document.createElement('span');code.innerHTML=data;obj.appendChild(code);}
function createRequest(){var request=null;try{request=new XMLHttpRequest();}catch(tryMS){try{request=new ActiveXObject("Msxml2.XMLHTTP");}catch(otherMS){try{request=new ActiveXObject("Microsoft.XMLHTTP");}catch(failed){request=null;}}}
return request;}
var tab_r;var tab_p;var tr_r;var tr_p;var tr_c;function initTabs(){tab_r=document.getElementById('t_r');tab_p=document.getElementById('t_p');tr_r=document.getElementById('tr_r');tr_p=document.getElementById('tr_p');tr_c=document.getElementById('tr_container');}
function tabsRez(){if(tab_r==null||tab_p==null||tr_c==null){return;}
tab_r.style.display='block';tab_p.style.display='none';tr_c.className='tabs_r';}
function tabsPro(){if(tab_r==null||tab_p==null||tr_c==null){return;}
tab_r.style.display='none';tab_p.style.display='block';tr_c.className='tabs_p';}
var menu_timer_oeffnen=new Array();var menu_timer_schlieszen=new Array();var menu_wait=50;function oeffnen(id)
{if(document.getElementById(id))
{window.clearTimeout(menu_timer_schlieszen[id]);menu_timer_oeffnen[id]=window.setTimeout("document.getElementById('"+id+"').style.display='table-row'",menu_wait);}
menu=document.getElementById(id.replace("sub_nav","menue"));if(menu!=null){menu.style.display='block';}
switchon(id);}
function schlieszen(id)
{if(document.getElementById(id))
{window.clearTimeout(menu_timer_oeffnen[id]);menu_timer_schlieszen[id]=window.setTimeout("document.getElementById('"+id+"').style.display='none'",menu_wait);}
menu=document.getElementById(id.replace("sub_nav","menue"));if(menu!=null){menu.style.display='none';}
switchoff(id);}
function switchon(id){tab=document.getElementById(id.replace("menue","nav").replace("sub_nav","nav"));if(tab==null){return;}
tab.className='item ithover';}
function switchoff(id){tab=document.getElementById(id.replace("menue","nav").replace("sub_nav","nav"));if(tab==null){return;}
tab.className='item';}
function oeffnen_menue(id){menu=document.getElementById(id);if(menu!=null){menu.style.display='block';}
switchon(id);}
function schliessen_menue(id){menu=document.getElementById(id);if(menu!=null){menu.style.display='none';}
switchoff(id);}
var browser=new Browser();var ImgPath='/_img/';var AnimHeight=8;var mp;var mp_o;var mp_open=false;var ml;var ml_o;var ml_open=false;var mp_img;var ml_img;var ml_top;var ml_o_top;var mp_o_target_height=-1;function initSh(){mp=document.getElementById("d_mp");ml=document.getElementById("d_ml");mp_o=document.getElementById("d_mp_o");ml_o=document.getElementById("d_ml_o");mp_img=document.getElementById("d_mp_img");ml_img=document.getElementById("d_ml_img");if(mp!=null&&ml!=null&&mp_o!=null&&ml_o!=null&&mp_img!=null&&ml_img!=null){ml_top=ml.offsetTop;ml_o_top=108;mp_o.style.display='block';if(browser.isIE){mp_o_target_height=mp_o.offsetHeight;tabsPro();if(mp_o.offsetHeight>mp_o_target_height){mp_o_target_height=mp_o.offsetHeight;}
if(browser.isIE9){mp_o_target_height=mp_o_target_height+25;}}
if(browser.isNS){mp_o_target_height=mp_o.scrollHeight;tabsPro();if(mp_o.scrollHeight>mp_o_target_height){if(navigator.userAgent==null||navigator.userAgent==''||navigator.userAgent.indexOf('Firefox')<0){mp_o_target_height=mp_o.scrollHeight+40;}else{mp_o_target_height=mp_o.scrollHeight+10;}}
else if(navigator.userAgent.indexOf('Firefox')>0){mp_o_target_height+=10;}}
tabsRez();mp_o.style.display='none';}}
function show_hide_mp(){if(mp==null||ml==null||mp_o==null||ml_o==null){return;}
if(run_mp==true){setTimeout('show_hide_mp()',10);return;}
if(mp_open==false){mp_img.src=ImgPath+'profile_middle_arrow_up.gif';mp_o.style.display='block';mp_open=true;start_open_mp_o();}
else{mp_img.src=ImgPath+'profile_middle_arrow.gif';mp_open=false;start_close_mp_o();}}
var mp_o_height;var a_ml_top;var a_ml_o_top;var run_mp=false;function start_open_mp_o(){if(mp_o_target_height<=0){mp_o_target_height=mp_o.offsetHeight}
mp_o_height=0;mp_o.style.height='0px';a_ml_top=ml_top;a_ml_o_top=ml_o_top;run_mp=true;open_mp_o();}
function open_mp_o(){if(mp==null||ml==null||mp_o==null||ml_o==null){return;}
if(mp_o_height>=mp_o_target_height){mp_o.style.height=mp_o_height;ml.style.top=ml_top+mp_o.offsetHeight-3;ml_o.style.top=ml_o_top+mp_o.offsetHeight-3;run_mp=false;return;}
mp_o_height=mp_o_height+AnimHeight;a_ml_top=a_ml_top+AnimHeight;a_ml_o_top=a_ml_o_top+AnimHeight;mp_o.style.height=mp_o_height+'px';ml.style.top=a_ml_top+'px';ml_o.style.top=a_ml_o_top+'px';setTimeout('open_mp_o()',1);}
var mp_o_target_h=0;function start_close_mp_o(){mp_o.style.height=mp_o_height+'px';a_ml_top=ml.offsetTop;a_ml_o_top=ml_o.offsetTop;mp_o_height=mp_o.offsetHeight;run_mp=true;close_mp_o();}
function close_mp_o(){if(mp==null||ml==null||mp_o==null||ml_o==null){return;}
if(mp_o_target_h>=mp_o_height){mp_o.style.display='none';mp_o.style.height=mp_o_target_height+'px';ml.style.top=ml_top+'px';ml_o.style.top=ml_o_top+'px';run_mp=false;return;}
mp_o_height=mp_o_height-AnimHeight;if(mp_o_height>=0){mp_o.style.height=mp_o_height+'px';}
else{mp_o_height=0;mp_o.style.height='0px';}
a_ml_top=a_ml_top-AnimHeight;a_ml_o_top=a_ml_o_top-AnimHeight;ml.style.top=a_ml_top+'px';ml_o.style.top=a_ml_o_top+'px';setTimeout('close_mp_o()',1);}
function show_hide_ml(){if(ml==null||ml_o==null){return;}
if(run_ml==true){setTimeout('show_hide_ml()',10);return;}
if(ml_open==false){ml_img.src=ImgPath+'profile_middle_arrow_up.gif';ml_o.style.display='block';ml_open=true;start_open_ml_o();}
else{ml_img.src=ImgPath+'profile_middle_arrow.gif';ml_open=false;start_close_ml_o();}}
var ml_o_height;var ml_o_target_height=-1;var run_ml=false;function start_open_ml_o(){if(ml_o_target_height<=0){ml_o_target_height=ml_o.offsetHeight}
ml_o_height=0;ml_o.style.height=ml_o_height+'px';run_ml=true;open_ml_o();}
function open_ml_o(){if(ml==null||ml_o==null){return;}
if(ml_o_height>=ml_o_target_height){ml_o.style.height=ml_o_target_height+'px';run_ml=false;return;}
ml_o_height=ml_o_height+AnimHeight;ml_o.style.height=ml_o_height+'px';setTimeout('open_ml_o()',1);}
var ml_o_target_h=0;function start_close_ml_o(){ml_o.style.height=ml_o_target_height+'px';ml_o_height=ml_o_target_height;run_ml=true;close_ml_o();}
function close_ml_o(){if(ml==null||ml_o==null){return;}
if(ml_o_target_h>=ml_o_height){ml_o.style.display='none';ml_o.style.height=ml_o_target_height+'px';run_ml=false;return;}
ml_o_height=ml_o_height-AnimHeight;if(ml_o_height<=0){ml_o_height=0;}
ml_o.style.height=ml_o_height+'px';setTimeout('close_ml_o()',1);}
var tab_r;var tab_p;var tr_r;var tr_p;var tr_c;function initTabs(){tab_r=document.getElementById('t_r');tab_p=document.getElementById('t_p');tr_r=document.getElementById('tr_r');tr_p=document.getElementById('tr_p');tr_c=document.getElementById('tr_container');}
function tabsRez(){if(tab_r==null||tab_p==null||tr_c==null){return;}
tab_r.style.display='block';tab_p.style.display='none';tr_c.className='tabs_r';}
function tabsPro(){if(tab_r==null||tab_p==null||tr_c==null){return;}
tab_r.style.display='none';tab_p.style.display='block';tr_c.className='tabs_p';}
function get_Target_El(ev){if(typeof(ev.id)!='undefined'){return ev;}
if(browser.isIE){return ev.srcElement;}else{return ev.currentTarget;}}
function preventDefault(ev){if(browser.isNS){ev.preventDefault();}
if(browser.isIE){window.event.returnValue=false;}}
function oek(ev){if(this.iOS){return;}
preventDefault(ev);l=get_Target_El(ev);if(typeof l.href==='undefined'||l.href==''){return;}
return new_Window(l.href,'',490,600,true);}
function new_Window(url,title,width,height,preventdefault){w=window.open(url,title,"width="+width+",height="+height+",status=no,scrollbars=yes,resizeable=no");w.focus();if(preventdefault){return false;}}
init();
