<!--
function setCookie (name, field, value)
{
	var cookie = new Array();

	cookie = getCookie(name);
	if (cookie.length > 0 )
	{
		chip = replaceCookieValue (cookie, field, value)
		var cookieString = escape (name) + "=" + escape (chip);
	}
	else
	{
		// Build the set-cookie string:
		var chip = field + "=" + value + "|";
		var cookieString = escape (name) + "=" + escape (chip);
	}
	
	// Build the expiration date string:
	var expiration_date = new Date ();
	expiration_date . setYear (2020);
	expiration_date = expiration_date . toGMTString ();

	cookieString += "; expires=" + expiration_date;
	cookieString += "; path=/";
	cookieString += "; domain=.qvc.de";

	// Create/update the cookie:
	document.cookie = cookieString;
}

function getCookie(name)
{
	// load the cookies into a variable and unescape it
	var allCookies = document.cookie;

	var brokenCookie = new Array();
	
	allCookies = unescape(allCookies);

	// separate the cookies into an array
	var singleCookie = allCookies.split(";");

	// Search for cookie name
	start_pos = 0;
	for (var i = 0; i < singleCookie.length; i++)
	{
	    var end_pos = singleCookie[i].indexOf("=");
	    if (singleCookie[i].substring(start_pos, end_pos) == name)
	    {
	        brokenCookie = singleCookie[i].substr(end_pos+1);
	        break;
	    }
	    start_pos = 1;
	}

	var fieldValuePairs = new Array();
	if (brokenCookie.length > 0 )
	{
	    // break each name:value pair into an array
	    var fieldValuePairs = brokenCookie.split("|");
	}

	return fieldValuePairs;
}

function replaceCookieValue (cookieArray, name, value)
{
	var the_info = new Array();
	var property_value = "";
	var cookieString = new String();
	var nameFound = 0;

	for (var loop = 0; loop < cookieArray.length - 1; loop++)
	{
		property_value = cookieArray[loop];

		var broken_info = property_value.split("=");

		if (broken_info[0] == name)
		{
		    cookieArray[loop] = broken_info[0] + "=" + value;
		    nameFound = 1;
		}
		cookieString = cookieString + cookieArray[loop] + "|";
	}
	
	if (nameFound == 0)
	{
		cookieString = cookieString + name + "=" + value + "|";
	}

	return cookieString;
}

function getCookieValue(name, field)
{
	var value = "";
	var cookie = getCookie(name);
	
	if (cookie.length > 0)
	{
		var brokenCookie = "";
		
		for (var loop = 0; loop < cookie.length; loop++)
		{
			brokenCookie = cookie[loop];
			var crumb = brokenCookie.split("=");
			
			if (crumb[0] == field)
			{
				value = crumb[1];
			}
		}
	}
	
	return value;
}

function ThumbnailsOn ()
{
        var thumbnails = getCookieValue("QPV", "THUMBNAILS");
        if (thumbnails == "ON")
        {
        	return 1;
        }
        else if (thumbnails == "OFF")
        {
        	return 0;
        }
        else
	{
		setCookie ("QPV", "THUMBNAILS", "ON");
		return 1;
	}
}

function updateThumbnails (frameName, type, thumbnailsonoff, numPage)
{
	thumbnailsonoff = (thumbnailsonoff == "ON") ? "OFF" : "ON";
	setCookie("QPV", "THUMBNAILS", thumbnailsonoff);
	
	pageNextPrev (frameName, type, thumbnailsonoff, numPage);
}



function pageNextPrev (frameName, type, thumbnailonoff, numPage)
{
	if (type == 'full')
	{
		document.location = 'f'+ frameName + '_' + thumbnailonoff + numPage + '.html';
	}
	else if (type == 'sub')
	{
		document.location = 'fprod'+ frameName + '_' + thumbnailonoff + numPage + '.html';
	}
}

function changePage(numTotalPages)
{
	var url = new String(document.location);
	var pageNumHeader = 0;
	var pageNumFooter = 0;

	if (url.search(/fprod/) != -1)
	{
		var oldPageNum = url.replace(/.*(\d)\.html/, "$1");
	}
	else
	{
		var oldPageNum = url.substring(url.search(/\d/), url.search(/\.html/));
	}
	
	for (var numForm = 0; numForm < document.forms.length; numForm++)
	{
		if (document.forms[numForm].name == "frmPaging")
		{
			var value = document.forms[numForm].elements[0].value;
			if (value != oldPageNum)
			{
				if (value > numTotalPages)
				{
					location = url.replace(/(.*)\d{1,2}\.html/, "$1" + numTotalPages + ".html");
				}
				else
				{
					location = url.replace(/(.*)\d{1,2}\.html/, "$1" + value + ".html");
				}
			}
		}
	}
}

function spawnLink(theURL) {
	open (theURL, "main");
}

function multiLink(drillDownURL, mainURL, bannerCode, sidebarNavURL, parentURL, emergencyURL ) {

	//if ((parent.sidebar_drilldown == null) || (parent.main == null) || (parent.sidebar_navigation == null))
	//{
	//	top.location = "http://www.qvc.de";  // emergencyURL
	//	return;
	//}

	SetMastHeadImages (bannerCode);

	var flag = mainURL.search(/THUMBNAILS/);
	if (flag != -1)
	{
            if (ThumbnailsOn())
            {
                mainURL = mainURL.replace(/THUMBNAILS/, "_on1");
            }
            else
            {
                mainURL = mainURL.replace(/THUMBNAILS/, "_off1");
            }
        }

	if( parentURL != "" )
	{
		// set the parent frame...
		parent.location = parentURL;
		return;
	}

	if( (sidebarNavURL != "") && (parent.sidebar_navigation != null) )
	{
		// set the toolbox
		parent.sidebar_navigation.location = sidebarNavURL;
	}
		
	if( (mainURL != "") && (parent.main != null) )
	{	
		// set the main target
		parent.main.location = mainURL;
	}
	
	// setting the sidebar_drilldown location tag will kill the data in 
	// this frame.  Set this frame last for those lame browsers that blow
	// away the JavaScript before executing all of it...
	if( (drillDownURL != "") && (parent.sidebar_drilldown != null) )
	{
		// set the drilldown frame
		parent.sidebar_drilldown.location = drillDownURL;
	}
	
}
function SetMastHeadImages( mastHeadCode )
{	
	// This function no longer used.
}	

function isRealBrowser()
{		
	if ((navigator.userAgent.indexOf("MSIE 3") != -1) || (navigator.userAgent.indexOf("Mozilla/2") != -1))
	{
		return false;
	}

	return true;
}
// -->

