function setCookie(name,val,expi,path,dom,sec){
  var today=new Date();
  today.setTime(today.getTime());
  if(expi)expi=expi*1000*60*60*24;
  var expd=new Date(today.getTime()+(expi)).toGMTString(); 
  document.cookie=name+"="+escape(val)+((expi)?";expires="+expd:"")+((path)?";path="+path:"")+((dom)?";domain="+dom:"")+((sec)?";secure":"");
}
function getCookie(check_name){
  var a_all_cookies=document.cookie.split(';');
  var a_temp_cookie='';
  var cookie_name='';
  var cookie_value='';
  var b_cookie_found=false;
  for(i=0;i<a_all_cookies.length;i++){
    a_temp_cookie=a_all_cookies[i].split('=');
    cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');
    if(cookie_name==check_name){
      b_cookie_found = true;
      if(a_temp_cookie.length>1)return unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));
    }
    a_temp_cookie=null;
    cookie_name='';
  }
  if(!b_cookie_found)return null;
}
function deleteCookie(name,path,dom) {
  if(getCookie(name))document.cookie=name+"="+((path)?";path="+path:"")+((dom)?";domain="+dom:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function getUser(){
  var cv=getCookie("db292456373_mw_UserName");
  if(cv==null)return "Kein Login";
  return cv;
}			
var dl=document.location.href;
if(dl.indexOf("www")==-1){
  var fullpath=document.location.pathname;
  if(document.location.query)fullpath+='?'+document.location.query;
//alert(fullpath);
 // document.location.href='http://www.ig-nordlicht.de'+fullpath;
}
if(dl.indexOf("index1024.html")!=-1||dl.indexOf("index1200.html")!=-1){
  var fullpath='/';
  if(document.location.query)fullpath+='?'+document.location.query;
  document.location.href='http://www.ig-nordlicht.de'+fullpath;
}

var hour=new Date().getHours();
if(hour<8 || hour >16){
  document.getElementById("logo").src="/images/Nordlicht-Logo[black25].jpeg";
  document.bgColor="black";
document.getElementById("aktuell").style.color="#ffffff";
}


var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
document.write('<script type="text/javascript">try {var pageTracker = _gat._getTracker("UA-2829052-1");pageTracker._trackPageview();} catch(err) {}</script>');
var mp_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + mp_protocol + "api.mixpanel.com/site_media/js/api/mpmetrics.js' type='text/javascript'%3E%3C/script%3E"));
document.write('<script type="text/javascript">try{mpmetrics.init("ff95a9987662b9f47e71f586f40afe95");} catch(err) {};');
document.write('var docloc=document.location.href;mpmetrics.track("pageview", {"pagename":document.title, "channel":document.location.pathname, "user":getUser()},function() {});</script>');

//mpmetrics.track_funnel("WikiEdit", 1, "NL Startseite",{},function() {});


document.write('<!-- Yahoo! Web Analytics - All rights reserved -->');
document.write('<script type="text/javascript" src="http://d.yimg.com/mi/eu/ywa.js"></script>');
document.write('<script type="text/javascript">');
document.write('/*globals YWA*/');
document.write('var YWATracker = YWA.getTracker("1000367465402");');
document.write('/*');
document.write('YWATracker.setDocumentName("");');
document.write('YWATracker.setDocumentGroup("");');
document.write('*/');
document.write('YWATracker.submit();');
document.write('</script>');
