var sDate = new Date();
var startTime = sDate.getTime();
var xferTime = 0;
var screenRes = '';

var cookies = document.cookie;
if (cookies.indexOf('HomePageLoadTime') == -1)
{
	document.cookie ='HomePageLoadTime=StartHPLTTimer; PATH=/; domain=.qvc.de';
}
function SetLoadTime() {
	var eDate = new Date();
	var endTime = eDate.getTime();
	var cookies = document.cookie;
	xferTime = endTime - startTime;
	screenRes = screen.width + 'x' + screen.height;
	if (cookies.indexOf('measured') == -1)
	{
		document.cookie ='HomePageLoadTime=' + xferTime + '~' + screenRes + '; PATH=/; domain=.qvc.de';
	}
}
// Login/Logout Funktionenen Anfang
function readCookie(name) {
  var ssplit = document.cookie.split(';');
  var getName = name + "=";
  for(var i=0; i < ssplit.length; i++) {
	var getCookie = ssplit[i];
	while (getCookie.charAt(0)==' ') getCookie = getCookie.substring(1, getCookie.length);
	if (getCookie.indexOf(getName) == 0) return getCookie.substring(getName.length, getCookie.length);
	}
  return null;
}

function CookieRead(name)
{
	var ssplit = document.cookie.split(';');
	var getName = name + "=";
	for(var i=0; i < ssplit.length; i++) {
	var getCookie = ssplit[i];
	while (getCookie.charAt(0)==' ') getCookie = getCookie.substring(1, getCookie.length);
	if (getCookie.indexOf(getName) == 0) return getCookie.substring(getName.length, getCookie.length);
	}
	return null;
}

function DeleteCookie( name, path, domain ) {
 
	if ( GetCookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
 
function GetCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&
	( name != document.cookie.substring( 0, name.length ) ) )
{
	return null;
}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
// Login/Logout Funktionenen Ende
// ###############################
// Begin ?
function link() 
	{ 
		query = document.suche.query.value; 
		query = escape(query);
		lang = query.length; 
		//Do we have a Session Id?	
		sessionParm = ""; 
		if (typeof RequestSessionIdQic != 'undefined')		// Session Id variable present? 
		{	
			if (RequestSessionIdQic.length > 0)		// Session Id contains a value? 
			{	
			sessionParm = "&iqvcid=" + RequestSessionIdQic;
			} 
		}
		if (typeof(arrStaticLinks[query]) == 'undefined')
		{ // Link nicht in der Liste vorhanden
		  parent.top.location.href= 'http://www.qvc.de/degasp/qicIsItemNumberRedirect.asp?search=SQ&fs=%2Fdegscripts%2Fddframesdesearch.tpl&frames=n&txtDesc=' + query + sessionParm;		
		} else
		{
		  parent.top.location.href = arrStaticLinks[query] + sessionParm;
		}
	}

function isRealBrowser() {
		if ((navigator.userAgent.indexOf("MSIE 3") != -1) || (navigator.userAgent.indexOf("Mozilla/2") != -1))
		{
			return false;
		}
		return true;
	}
	
	function ValidateSearchRequest(f) {
		//Check	if the Quick Search	form has a value
		if (f.query.value == "" || f.query.value == "Suchbegriff oder Artikelnummer")
			{
			//If we	got	here then the user clicked SEARCH without any entry
			/*alert ("Bitte geben Sie einen oder mehrere Suchbegriffe oder eine Artikelnummer ein, bevor Sie Ihre Suche starten.");*/
			document.suche.query.focus();
			document.suche.query.value = "Suchbegriff oder Artikelnummer";
			document.suche.query.className="suche_error";
			return false;
			}
	}
// ? Ende
// ###############################
// Begin Fenster öffnen allgemein
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// End Fenster öffnen allgemein
// ###############################
// Begin Fenster öffnen Livestream
function oeffnen (url) {
    livestream = window.open(url, "livestream", "width=976,height=474,left=100,top=100,resizable=yes,dependent=yes,location=no,menubar=no,status=no,toolbar=no");
    livestream.focus();
}
// End Fenster öffnen Livestream
// ###################################
// Begin Fenster öffnen Promotionvideo
	function open_window(url, specs, name) {
		if (name == null || name == "")
		{
			name = "win";
		}
			var new_win = window.open(url, name, specs);
			new_win.focus();
	}
// End Fenster öffnen Promotionvideo	



