
function createSWF(file, width, height, fullscreen, autostart, id_p, version) {
        var s1 = new SWFObject('/'+version+'/flvplayer/flvplayer.swf','single',width,height,'7');
        s1.addParam('allowfullscreen',fullscreen);
        s1.addVariable('file',file);
        s1.addVariable('width',width);
        s1.addVariable('height',height);
        s1.addVariable('autostart',autostart);
        s1.write(id_p);
}

function show_page() {
  document.getElementById('page_hider').style.visibility = 'visible';
}


function get_width() {
 var x,y;
 if (self.innerHeight) // all except Explorer
 {
	x = self.innerWidth;
	y = self.innerHeight;
 }
 else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
 {
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
 }
 else if (document.body) // other Explorers
 {
	x = document.body.clientWidth;
	y = document.body.clientHeight;}
 /*alert("x vor: "+x);*/
 if (x<550) {x=550;}
if (self.document.getElementById("button2") != null) {
 if (x<685)  {
    self.document.getElementById("button2").style.top="35px";
    self.document.getElementById("button2").style.left="10px";
    self.document.getElementById("db").style.height="60px";
    self.document.getElementById("DetailTabContainer_hider").style.top="250px";
    self.document.getElementById("DetailTabContainer").style.top="250px";
    self.document.getElementById("outdooractiveFooter").style.top="830px";
    
    self.document.getElementById("dl").style.height="217px";
    self.document.getElementById("dc").style.height="219px";
    self.document.getElementById("dr").style.height="212px";
 } else if (x>=685) {
    self.document.getElementById("button2").style.top="5px";
    self.document.getElementById("button2").style.left="542px";
    self.document.getElementById("db").style.height="30px";
    self.document.getElementById("DetailTabContainer_hider").style.top="220px";
    self.document.getElementById("DetailTabContainer").style.top="220px";
    self.document.getElementById("outdooractiveFooter").style.top="800px";
    
    self.document.getElementById("dl").style.height="187px";
    self.document.getElementById("dc").style.height="189px";
    self.document.getElementById("dr").style.height="182px";
 }
}

if (self.document.getElementById("button3") != null) {
 if (x<685)   {
    self.document.getElementById("button3").style.top="35px";
    self.document.getElementById("button3").style.left="143px";
 } else if (x<818) {
    self.document.getElementById("button3").style.top="35px";
    self.document.getElementById("button3").style.left="10px";
    self.document.getElementById("db").style.height="60px";
    self.document.getElementById("DetailTabContainer_hider").style.top="250px";
    self.document.getElementById("DetailTabContainer").style.top="250px";
    self.document.getElementById("outdooractiveFooter").style.top="830px";
    
    self.document.getElementById("dl").style.height="217px";
    self.document.getElementById("dc").style.height="219px";
    self.document.getElementById("dr").style.height="212px";
 } else if (x>=818) {
    self.document.getElementById("button3").style.top="5px";
    self.document.getElementById("button3").style.left="675px";
 }
}

 /*alert("x nach: "+x);*/
 self.document.getElementById("dh").style.width=(x-27)+"px";
 self.document.getElementById("dc").style.width=(x-308)+"px";
 self.document.getElementById("dr").style.left=(x-153)+"px";
 self.document.getElementById("db").style.width=(x-12)+"px";
 self.document.getElementById("dd").style.width=(x-27)+"px";
 self.document.getElementById("dbl").style.left=(x-142)+"px";
 self.document.getElementById("dbr").style.left=(x-118)+"px";
 self.document.getElementById("amportal").style.width=(x-12)+"px";
 self.document.getElementById("DetailTabContainer").style.width=(x-10)+"px";
 self.document.getElementById("DetailTabContainer_hider").style.width=(x-12)+"px";
 self.document.getElementById("outdooractiveFooter").style.width=(x-12)+"px";
 if(self.document.getElementById("gallery") != null) {
   /*alert(self.document.getElementById("gallery"));*/
  self.document.getElementById("gallery").style.width=(x-12)+"px";
  self.document.getElementById("gallery_background").style.width=(x-12)+"px";
  for (var i = 0; i < self.document.getElementsByName("pic").length; i++) {
   self.document.getElementsByName("pic")[i].style.left=(( (x-12) / 2) -262)+"px";
  }
 }
}

window.onresize = get_width;

function setStars(stars, skin, sum) {
var j = sum-stars	
for (var i = 1; i <= stars; i++) {
     document.write('<div style="float:left; width:5px; height:8px; margin-right:3px; padding:0px; margin-top:2px; margin-bottom:0px;" class="bgcolor_dark"></div>');
	 document.write(' ');
	 }  
for (var i = 1; i <= j; i++) {
     document.write('<div style="float:left;width:5px; height:8px; margin-right:3px; padding:0px; margin-top:2px; margin-bottom:0px; background-color: white;padding:0px;"></div>');
	 document.write(' ');
	 }
}

function setStarsDB(stars, skin, sum) {
var j = sum-stars	
for (var i = 1; i <= stars; i++) {
     document.write('<div style="float:left; width:5px; height:8px; margin-right:3px; padding:0px; margin-top:2px; margin-bottom:0px; background-color: #d5d5d5;"></div>');
	 document.write(' ');
	 }  
for (var i = 1; i <= j; i++) {
     document.write('<div style="float:left;width:5px; height:8px; margin-right:3px; padding:0px; margin-top:2px; margin-bottom:0px; background-color: #f2f2f2;padding:0px;"></div>');
	 document.write(' ');
	 }
}

function buildlink() {
    var to = "";
    var from = "";
	var link = "";
    if (document.getElementById('sel2').checked) {
        from = document.getElementById('from').value;
		to = document.getElementById('selection1').value;
		link = "http://reiseauskunft.bahn.de/bin/query.exe/dn?datesel=custom&searchMode=ADVANCED&REQ0JourneyStopsZA=1&REQ0JourneyStopsSA=1&selection=&REQ0JourneyStopsZG=" + escape(to) + "&REQ0JourneyStopsSG=" + escape(from);
    }
    if (document.getElementById('sel3').checked) {
		to = document.getElementById('to').value;
		from = document.getElementById('selection2').value;
		link = "http://reiseauskunft.bahn.de/bin/query.exe/dn?datesel=custom&searchMode=ADVANCED&REQ0JourneyStopsZA=1&REQ0JourneyStopsSA=1&selection=&REQ0JourneyStopsZG=" + escape(to) + "&REQ0JourneyStopsSG=" + escape(from);
    }
	if (document.getElementById('sel1').checked) {
		to = document.getElementById('sel1').value;
		link = "http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?input=" + escape(to) + "&productsFilter=1111111111";
    }
	document.getElementById('link').href = link;
}

