/* Java Script for IMDS Services       */
/* Date: 7th July 2003 - Peter Seitner */


// Open IMDS Login Window
function openWindow(dateiname,fenstername,breite,hoehe,sx,sy) {
  var fenster = window.open (dateiname, fenstername, "resizable=yes,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,width="+breite+",height="+hoehe+",left="+sx+",top="+sy+"");
  fenster.focus();
}

// Jump into Page
function surfto(form) {
  var myindex=form.select1.selectedIndex
  if (form.select1.options[myindex].value != "0") {
  location=form.select1.options[myindex].value;}
}

//Calculate the price of IMDS-AI levels
function calculateSum(level){
	// get path from selected elements
	var tariffElement = eval("document.orderAI.tariff" + level);
	var priceElement  = eval("document.orderAI.price" + level);
	var sumElement    = eval("document.orderAI.sum" + level);
	
	// Get value from selected element
	var quantity = tariffElement.value; 
	var price    = priceElement.value; 
	
  // caculate Sum
	var sum = quantity * price;
	sumElement.value = sum;
	  
	// calculate Total Sum
	if (document.orderAI.sumZ){ // consulting
	  document.orderAI.totalSum.value = eval(document.orderAI.sumZ.value)
  }
	
	if (document.orderAI.sumF){
		document.orderAI.totalSum.value = eval(document.orderAI.sumA.value)+
																			eval(document.orderAI.sumB.value)+
																			eval(document.orderAI.sumC.value)+
																			eval(document.orderAI.sumD.value)+
																			eval(document.orderAI.sumE.value)+
																			eval(document.orderAI.sumF.value);
  }
	else{
	  document.orderAI.totalSum.value = eval(document.orderAI.sumA.value)+
																			eval(document.orderAI.sumB.value)+
																			eval(document.orderAI.sumC.value)+
																			eval(document.orderAI.sumD.value)+
																			eval(document.orderAI.sumE.value);
  }																		
		                              
}

function hideCreditCardInformation(){           
  if (document.getElementById){
    document.getElementById("creditCardInformation").style.visibility="hidden";
    document.getElementById("creditCardInformation").style.display="none"; 
    document.getElementById("invoiceInformation").style.display="inline";
    document.getElementById("invoiceInformation").style.visibility="visible";   
    document.order.payType[0].checked = true; 
    document.order.payType[1].checked = false;         
  }
}
function hideInvoiceInformation(){
  if (document.getElementById){           
    document.getElementById("invoiceInformation").style.visibility="hidden";
    document.getElementById("invoiceInformation").style.display="none";
    document.getElementById("creditCardInformation").style.display="inline"; 
    document.getElementById("creditCardInformation").style.visibility="visible";  
    document.order.payType[0].checked = false; 
    document.order.payType[1].checked = true;         
  }
}
function initCreditCardInfo(){
  if (document.order.payType[1].checked == true){
    hideInvoiceInformation();
  }
  else {
    hideCreditCardInformation();
  }  
}
function initArray() {
   this.length = initArray.arguments.length;
   for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
}																  
  																	  
	


