﻿// JScript-Datei

function setdimension(packetID, Lenght, Width, Height, Weight)
{
    var metrics = document.getElementById(packetID).value;
    var dimension = metrics.split("|");
    
    if (dimension.length == 5)
    {
        document.getElementById(Lenght).value = dimension[1]
        document.getElementById(Width).value = dimension[2]
        document.getElementById(Height).value = dimension[3]
        document.getElementById(Weight).value = dimension[4]
        //alert(dimension[4]);
    }    
}

function dropdownSetNullValue (selBoxId, selectedvalue)
{
    if (selectedvalue == "0| | | |0")  // Auswahl auf freie Eingabe setzen
    {
       document.getElementById(selBoxId).selectedIndex = 0;
    }
}

function GetDetailsContainer(id) {
	return document.getElementById("details" + id.toString());
}   
           
function ShowDetails(id) {

    if (document.getElementById("hiddendetails" + id.toString()).value == 0)
        {
          document.getElementById("hiddendetails" + id.toString()).value = 2;
          Callback1.PerformCallback(id);
        }
	
	if (document.getElementById("hiddendetails" + id.toString()).value == 2)
	    {
          document.getElementById("tr1_details" + id.toString()).style.display = "";
          document.getElementById("tr2_details" + id.toString()).style.display = "";
          document.getElementById("details" + id.toString()).style.display = "block";
          document.getElementById("hiddendetails" + id.toString()).value = 1;
          document.getElementById("imgOpenClose" + id.toString()).src = "../../images/buttons/btn_detail_zu_13x19.gif"
        } 
    else 
        {
          document.getElementById("tr1_details" + id.toString()).style.display = "none";
          document.getElementById("tr2_details" + id.toString()).style.display = "none";
          document.getElementById("details" + id.toString()).style.display = "none";
          document.getElementById("hiddendetails" + id.toString()).value = 2;
          document.getElementById("imgOpenClose" + id.toString()).src = "../../images/buttons/btn_detail_auf_13x19.gif"
        }
        
} 
function showProductLayerDescription(id)
{
    Callback1.PerformCallback(id);
}

function getZusatzleistungen(id) {
	document.getElementById("ZusatzleistungRolle").style.display = "block";
	document.getElementById("ZusatzleistungInsurance").style.display = "block";
	
	if (( id==3002 && document.getElementById("chkCountry").value != "DEU") || id==3003 || id==3004 || (id==3007 && document.getElementById("chkCountry").value != "DEU")|| id==3008 ||id==3009)
	    {
	        document.getElementById("ZusatzleistungRolle").style.display = "none";	        
	    }
	    
	if (id==3000 || id==3005)
	    {
	        document.getElementById("ZusatzleistungInsurance").style.display = "none";
	    }
} 


function makePriceSelected(priceid)
{
    for (i=1; i<=10; i++)
    {
        if (document.getElementById("price" + i.toString()) != null )
        {
            document.getElementById("price" + i.toString()).className = "pricenormal";
        }
    }
    
    if (document.getElementById("price" + priceid.toString()) != null )
     {
        document.getElementById("price" + priceid.toString()).className = "pricebold";
     }
     
    if (document.getElementById("chkPriceInsurance") != null )
    {
        if (document.getElementById("chkPriceInsurance").value == 'True')
        {
            document.getElementById('priceInsurance').className = 'pricebold';
        }
        else
        {
            document.getElementById('priceInsurance').className = 'pricenormal';
        }
    }
    
    if (document.getElementById("chkPriceGoGreen") != null )
    {
        if (document.getElementById("chkPriceGoGreen").value == 'True')
        {
            document.getElementById('priceGoGreen').className = 'pricebold';
        }
        else
        {
            document.getElementById('priceGoGreen').className = 'pricenormal';
        }
    }
    
    if (document.getElementById("chkPriceRolle") != null )
    {
        if (document.getElementById("chkPriceRolle").value == 'True')
        {
            document.getElementById('priceRolle').className = 'pricebold';
        }
        else
        {
            document.getElementById('priceRolle').className = 'pricenormal';
        }
    }
    
    if (document.getElementById("chkPriceInsurance2500") != null )
    {
        if (document.getElementById("chkPriceInsurance2500").value == 'True' & document.getElementById("hidInsurance").value == 'True')
        {
            document.getElementById('priceInsurance2500').className = 'pricebold';
        }
        else
        {
            document.getElementById('priceInsurance2500').className = 'pricenormal';
        }
    }
    
    if (document.getElementById("chkPriceInsurance25000") != null )
    {
        if (document.getElementById("chkPriceInsurance25000").value == 'True')
        {
            document.getElementById('priceInsurance25000').className = 'pricebold';
        }
        else
        {
            document.getElementById('priceInsurance25000').className = 'pricenormal';
        }
    }
}