function jumpToLink(sender)
{
    if (sender.value != "") location.href=sender.value;
}

function EnablePrintIcon()
{			
	if(imgPrint) imgPrint.src = "/coremedia/css/dtco/img/footer_print.gif";
	return true;			
}
function DisablePrintIcon()
{				
	if(imgPrint) imgPrint.src = "/coremedia/css/dtco/img/footer_print_grey.gif";
	return true;
}		
function EnableMailIcon()
{			
	if(imgMail) imgMail.src = "/coremedia/css/dtco/img/footer_mail.gif";
	return true;			
}			
function DisableMailIcon()
{
	if(imgMail) imgMail.src = "/coremedia/css/dtco/img/footer_mail_grey.gif";
	return true;
}

function OpenTisWebPromo(countrycode)
{
	//if (countrycode == 'de' || countrycode == 'gb')
		window.open('/tiswebpromo/tiswebpromo.aspx?cc='+countrycode,'', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
	/*else
		window.open('/tiswebpromo/tiswebpromo.aspx?cc='+countrycode,'', 'width=650, height=512, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
	*/
}
function OpenTisWebStarterKitPromoArchiv(countrycode)
{
	window.open('/tiswebpromo/TisWebStarterKitPromoArchiv.aspx?cc='+countrycode,'', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
}

function OpenTisWebPromoArchiv(countrycode)
{
	window.open('/tiswebpromo/tiswebpromoarchiv.aspx?cc='+countrycode,'', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
}

function OpenTisWebPromoDownload(countrycode)
{
	window.open('/tiswebpromo/tiswebpromodownload.aspx?cc='+countrycode,'', 'width=796, height=517, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no');
}

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 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) + "/dtco_mcms/Templates/zoomImage.aspx" + "?url=" + url + "&description=" + description;
	}
	
	return targetLocation;
}

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 OpenGlossaryWindow(site)
{
	if ((location.href.indexOf("/NR/exeres/") == -1) && (location.href.indexOf("https://") == -1))
	{
		WT_ServiceSupportTracking(site);
		
		if ((site.indexOf("glossary") != -1)||(site.indexOf("Glossary") != -1))
		{
			window.open(site,'');
			//window.open(site+'?print=true','', 'resizable=no,width=632,menubar=yes,status=no,scrollbars=yes,toolbar=no,height=650');
		}
		else
		{
			location.href = site;
		}
	}
}
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) + "/dtco_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','');
	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;
		}
	}
}

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 GetZoomVideoUrl(url, description)
{
	return url+ "&description=" + 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) + "/dtco_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) + "/";
	}
	//alert("targetLocation "+targetLocation);
	return targetLocation;
}

