/*********************************
Show and Hide Snippet-Blocks on the right side
**********************************/
function toggleMe(a,b,c){
  var e=document.getElementById(a);
  var f=document.getElementById(b);
  var image=document.getElementById(c);
  if(!e || !f)return true;
  if(e.style.display=="none"){
    e.style.display="block" ;
    f.style.display="none";
    image.src="/cz/img_structure/NavArrowWhiteDown_rdax_11x9.gif";
  } else {
    e.style.display="none";
    f.style.display="block";
    image.src="/cz/img_structure/NavArrowWhiteUp.gif";
  }
  return true;
}
 
/*********************************
Preload Images - EUKR
**********************************/

var myimages=new Array();
function preloadimages()
{
    for (i=0;i<preloadimages.arguments.length;i++)
    {
        myimages[i]=new Image()
        myimages[i].src=preloadimages.arguments[i]
    }    
}



/*********************************
Corporate Contact XSL
**********************************/
 function ReloadWithParameters(sParameters)
    {
        sLocation = location.href;
        sSplittedArray = sLocation.split("?");
        sUrl = sSplittedArray[0];        
        location.href = sUrl + sParameters;
    }
 
function checkRadioStatus() {
  if (document.serviceCenter.transportTyp[0].checked == true) {
    return document.serviceCenter.transportTyp[0].value;
  } else if (document.serviceCenter.transportTyp[1].checked == true) {
    return document.serviceCenter.transportTyp[1].value;
  } else if (document.serviceCenter.transportTyp[2].checked == true){
    return document.serviceCenter.transportTyp[2].value;
  }
}

/*********************************
Show and hide teaserblocks - EUKR
**********************************/

function jopen(id1){
document.getElementById(id1).style.display='block';
}
function jclose(id1){
document.getElementById(id1).style.display='none';
}
 
/*********************************
Track & Trace function
**********************************/
//iSISLight Suche mitEingabetaste starten nur IE
function fiSISLightEingabetaste()
{
   if(window.event.keyCode == 13)
     {
      fISISLight();
     }
}


function fISISLight() 
{ 
 var isAbsender="true"; 
 if (document.transmissionSearch.Absender[1].checked) { 
  isAbsender="false"; 
 } 
  
  if (document.transmissionSearch.Auftragsnummer.value.length > 2) 
  { 
    if (document.transmissionSearch.Auftragsname.value.length > 1) 
    { 
      window.open('http://isis.gw-world.com/siprod/sixWeb.pStartApp?i_vcAction=SearchConLight&i_vcSearchKey=' + document.transmissionSearch.Auftragsnummer.value + '&i_vcAdd=' + document.transmissionSearch.Auftragsname.value + '&i_vclangid=cz', 'ISISLight', 'width=995,height=600,top=0,left=0,toolbar=no,directories=no,status=yes,scrollbars=auto,resizable=yes,location=no,menubar=no');
    } 
    else 
    { 
     alert("Jméno musí obsahovat alespoň 2 znaky"); 
     document.transmissionSearch.Auftragsname.focus(); 
    } 
  } 
  else 
  { 
    alert("Číslo zakázky musí obsahovat alespoň 3 znaky"); 
    document.transmissionSearch.Auftragsnummer.focus(); 
  } 
}


function getElementsByClassName(classname,tag) {
 if(!tag) tag = "*";
 var anchs =  document.getElementsByTagName(tag);
 var total_anchs = anchs.length;
 var regexp = new RegExp('\\b' + classname + '\\b');
 var class_items = new Array()
 
 for(var i=0;i<total_anchs;i++) { //Go thru all the links seaching for the class name
  var this_item = anchs[i];
  if(regexp.test(this_item.className)) {
   class_items.push(this_item);
  }
 }
 return class_items;
}

/*** Settings Font Resize Faktor ***/
var raisefactor = 1.2;
var decreasefactor = 1.2;

/*** Settings Raisfactor End ***/
function changeContentFontSize(nameClass, thisElement, mode){
    var schriftgroesse = getElementsByClassName(nameClass, 'div')[0].style;
    if (schriftgroesse.fontSize==""){
        getElementsByClassName(nameClass, 'div')[0].style.fontSize="1em"
    }    
    if (mode=="raise"){
        if (schriftgroesse.fontSize.replace("em", '') < 1.3){
            schriftgroesse.fontSize = schriftgroesse.fontSize.replace("em", '') * raisefactor+'em';
            document.getElementById("decreaseButton").parentNode.style.visibility="visible";
            if (schriftgroesse.fontSize.replace("em", '')>1.3){
                thisElement.parentNode.style.visibility="hidden";
            }
        }
    }
    if (mode=="decrease"){
        if (schriftgroesse.fontSize.replace("em", '') > 1){
            schriftgroesse.fontSize = schriftgroesse.fontSize.replace("em", '') / decreasefactor+'em';
            document.getElementById('raiseButton').parentNode.style.visibility="visible";
            if (schriftgroesse.fontSize.replace("em", '')<1.2){
                thisElement.parentNode.style.visibility="hidden";
            }
        }
    }
 }

