function flasharchiv(url)
{
pop = window.open(url,'POP','scrollbars=no,width=700,height=400,top=' + ((screen.availHeight-400) / 2) + ',left=' + ((screen.availWidth-700) / 2)); 
pop.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function my_scroller(){
myScroll_1 = new
ScrollObj(7,21,265,"track1","up1","down1","drag1","contentMask1","content1");
}

function closeInfo(){

  var infobox = document.getElementById("event_details");

  if(infobox.style.display == "none"){
    infobox.style.display = "";
  }
  else{
    infobox.style.display = "none";
  }

}

function map(url)
{
pop = window.open(url,'POP','scrollbars=no,width=560,height=400,top=' + ((screen.availHeight-700) / 2) + ',left=' + ((screen.availWidth-600) / 2)); 
pop.focus();
}

var browser=new Object;
browser=navigator.appName;
version=navigator.appVersion;
os=navigator.platform;
codename=navigator.appCodeName;
agent=navigator.userAgent;
browser.major = parseInt(navigator.appVersion);
browser.minor = parseFloat(navigator.appVersion);

/*
document.write("<br><br><br>Browser:" + browser + "<br>");
document.write("Version:" + version + "<br>");
document.write("Sprache:" + language + "<br>");
document.write("Betriebssystem:" + os + "<br>");
document.write("Codename des Browsers:" + codename + "<br>");
document.write("User-Agent-Attribut:" + agent + "<br>");
document.write("Browser:" + browser + "<br>");


var spfad= stylepfad+'/common/styles/';
*/
// Browserchecks
safari = (navigator.appVersion.indexOf("Safari")!=-1) ? true : false;
moz = (navigator.appName.indexOf("Netscape")!=-1) ? true : false;
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
opera = (navigator.userAgent.indexOf("Opera")!=-1) ? true : false;
ie55 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.5")!=-1)) ? true : false;
ie6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6")!=-1)) ? true : false;
isIE = ((document.all)&&(navigator.appVersion.indexOf("MSIE")!=-1)) ? true : false;
ie7plus = ((document.all)&&(navigator.appVersion.indexOf("MSIE")!=-1)&&(navigator.appVersion.charAt(navigator.appVersion.indexOf('MSIE')+5)>=7)) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
NS4 = (document.layers) ? true : false;

if(ie55) document.write('<link rel="stylesheet" media="screen, projection" href="'+spfad+'styles_ie55.css" type="text/css" />'); 

if(ie6) document.write('<link rel="stylesheet" media="screen, projection" href="'+spfad+'styles_ie6.css" type="text/css" />'); 


// Funktion, die vor dem Seitenaufbau aufgerufen wird
function preSiteOnResize() {

        if (ie7plus) content_height = (getViewportHeight()-156)+"px" ;
        else if (ie6) content_height = (getViewportHeight()-156)+"px" ;
	else content_height = (getViewportHeight()-186)+"px" ;

        if (ie6) footer_width = (getViewportWidth()-20)+"px" ;
        else footer_width = (getViewportWidth()-16)+"px" ;

  document.write('<style>');
  document.write('div#all{ \n');
  document.write('min-height:'+content_height+';\n');
  document.write('height:auto !important;\n');
  document.write('height:'+content_height+';\n');    
  document.write('}\n ');
  document.write('div#footerGrafik{ \n');
  document.write('width:'+footer_width +';\n');    
  document.write('}\n ');

   lineal_height = getViewportHeight() + "px" ;


  document.write('div#lineal_rand{ \n');
  document.write('min-height:'+lineal_height+';\n');
  document.write('height:auto !important;\n');
  document.write('height:'+lineal_height+';\n');    
  document.write('}\n ');
  document.write('</style>');

}

// Funktion, die nach Fenstergr-Aenderung aufgerufen wird
function mySiteOnResize() {
	var con = document.getElementById("all");
	var con_lineal = document.getElementById("lineal_rand");
	var con_footer = document.getElementById("footerGrafik");

        if (ie7plus) content_height = (getViewportHeight()-156)+"px" ;
        else if (ie6) content_height = (getViewportHeight()-156)+"px" ;
	else content_height = (getViewportHeight()-186)+"px" ;

        if (ie6) footer_width = (getViewportWidth()-20)+"px" ;
        else footer_width = (getViewportWidth()-16)+"px" ;

        con_footer.style.Width = footer_width;

	if (isIE && !ie7plus) {
	  if (getViewportHeight() > 640) con.style.Height = content_height;
	}
	else if (ie7plus){
	   if (con) con.style.minHeight = content_height;
	}
	else{
	   if (con) con.style.minHeight = content_height;
	}

	lineal_height = getViewportHeight() + "px" ;
        con_lineal.style.Height = lineal_height;

}

// Liefert Breite des nutzbaren Sichtbereichs
function getViewportWidth() {
	if (document.body) return document.body.offsetWidth;
	if (document.documentElement) return document.documentElement.offsetWidth;
	var w = self.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);
	if (isIE) return w-16;	//im IE ist der Scroller immer sichtbar
	else return w;
}

