/* Form Script */
function make_p_choice()
{
  var val = 0;
  for( i = 0; i < document.forms['search'].ixp.length; i++ )
  {
    if( document.forms['search'].ixp[i].checked == true )
    {
      val = document.forms['search'].ixp[i].value;
      if((val=='pauschal') || (val=='all_incl_p') || (val=='club') || (val=='family') || (val=='sport') || (val=='katalog') || (val=='wellness'))
      {
        jsvar='P';
        document.forms['search'].typ.value = jsvar;
        document.forms['search'].vpc.disabled=false;
        document.forms['search'].stc.disabled=false;
        document.forms['search'].hmi.disabled=false;
        document.forms['search'].bsd.disabled=false;
        document.forms['search'].htn.disabled=false;
        document.forms['search'].mmc.disabled=false;
      }
    }
  }
}
function make_e_choice()
{
  var val = 0;
  for( i = 0; i < document.forms['search'].ixp.length; i++ )
  {
    if( document.forms['search'].ixp[i].checked == true )
    {
      val = document.forms['search'].ixp[i].value;
      if((val=='hotel') || (val=='all_incl_h') || (val=='club') || (val=='family') || (val=='sport') || (val=='wellness'))
      {
        jsvar='H';
        document.forms['search'].typ.value = jsvar;
        document.forms['search'].vpc.disabled=false;
        document.forms['search'].stc.disabled=false;
        document.forms['search'].hmi.disabled=true;
        document.forms['search'].bsd.disabled=false;
        document.forms['search'].htn.disabled=false;
        document.forms['search'].mmc.disabled=false;
      }
    }
  }
}
function make_choice()
{
  var val = 0;
  for( i = 0; i < document.forms['search'].ixp.length; i++ )
  {
    if( document.forms['search'].ixp[i].checked == true )
    {
      val = document.forms['search'].ixp[i].value;
      if(val=='charter') {
        jsvar='N';
        document.forms['search'].typ.value = jsvar;
        document.forms['search'].vpc.disabled=true;
        document.forms['search'].stc.disabled=true;
        document.forms['search'].hmi.disabled=false;
        document.forms['search'].bsd.disabled=false;
        document.forms['search'].htn.disabled=true;
        document.forms['search'].mmc.disabled=false;
      }
      else if(val=='oneway') {
        jsvar='O';
        document.forms['search'].typ.value = jsvar;
        document.forms['search'].vpc.disabled=true;
        document.forms['search'].stc.disabled=true;
        document.forms['search'].hmi.disabled=false;
        document.forms['search'].bsd.disabled=true;
        document.forms['search'].htn.disabled=true;
        document.forms['search'].mmc.disabled=true;
      }
    }
  }
}
/* Form Script End */

/* Change VPC Script */
function changeVPC()
{
  var val = 0;
  for( i = 0; i < document.forms['search'].ixp.length; i++ )
  {
    if( document.forms['search'].ixp[i].checked == true )
    {
      val = document.forms['search'].ixp[i].value;
      if((val=='all_incl_p') || (val=='all_incl_h')) {
        jsvar='AI';
        document.forms['search'].vpc.value = jsvar;
        document.forms['search'].vpc.disabled=false;
      } else {
        jsvar='';
        document.forms['search'].vpc.value = jsvar;
      }
    }
  }
}
/* Change VPC Script End */

/* Date Script */
DatArray = new Array("So","Mo","Di","Mi","Do","Fr","Sa","??" )

function GetDate(offset)
{ 
var time = new Date()
time.setTime( time.getTime()+offset*86400000);
day   = time.getDate();
month = time.getMonth()+1;
year  = time.getYear() % 100;
if (day   < 10) day   = "0"+day;
if (month < 10) month = "0"+month;
if (year  < 10) year  = "200"+year;
return day+'.'+month+'.20'+year;
}

function changeDate() {
  var varDate = document.getElementById('vnd').selectedIndex;
  document.getElementById('bsd').options[parseInt(varDate)+30].selected = 'selected';
}

function set_VND() {
  document.write("<select onchange='changeDate()' id='vnd' name='vnd' class='setVND'>")
  for (var i=1; i<=300;i++) {
    document.write('<option value='+i+'>'+GetDate(i)+'')
  }
  document.write("</select>");
}

function set_BSD() {
  document.write("<select id='bsd' name='bsd' class='setBSD'>")
  document.getElementById('vnd').options[document.getElementById('vnd').selectedIndex].value
  for (var i=1; i<=365;i++) {
    if (i==30) document.write('<option selected ');
    else document.write('<option ');
    document.write('value='+i+'>'+GetDate(i)+'')
  }
  document.write('</select>')
}
/* Date Script End */

/* External Script */
function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  
window.onload = externalLinks;
/* External Script End */

