
/* START ProduktPortlet Funktionen */

/*function setPortletSectionHeight(divIDPart){
			
	document.getElementById("master" + divIDPart).style.height = document.getElementById("slave" + divIDPart).offsetHeight;
	document.getElementById("slave" + divIDPart).style.display = "none";
}

function showDiv (divIDPart){
	if (document.getElementById("master" + divIDPart) != null && document.getElementById("slave" + divIDPart) != null){
		document.getElementById("master" + divIDPart).style.display = "none";
		document.getElementById("slave" + divIDPart).style.display = "block";	
		//window.setTimeout("show("+ divIDPart +")", 1000);
	}
}
function show(divIDPart){
	document.getElementById("master" + divIDPart).style.display = "none";
	document.getElementById("slave" + divIDPart).style.display = "block";
}

function hideDiv (divIDPart){
	if (document.getElementById("master" + divIDPart) != null && document.getElementById("slave" + divIDPart) != null){
		document.getElementById("master" + divIDPart).style.display = "block";
		document.getElementById("slave" + divIDPart).style.display = "none";
		//window.setTimeout("hide("+ divIDPart +")", 1000);		
	}
}

function hide(divIDPart){
	document.getElementById("master" + divIDPart).style.display = "block";
	document.getElementById("slave" + divIDPart).style.display = "none";
}*/

function showMasterDiv (divIDPart){
	document.getElementById("master" + divIDPart).style.display = "inline";
	document.getElementById("slave" + divIDPart).style.display = "none";
}

function hideMasterDiv (divIDPart){
	document.getElementById("master" + divIDPart).style.display = "none";
	document.getElementById("slave" + divIDPart).style.display = "inline";
}

var oldDivIDPart;
function showSlaveDiv (divIDPart){
	
	if (oldDivIDPart != divIDPart){
		document.getElementById("slave" + divIDPart).style.display = "block";
		if (oldDivIDPart != undefined){
			document.getElementById("slave" + oldDivIDPart).style.display = "none";
		}
		oldDivIDPart = divIDPart;
	}
}

function hideSlaveDiv (divIDPart){
	document.getElementById("slave" + divIDPart).style.display = "none";
}

/* ENDE ProduktPortlet Funktionen */



function EnablePrintIcon()
{			
	if(imgPrint) imgPrint.src = "/siemensvdo_mcms/xt_images/footer_print.gif";
	return true;			
}
function DisablePrintIcon()
{				
	if(imgPrint) imgPrint.src = "/siemensvdo_mcms/xt_images/footer_print_grey.gif";
	return true;
}		
function EnableMailIcon()
{			
	if(imgMail) imgMail.src = "/siemensvdo_mcms/xt_images/footer_mail.gif";
	return true;			
}			
function DisableMailIcon()
{
	if(imgMail) imgMail.src = "/siemensvdo_mcms/xt_images/footer_mail_grey.gif";
	return true;
}

function OpenFleetAnimation()
{
	window.open('/FleetAnimation/FleetAnimation.aspx','', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
}

function OpenFMWeb()
{
	window.open('/FleetAnimation/fmweb.htm','', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
}

function OpenPrintWindow()
{
	if(iPrint==1)
	{
		window.open(GetPrintUrl(),'', 'resizable=no,width=632,menubar=yes,status=no,scrollbars=yes,toolbar=no,height=650');
	}
	return false;
}
function OpenEmailWindow()
{
	if(iEmail==1)
	{
		window.open(GetEmailUrl(),'', 'resizable=no,width=460,menubar=no,status=no,scrollbars=no,toolbar=no,height=500');
	}
	return false;
}

function OpenZoomImage(url, description)
{
	window.open(GetZoomImageUrl(url,description),'', 'resizable=no,width=621,menubar=no,status=no,scrollbars=no,toolbar=no,height=525');
	
	return false;
}

function OpenZoomVideo(url, description)
{
	window.open(GetZoomVideoUrl(url,description),'', 'resizable=no,width=480,menubar=no,status=no,scrollbars=no,toolbar=no,height=376');
	
	return false;
}

function GetZoomImageUrl(url, description)
{
	var locationString = location.href;
	var qPos = locationString.indexOf('?')
	var sUrl = '';	
	var stargetLocation = '';
	if (qPos>=0)
	{
		sUrl = locationString.substring(0, qPos);
	}
	else
	{		
		sUrl = locationString;
	}
	sUrl = sUrl.replace('http://','');		
	pPos = sUrl.indexOf('/');
	if (pPos>=0){
		targetLocation = "http://" + sUrl.substring(0,pPos) + "/siemensvdo_mcms/Templates/zoomImage.aspx" + "?url=" + url + "&description=" + description;
	}
	
	return targetLocation;
}

function GetZoomVideoUrl(url, description)
{
	var locationString = location.href;
	var qPos = locationString.indexOf('?')
	var sUrl = '';	
	var stargetLocation = '';
	if (qPos>=0)
	{
		sUrl = locationString.substring(0, qPos);
	}
	else
	{		
		sUrl = locationString;
	}
	sUrl = sUrl.replace('http://','');		
	pPos = sUrl.indexOf('/');
	if (pPos>=0){
		targetLocation = "http://" + sUrl.substring(0,pPos) + "/siemensvdo_mcms/Templates/videopopup.aspx" + "?largeVideoPath=" + url + "&description=" + description;
	}
	
	return targetLocation;
}

function GetVirtualRoot()
{
	var locationString = location.href;
	var qPos = locationString.indexOf('?')
	var sUrl = '';	
	var stargetLocation = '';
	if (qPos>=0)
	{
		sUrl = locationString.substring(0, qPos);
	}
	else
	{		
		sUrl = locationString;
	}
	sUrl = sUrl.replace('http://','');		
	pPos = sUrl.indexOf('/');
	if (pPos>=0){
		targetLocation = "http://" + sUrl.substring(0,pPos) + "/siemensvdo_mcms/";
	}
	//alert("targetLocation "+targetLocation);
	return targetLocation;
}



function GetEmailUrl()
{
	var locationString = location.href;
	var qPos = locationString.indexOf('?')
	var sUrl = '';	
	var stargetLocation = '';
	if (qPos>=0)
	{
		sUrl = locationString.substring(0, qPos);
	}
	else
	{		
		sUrl = locationString;
	}
	sUrl = sUrl.replace('http://','');		
	pPos = sUrl.indexOf('/');
	if (pPos>=0){
		targetLocation = "http://" + sUrl.substring(0,pPos) + "/siemensvdo_mcms/Templates/EmailPage.aspx" + "?Url=" + sUrl;
	}
	
	return targetLocation;
}
function GetPrintUrl()
{

	var locationString = location.href;
	var qPos = locationString.indexOf('?')
	var targetLocation = '';
	if (qPos>=0)
	{
		var rPos = locationString.indexOf('#');
		if (rPos>0)
		{
			targetLocation = locationString.substring(0, locationString.length - 1) +  '&print=true#';
		}
		else
		{
			targetLocation = locationString + '&print=true';
		}
	}
	else
	{
		targetLocation = locationString + '?print=true';
	}
	return targetLocation;
}
function RedirectToBlank(ddl) {
	if(ddl.selectedIndex>0)
		window.open(ddl.options[ddl.selectedIndex].value,'_blank','');
		WT_CountryRedirectTracking(ddl); 
	return false;
}

function SubmitOnEnter(btn, e)
{
	if (e.keyCode == 13)
	{
		btn.click();
		if (e.stopPropagation) e.stopPropagation();
		if (window.event)
		{	window.event.cancelBubble = true;
			window.event.returnValue = false;
		}
	}
}

