var dom = document.getElementById?1:0;
var ns4 = document.layers?1:0;
var ww,hh;

function showMenu(name,number) {
(window.innerWidth) ? ww=window.innerWidth:ww=document.all.mixframe.offsetWidth;
(window.innerHeight) ? hh=window.innerHeight:hh=document.all.mixframe.offsetHeight;

 var groups = 5;

 for (count = 1; count <= groups; count++) {
 var content = name + count;
 var active = name + number;

  if(dom) {
   if(content == active) {
    document.getElementById(active).style.visibility = 'visible';
    document.getElementById(active).onmouseover = clearShut;
    document.getElementById(active).onmouseout = setShut;
    document.getElementById(active).style.left=((ww-780)/2)+139;
   }
   else {
    document.getElementById(content).style.visibility = 'hidden';
   }
  }
  else if(ns4) {
   if(content == active) {
    document[active].visibility = 'show';
    document[active].onmouseover = clearShut;
    document[active].onmouseout = setShut;
   }
   else {
    document[content].visibility = 'hide';
   }
  }
 }
 first = name, sec = number;
 clearShut();
}


function setShut() {
timer = setTimeout("shut(first,sec)", 120000);
}


function clearShut() {


if(window.timer)
clearTimeout(timer);
}


function shut(first,sec) {

 var active = first + sec;

 if(dom)
 document.getElementById(active).style.visibility = 'hidden';
 else if(ns4)
 document[active].visibility = 'hide';
}

function versicherung() {
parent.newwin=window.open('http://suncms.ticketonline.de/cms/unternehmen/ticketversicherung.html','versicherung','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=420,height=500,top=30,left=200');
parent.winOpen = true;
}