// Liefert Höhe des nutzbaren Sichtbereichs
function getViewportHeight() {
	var h = self.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);
	return h;
}

 
// Liefert Fensterbreite
function getWinWidth() {
	return getWinSize()[0];
}

// Liefert Fensterhoehe
function getWinWidth() {
	return getWinSize()[1];
}
	
// Liefert Fenstergroesse
function getWinSize() {
  var myWidth = 0;
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return Array(myWidth,myHeight);
}

function onContent(f){//(C)webreflection.blogspot.com
var b=navigator.userAgent,d=document,w=window,
c="__onContent__",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='//:' on",r,"change='if({complete:true}[this.",r,"])",c,"()'></scr","ipt>");
w[c]=(function(o){return function(){w[c]=function(){};f(o?o():o)}})(w[c]);
if(d[e])d[e]("DOMContentLoaded",w[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))
(function(){/loaded|complete/.test(d[r])?w[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};

// window.setTimeout( "setContentHeight", 1000 );

// window.onload = setContentHeight;
// window.onresize = setContentHeight;


function CheckFormAnmeldung() {

  var formname = "anmeldung";

  var illegalChars = /[\W_]/;
  var email_value = document.forms[formname].form_mail.value;
  
  if(document.forms[formname].form_name.value == "") {
    alert("Bitte geben Sie Ihren Namen ein.");
    document.forms[formname].form_name.focus();
    return false;
  }  
  if(document.forms[formname].form_vorname.value == "") {
    alert("Bitte geben Sie Ihren Vornamen ein.");
    document.forms[formname].form_vorname.focus();
    return false;
  }
  if(document.forms[formname].form_firma.value == "") {
    alert("Bitte geben Sie Ihre Firma an.");
    document.forms[formname].form_firma.focus();
    return false;
  }
  if(document.forms[formname].form_funktion.value == "") {
    alert("Bitte geben Sie Ihre Funktion an.");
    document.forms[formname].form_funktion.focus();
    return false;
  }
  if(document.forms[formname].form_strasse.value == "") {
    alert("Bitte geben Sie Ihre Strasse ein.");
    document.forms[formname].form_strasse.focus();
    return false;
  }
  if(document.forms[formname].form_nr.value == "") {
    alert("Bitte geben Sie Ihre Hausnummer ein.");
    document.forms[formname].form_nr.focus();
    return false;
  }
  if(document.forms[formname].form_plz.value == "") {
    alert("Bitte geben Sie Ihre Postleitzahl ein.");
    document.forms[formname].form_plz.focus();
    return false;
  }
  if(document.forms[formname].form_ort.value == "") {
    alert("Bitte geben Sie Ihren Ort ein.");
    document.forms[formname].form_ort.focus();
    return false;
  } 
  if(document.forms[formname].form_land.value == "") {
    alert("Bitte geben Sie Ihre Land ein.");
    document.forms[formname].form_land.focus();
    return false;
  }    
  if(document.forms[formname].form_fon.value == "") {
    alert("Bitte geben Sie Ihre Telefonnummer an.");
    document.forms[formname].form_fon.focus();
    return false;
  }       

  //email format testen

  if(email_value == "") {
    alert("Bitte geben Sie Ihre Email-Adresse ein.");
    document.forms[formname].form_mail.focus();
    return false;
  }   
 
  if(email_value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
    alert("Bitte geben Sie ein korrekte Email-Adresse ein.");
    document.forms[formname].form_mail.select();
    document.forms[formname].form_mail.focus();
    return false;
  }

  return true;  
}

var div_id = 1;

function change_menu(foo,anzahl){  

     div_id += foo; 
   
     if(div_id >0 && div_id <=anzahl){
  
           for(var i=1; i < anzahl+1; i++){ 
              var div = document.getElementById("con"+i);
              /* var divLink = document.getElementById("b"+i); */
              div.style.display = (i == div_id) ? (new Effect.Appear("con"+i, { duration: 0.5})) : "none";
             /* divLink.className = (i == div_id) ? "current" : ""; */
           }   
      }
}

preSiteOnResize();

 function onEventClick(event) 
    { 
        var offSetContent = $('columnContent').cumulativeOffset()[1]; 
        var eDetails = $('event_details'); 
        var href = event.findElement('a').href; 
        var erg = href.match(/sid=(\d+)/); 
        if(erg){ 
            var offSets = event.findElement('div.t_teaser').cumulativeOffset(); 
            eDetails.setStyle({marginTop: (offSets[1]-offSetContent+40) + 'px'}); 
            eDetails.show(); 
            new Ajax.Updater('event_details', href); //'detail.php'); 
            event.stop(); 
        } 
    }


MBX.EventHandler.subscribe("span.t_link a", "click", onEventClick);