doc_ns4 = (document.layers)? true:false;
doc_ie4 = (document.all)? true:false;
doc_dom = (document.getElementById)? true:false;

function EF_getobj(id) {
  if (doc_dom) return document.getElementById(id);
  if (doc_ie4) return document.all[id];
  if (doc_ns4) return document.layers[id];
}

function EF_showobj(id) {
  if (doc_ns4) document.layers[id].display = "block";
  else if (doc_ie4) document.all[id].style.display = "block";
  else if (doc_dom) { 
    if (document.getElementById(id) != undefined) {
      document.getElementById(id).style.display = "block";
    }
  }
}

function EF_hideobj(id) {
  if (doc_ns4) document.layers[id].display = "";
  else if (doc_ie4) document.all[id].style.display = "none";
  else if (doc_dom) { 
    if (document.getElementById(id) != undefined) {
      document.getElementById(id).style.display = "none";
    }
  }
}

function EF_url(s)
{
	document.location.href=s;
}

function EF_url_blank(s)
{
	window.open(s,'_blank');
}

function rnav_toggle(id)
{
	if (id!=cur_rnav)
	{
		EF_showobj('rn'+id);EF_hideobj('rn'+cur_rnav); 
		EF_getobj('ra'+id).className='current';EF_getobj('ra'+cur_rnav).className='';
		cur_rnav=id;
	}
}

function rnav_tgl(id)
{
	if (id!=cur_rnav)
	{
		EF_getobj('ra'+id).className='current';EF_getobj('ra'+cur_rnav).className='';
		cur_rnav=id;
	}
}

function ins_tag(s)
{
	EF_getobj('message').value+=s;
	EF_getobj('message').focus();
}		

function EF_init_XML_object()
{
  var o;
  if(window.XMLHttpRequest)
  {
    o = new XMLHttpRequest();
  }else if(window.ActiveXObject)
  {
    try{ o = new ActiveXObject("Msxml2.XMLHTTP"); } catch(ex){ try { o = new ActiveXObject("Microsoft.XMLHTTP");} catch(ex){alert("Dein Browser unterstützt leider kein AJAX!");} }
  }
  return o;
}

function EF_w_innerheight()
{
	var h;
	if (window.innerHeight) {
                h = window.innerHeight;
            }    else if (document.documentElement && document.documentElement.clientHeight)    {
                 h = document.documentElement.clientHeight;
             }    else if (document.body)    {
                 h = document.body.clientHeight;
             }
	return h;
}

