var strTarget 		= -1;
var strTargetID 	= -1;
var strSearch 		= document.location.search;
var cName			= 'flPlayer';

if(strSearch.indexOf('navhtml')>-1) {
	strSearch = strSearch.substring(1, strSearch.length);
	var arrSearch = strSearch.split("&");
	for (i=0; i<arrSearch.length; i++) {
		var strQuery = arrSearch[i];
		var arrQuery = strQuery.split("=");
		if (arrQuery[0] == "navhtml") {
			strTarget = arrQuery[1];
			SetCookie(cName,strTarget);
			document.location.href = document.location.href.replace('?navhtml=' + strTarget,'');
		}
	}
}	
else {
	var s_strTarget = ReadCookie(cName);
	if(s_strTarget.length>0) {
		strTarget = ReadCookie(cName);
		SetCookie(cName,'');
	}
	else {
		strTarget=-1;
	}
}


strTarget = (strTarget == -1) ? 0 : strTarget;

var corningFlash = new flashObject();
corningFlash.file = "lcdtv_main.swf";
corningFlash.width = 738;
corningFlash.height = 380;
corningFlash.containerId = "lcd_container";
corningFlash.flashId = "lcd";
corningFlash.flashvars = "navhtml=" + strTarget;
corningFlash.write();

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}