function Verisign() {
sealWin=window.open('https://digitalid.verisign.com/as2/a4f73198995a6dc219eb91d7219f8dbd',"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=720,height=550');
self.name = "mainWin";
}

function game() {
parent.newwin=window.open('http://content.ticketonline.de/production/de/de/services/game/game.html','game','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=400,height=546,top=30,left=200');
parent.winOpen = true;
if (document.all) if (parent.winOpen) parent.newwin.focus();
}

function info3d() {
parent.newwin=window.open('/3dinfo.html','info3d','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=380,height=460,top=30,left=200');
parent.winOpen = true;
if (is_ie && (is_major >= 4)) if (parent.winOpen) parent.newwin.focus();
}

function UpdateTV() {
 document.formular.action='/trans/evcheck';
 document.formular.submit();
 return true;
}
function UpdateVC() {
 if (document.Formular.OAVC.value.length>0) {
 	document.Formular.action='/trans/evcheck';
		document.Formular.submit();
		return true;
	}
	else {
		alert('Bitte Gutscheinnummer angeben.');
		return undefined;
	}
}

function checkAVB() {
 if (document.Formular.OATVAVB.checked) {
	 document.Formular.submit();
 	return true;
	}
	else {
	 alert('Bitte bestätigen Sie die Annahme der \nAllgemeinen Versicherungsbedingungen (AVB) \nder ELVIA Reiseversicherungen \ndurch ankreuzen.');
	}
}

function UpdateRV(n) {
 document.Formular.submit();
 return true;
}

var save=0;
var i,j,obj,nc=!!(document.captureEvents&&!document.getElementById),ie=!!(document.all),dom=!!document.getElementById,mac=!!(navigator.userAgent.indexOf("Mac")!=-1);

function gs(){
	if(nc){obj=document.layers[arguments[0]];for(i=1;i<arguments.length;i++) obj=obj.document.layers[arguments[i]];}
   	else if(ie)obj=document.all[arguments[arguments.length-1]].style;
   	else if(dom)obj=document.getElementById(arguments[arguments.length-1]).style;
	else obj=null;return obj;
}

function g(){
   	if(nc){obj=document.layers[arguments[0]];for(i=1;i<arguments.length;i++)obj=obj.document.layers[arguments[i]];}
   	else if(ie)obj=document.all[arguments[arguments.length-1]];
   	else if(dom)obj=document.getElementById(arguments[arguments.length-1]);
	else obj=null;return obj;
}

function fp(){
    var el=arguments[0],xPos=0,yPos=0;
    if(nc){for(i=0;i<arguments.length;i++){xPos+=arguments[i].x;yPos+=arguments[i].y;}}
    else{while(el){xPos+=el.offsetLeft;yPos+=el.offsetTop;el=el.offsetParent}};
    return{xPos:xPos,yPos:yPos};
}

var sd="";
var sv="";
var lid="";
var wid=""
var lg="";
function doCount(w,z,mm,sd,sv,wid,lid,lg)
{
   this.sd=sd;
   this.sv=sv;
   this.lid = lid;
   this.lg = lg;
   this.wid=wid;

	w--;
	if (save==0)
	{
		save=w;
	}
	if (w < z)
	{
		if (save<(z*2))
		{
			if (g("countdown")) gs("countdown").color="red";
		}
		if (w==1)
		{
			//if (mm<45 || mm==210)
			location.href="http://"+this.sv+"start.jsp?lg="+this.lg+"&wid="+this.wid+"&lid="+this.lid+"&m=6&sid="+this.sd;

		}
	}
	if (w<0) return;


	var s = w;
	var h = Math.floor(s/3600);
	var m = Math.floor((s - (h * 3600))/60);

	s = (s-(h*3600))%60;

	//alert(s);
   //alert(h);
   //alert(m);

	if (s.toString().length==1)
	{
		s="0"+s;
	}

	if (g("countdown")) g("countdown").innerHTML=m+":"+s;

	window.setTimeout(eval("'doCount("+w+","+z+","+mm+",this.sd,this.sv,this.wid,this.lid,this.lg)'"),1000);
}

function goNext() {
	document.next.submit();
}

function reduced(c)
{
   document.formular.cp.value=c;
   document.formular.submit();
}

function terms() {
parent.newwin=window.open('http://content.ticketonline.de/production/de/de/etix/terms/terms.html','terms','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=520,height=544,top=30,left=200');
parent.winOpen = true;
}

var b="";
function goticket(b) {

if (document.formular.gob.value==b)
{
   document.formular.gob.value=document.formular.gobtxt.value + " ...";
   document.formular.submit();
}
else
{
   alert(document.formular.gobval.value + "!");
}
}


function check()
{
	if ((document.formular.v.value>0) && (document.formular3.agb.checked) && (document.formular3.bes.checked))
	{
		document.formular3.submit();
	}
	else
	{
	   if (document.formular.v.value==0)
	   {
		   //alert("Bitte bestätigen Sie die AGB's");
		   alert(document.formular3.omtext3.value);
		   return;
	   }
	   if (!document.formular3.bes.checked)
	   {
		   //alert("Bitte bestätigen Sie, dass Sie die Daten Ihrer Bestellung (Veranstaltung, Datum und Uhrzeit) und Ihre eingegebene Adresse geprüft haben.");
		   alert(document.formular3.bestext.value);
	   }
	   if (!document.formular3.agb.checked)
	   {
		   //alert("Bitte bestätigen Sie die AGB's");
		   alert(document.formular3.agbtext.value);
	   }
	}
}

function setL()
{
   this.form.landID.value=this.options[this.selectedIndex].value+'-';
}
function popseatplan(linklocation)
	{
	var Hoehe, Breite, linklocation;
	linklocation = linklocation;
	Hoehe=screen.height;
	Breite=screen.width;
	if (Breite>600 & Breite<1024)
	{
		window.open (linklocation,'pop1','resizable=no ,scrollbars=yes,width=800,height=600,left=50,top=50');
	}
	if (Breite>=1024)
	{
	window.open (linklocation,'pop1','resizable=no ,scrollbars=yes,width=1024,height=768,left=50,top=50');
	}
	
	}
	
