/***********************************************
* Animated Collapsible DIV v2.2- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

animatedcollapse.addDiv('login', 'fade=1,height=130px');

animatedcollapse.ontoggle=function($, divobj, state){
		document.getElementById(divobj.id+"-toggle").src=(state=="block")? "fileadmin/templates/bilder/close.gif" : "fileadmin/templates/bilder/login.gif"
}

animatedcollapse.init();

sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

	var FO = { movie:"fileadmin/templates/flash/fisch.swf", width:"320", height:"240", majorversion:"8", build:"0", wmode:"transparent", quality:"best", allowscriptaccess:"allways" };
		UFO.create(FO, "flash");
		
function openShadowbox(content, player, title){
    Shadowbox.open({
        content:    content,
        player:     player,
        title:      title
    });
}
function equalColums(){
   var offset = -40;
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('safari/') != -1) offset = -35;
document.getElementById('news-inhalt').style.height=(document.getElementById('hauptspalte').offsetHeight+offset)+'px';
return false;
}

var browserName = navigator.appName;
  var browserVer = parseInt(navigator.appVersion);
  var version = "";
  var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
  if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
	  // Blurring links:
  function blurLink(theObject)	{	//
	  if (msie4)	{theObject.blur();}
  }
  
	  // decrypt helper function
  function decryptCharcode(n,start,end,offset)	{
	  n = n + offset;
	  if (offset > 0 && n > end)	{
		  n = start + (n - end - 1);
	  } else if (offset < 0 && n < start)	{
		  n = end - (start - n - 1);
	  }
	  return String.fromCharCode(n);
  }
	  // decrypt string
  function decryptString(enc,offset)	{
	  var dec = "";
	  var len = enc.length;
	  for(var i=0; i < len; i++)	{
		  var n = enc.charCodeAt(i);
		  if (n >= 0x2B && n <= 0x3A)	{
			  dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
		  } else if (n >= 0x40 && n <= 0x5A)	{
			  dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
		  } else if (n >= 0x61 && n <= 0x7A)	{
			  dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
		  } else {
			  dec += enc.charAt(i);
		  }
	  }
	  return dec;
  }
	  // decrypt spam-protected emails
  function linkTo_UnCryptMailto(s)	{
	  location.href = decryptString(s,-1);
  }
  
// Overlay Box
  
  
  function hideOverlay() { 
  document.getElementById("newsletterHideshow").style.display = "none"; 
  //document.getElementById("news_ifr").src = "";
}

function showOverlay(sourceFile) { 
  var ScrollTop = document.body.scrollTop;
  if (ScrollTop == 0) {
      if (window.pageYOffset)
          ScrollTop = window.pageYOffset;
      else
          ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
  }
  document.getElementById( "newsletterHideshow" ).style.top = ScrollTop + 'px';
    
  document.getElementById("news_popup").style.width = document.body.clientWidth + 'px';
  
  document.getElementById("news_ifr").src = sourceFile; 
  document.getElementById("newsletterHideshow").style.display = "block"; 
} 

// Cookie Handling

function setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );

	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}


function deleteCookie(cName) {
	document.cookie = cName + "=0;expires=1;domain=.askmen.com;path=/";
}

function readCookie(cName) {
	var nameEQ = cName + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return parseInt(c.substring(nameEQ.length,c.length));
	}
	return 0;
}

function cookiesEnabled() {
  setCookie( "cookieTest", "1", null, "/" );
  return readCookie( "cookieTest" );
}

function showNews() {
  if( readCookie( 'signupShown' ) ) {
      return;
  }
  setCookie( 'signupShown', "1", 1, "/" );
  if( !readCookie( "signupShown" ) ) {
    setCookie( 'signupShown', "1", null, "/" );
  }
  showOverlay("abo.html");
}  



// Google Analytics

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20693793-2']);
  _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);
  })();
 
 
