var pollPeriode 	= 10;

$(document).ready(initWindow);

function url_aendern (url) 
{
	if (parent.opener && parent.opener.location)
	{
		parent.opener.location.href=url;
		parent.opener.focus();
	}
	else
		qvc_gross = window.open(url, "qvc_gross");
}

function go_to_cur_product() 
{

	if (parent.opener && parent.opener.location)
	{
		parent.opener.location.href= window.cur_prod_link;
		parent.opener.focus();
	}
	else
		qvc_gross = window.open( window.cur_prod_link, "qvc_gross" );
}

function initWindow()
{
	//window.resizeTo(985,674);
        document.domain = "qvc.de";
	initLinks();
	window.setInterval("checkForNewData()", pollPeriode*1000 );
}

function checkForNewData()
{
	$.ajax({
		url: "data/cached-16_9.html",
		ifModified: true, //reload unless server sends HTTP 304
		success: updateProducts
		});
}

function updateProducts(data, textStatus){
	$("#productList").html(data);
	initLinks();
}

function initLinks()
{
	if (iqvcid) $("#productList a").each(function(i,n){n.href += ".iqvcid." + iqvcid});
}