// gross Schrift
function changeContentFontSizegross(nameClass, thisElement ){
    var schriftgroesse = getElementsByClassName(nameClass, 'div')[0].style;
    
         // Schriftgroesse veraendern und Bild Icons ein/ausblenden            
            schriftgroesse.fontSize = schriftgroesse.fontSize="1.3em";                                 
            //document.getElementById('raiseButton').parentNode.style.visibility="visible";
            document.getElementById('grossF').style.display="block";
            document.getElementById('grossNF').style.display="none";
            
            document.getElementById('mittelF').style.display="none";            
            document.getElementById('kleinF').style.display="none";
            document.getElementById('mittelNF').style.display="block";
            document.getElementById('kleinNF').style.display="block";
 }
 
 // mittel Schrift
function changeContentFontSizemittel(nameClass, thisElement){
    var schriftgroesse = getElementsByClassName(nameClass, 'div')[0].style;
    
         // Schriftgroesse veraendern und Bild Icons ein/ausblenden            
            schriftgroesse.fontSize = schriftgroesse.fontSize="1.2em";                                            
            document.getElementById('mittelF').style.display="block";
            document.getElementById('mittelNF').style.display="none";
            document.getElementById('grossF').style.display="none";            
            document.getElementById('kleinF').style.display="none";
            document.getElementById('grossNF').style.display="block";
            document.getElementById('kleinNF').style.display="block";               
 }
  
 // klein Schrift
function changeContentFontSizeklein(nameClass, thisElement){
    var schriftgroesse = getElementsByClassName(nameClass, 'div')[0].style;
            schriftgroesse.fontSize = schriftgroesse.fontSize="1.0em";                                 
            document.getElementById('kleinF').style.display="block";
            document.getElementById('kleinNF').style.display="none";              
            
            document.getElementById('mittelF').style.display="none";            
            document.getElementById('grossF').style.display="none";
            document.getElementById('mittelNF').style.display="block";
            document.getElementById('grossNF').style.display="block";
 }


/*******************************
 Mautrechner oeffnen
*******************************/
function openMautRechner(Land, Sprache)
{
 var MeinFenster;
 MeinFenster = window.open("http://www.gw-world.com/mautcalc/appl/MautRechner?Sprache=" + Sprache + "&Land=" + Land + "&Source=internet", "MautRechnerFenster", "width=520,height=300,left=300,top=300");
 MeinFenster.focus(); 
}
/*******************************
iSIS / iWIS / iOrder Login
*******************************/

function fOpeniSISLogin()
{
  var OpeniSISLogin;
  OpeniSISLogin = window.open("http://solutions.inet-logistics.com/sso/ShowLogin.do?Lang=cz&Branding=gw-world.com", "iSISLogin", "width=1000,height=768,left=0,top=0, locatioon=no, toolbar=no, scrollbars=yes, menubar=no, status=no, resizable=yes, ");

  OpeniSISLogin.focus(); 
}

function fOpenRegistrierung()
{
  var OpenRegistrierung;
  OpenRegistrierung = window.open("http://solutions.inet-logistics.com/isis/ShowRegistration.do?Lang=cz&Branding=default", "SignIn", "width=1000,height=768,left=0,top=0, locatioon=no, toolbar=no, scrollbars=yes, menubar=no, status=no, resizable=yes, ");
  OpenRegistrierung.focus(); 
}

function openMautRechner(Land, Sprache)
{
    MeinFenster = window.open("http://www.gw-world.com/mautcalc/appl/MautRechner?Sprache=" + Sprache + "&Land=" + Land + "&Source=internet", "MautRechnerFenster", "width=520,height=300,left=300,top=300");
    MeinFenster.focus();
}

/**********************************************************************************************************************************************************************
Eurocargo auf RS
***********************************************************************************************************************************************************************/
function dialogPosition(layer,dialogWidth,dialogHeight)
{
    layer = document.getElementById(layer);
    if (layer){
        var browserWidth = document.getElementsByTagName("body")[0].offsetWidth;
        var browserHeight = document.getElementsByTagName("body")[0].offsetHeight;
        intXPosition = (browserWidth / 2) - (dialogWidth / 2);
        intYPosition = (browserHeight / 2) - (dialogHeight / 2);
        layer.style.left = intXPosition + "px";
        layer.style.top = intYPosition + "px";
        layer.style.width = dialogWidth + "px";
        layer.style.height = dialogHeight + "px";
        if (window.navigator.userAgent.indexOf("MSIE 6.0") > -1){
            MSIE6();
        }
    }
}
function MSIE6(){
    intBrowserHoehe = 1200;
    var objLayerUeberAlles = document.getElementById('overlay');
    objLayerUeberAlles.style.height = intBrowserHoehe;
}
function close(layer){
    document.getElementById(layer).style.display = "none";
    document.getElementById('overlay').style.display = "none";
}