function EF_d_height() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function idcard(id)
{
	var idcard=window.open('/pop_idcard.php?id='+id,'_blank','width=910,height=620,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function open_smilies()
{
	var open_smilies=window.open('/pop_smilies.php','_blank','width=600,height=500,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function open_id_pic(id)
{
	var pic=window.open('/pop_idpic.php?id='+id,'_blank','width=500,height=520,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function open_gshop(id)
{
	var shop=window.open('/pop_gshop.php?id='+id,'_blank','width=700,height=550,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function open_tgshop(id,nick,g)
{
	var trustedgift = window.open('/realgifts_shop.php?doneeID='+id+'&doneeNick='+nick+'&doneeGender='+g,'_blank','width=800,height=620,resizable=no,status=no,menubar=no,'+'location=no,scrollbars=yes,toolbar=no');
}

function show_fg_foto(kat,id,efid)
{
 var fg_foto = window.open('/pop_fg_foto.php?kat='+kat+'&id='+id+'&efid='+efid,'_blank','resizable=yes,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function show_event(id)
{
var show_event = window.open('/pop_eventinfo.php?id='+id,'_blank','width=660,height=450,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function fTrim(s) { s = s.replace(/^( )*/,"");s = s.replace(/( )*$/,""); return s; }

function idcard_mode(id,mode)
{
 var idcard = window.open('/pop_idcard.php?id='+id+'&mode='+mode,'_blank','width=900,height=620,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function wsms(id)
{
	var smswrite = window.open('/pop_writesms.php?id='+id,'_blank','width=550,height=340,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
}

function mw(id,re)
{
	if (re=='')
	{
		var mw = window.open('/pop_newmsg.php?id='+id,'_blank','width=680,height=450,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no');
	}else
	{
		var mw = window.open('/pop_newmsg.php?id='+id+'&re='+re,'_blank','width=680,height=450,resizable=no,status=no,menubar=no,location=no,scrollbars=yes,toolbar=no')
	}
}

function open_EF_Chat() {
	var width = 800;
	var height = 600;
	var y = (screen.height - height) / 2;
	var x = (screen.width - width) / 2;
	var options = "width=" + width + ",height=" + height + ",top=" + y + ",left=" + x + ",resizable,status=no,menubar=no,statusbar=no,location=no,scrollbars=yes,toolbar=no";
	var EF_chat = window.open("/pop_efchat_start.php", "efchat", options );
}

function open_livechat(w)
{
 var open_livechat = window.open('/pop_1to1chat.php?open=1&id='+w,'_blank','width=750,height=480,resizable=yes,status=no,menubar=no,statusbar=no,location=no,scrollbars=yes,toolbar=no');
}

function login_getuserdata()
{
 EF_getobj('efus').value=screen.width + 'x' + screen.height;
 EF_getobj('efpd').value=screen.pixelDepth;
 var a = "";
 for(i=0;i<navigator.plugins.length;i++)
 {
	a += navigator.plugins[i].name+" - ";
  }
 EF_getobj('efpl').value=a; 
}

function switch_nav(n)
{
	var s=EF_getobj(n).style;
	if (s.display=='none')
	{
		s.display='block';
	}else
	{
		s.display='none';
	}
}

function enURL() { return encodeURIComponent(location.href); }
function enLOC() { return encodeURIComponent(document.location); }
function efURL() { return document.location.href; }
function enTIT() { return encodeURIComponent(document.title); }

function c_check(text,cobj)
{
        MaxLen = 5000;
		Str = text.value;
		StrLen = Str.length;
        if( StrLen > MaxLen )
        {
			Str = Str.substring(0,MaxLen);
			Counter = 0;
        }
        else
        {
			Counter = MaxLen - StrLen;
        }
        EF_getobj(cobj).value = Counter;
}

function c_check_max(text,cobj,MaxLen)
{
		Str = text.value;
		StrLen = Str.length;
        if( StrLen > MaxLen )
        {
			Str = Str.substring(0,MaxLen);
			Counter = 0;
        }
        else
        {
			Counter = MaxLen - StrLen;
        }
        EF_getobj(cobj).value = Counter;
}

function EF_social_bookmarks()
{
document.write('<a rel="nofollow" href="http://www.mister-wong.de/" onclick="window.open(\'http://www.mister-wong.de/index.php?action=addurl&amp;bm_url=\'+enURL()+\'&amp;bm_notice=&amp;bm_description=\'+enTIT()+\'&amp;bm_tags=\');return false;" title="Bookmark bei: Mr. Wong"> <img border=0 src="/img/bookmarks/wong.gif"></a><a rel="nofollow" href="http://www.favoriten.de/" onclick="window.open(\'http://www.favoriten.de/url-hinzufuegen.html?bm_url=\'+enURL()+\'&amp;bm_title=\'+enTIT());return false;" title="Bookmark bei: Favoriten"> <img border=0 src="/img/bookmarks/favoriten.gif"></a><a rel="nofollow" href="http://www.bookmarks.cc/" onclick="window.open(\'http://www.bookmarks.cc/bookmarken.php?action=neu&amp;url=\'+(efURL())+\'&amp;title=\'+(document.title));return false;" title="Bookmark bei: Bookmarks.cc"> <img border=0 src="/img/bookmarks/bookmarkscc.gif"></a><a rel="nofollow" href="http://www.favit.de/" onclick="window.open(\'http://www.favit.de/submit.php?url=\'+(efURL()));return false;" title="Bookmark bei: Favit"> <img border=0 src="/img/bookmarks/favit.gif"></a><a rel="nofollow" href="http://yigg.de/" onclick="window.open(\'http://yigg.de/neu?exturl=\'+enURL());return false" title="Bookmark bei: Yigg"> <img border=0 src="/img/bookmarks/yigg.gif"></a><a rel="nofollow" href="http://digg.com/" onclick="window.open(\'http://digg.com/submit?phase=2&amp;url=\'+enURL()+\'&amp;bodytext=&amp;tags=&amp;title=\'+enTIT());return false;" title="Bookmark bei: Digg"> <img border=0 src="/img/bookmarks/digg.gif"></a><a rel="nofollow" href="http://www.furl.net/" onclick="window.open(\'http://www.furl.net/storeIt.jsp?u=\'+enURL()+\'&amp;keywords=&amp;t=\'+enTIT());return false;" title="Bookmark bei: Furl"> <img border=0 src="/img/bookmarks/furl.gif"></a><a rel="nofollow" href="http://www.yahoo.com/" onclick="window.open(\'http://myweb2.search.yahoo.com/myresults/bookmarklet?t=\'+enTIT()+\'&amp;d=&amp;tag=&amp;u=\'+enURL());return false;" title="Bookmark bei: Yahoo"> <img border=0 src="/img/bookmarks/yahoo.gif"></a><a rel="nofollow" href="http://www.google.com/" onclick="window.open(\'http://www.google.com/bookmarks/mark?op=add&amp;hl=de&amp;bkmk=\'+enURL()+\'&amp;annotation=&amp;labels=&amp;title=\'+enTIT());return false;" title="Bookmark bei: Google"> <img border=0 src="/img/bookmarks/google.gif"></a><a rel="nofollow" href="http://de.wikipedia.org/wiki/Social_Bookmarks" target="" title="Information"> <img border=0 src="/img/bookmarks/what.gif"></a>');
}

 	function EMail(s) {
	var a = false;
	var res = false;
	if(typeof(RegExp) == 'function')
	{
		var b = new RegExp('abc');
		if(b.test('abc') == true){a = true;}
	}
	if(a == true)
	{
		reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
		res = (reg.test(s));
	}
	else
	{
		res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
	}
	return(res);
	}
