// JavaScript Document
	
	function setMediaSelectionAndMovie(strType, strQuality, boolLoadVideo){		
		
		document.getElementById("WmvLowLink").className= 'non_selectedMediaType';
		document.getElementById("WmvHighLink").className= 'non_selectedMediaType';
		document.getElementById("MovLowLink").className= 'non_selectedMediaType';
		document.getElementById("MovHighLink").className= 'non_selectedMediaType';
		
		if (strType == "wmv" && strQuality == "low")
			document.getElementById("WmvLowLink").className= 'selectedMediaType';
		if (strType == "wmv" && strQuality == "high")
			document.getElementById("WmvHighLink").className= 'selectedMediaType';
		if (strType == "mov" && strQuality == "low")
			document.getElementById("MovLowLink").className= 'selectedMediaType';
		if (strType == "mov" && strQuality == "high")
			document.getElementById("MovHighLink").className= 'selectedMediaType';
			
		//This is the area where we should set some cookies
		SetVideoCookie("VideoMediaType", strType);
		SetVideoCookie("VideoMediaQuality", strQuality);
		
//			alert(ReadVideoCookie("VideoMediaType") + "  " + ReadVideoCookie("VideoMediaQuality") + "  " + ReadVideoCookie("VideoIDToPlay"));
		if (boolLoadVideo && ReadVideoCookie("VideoIDToPlay").length > 0 && ReadVideoCookie("VideoIDToPlay") != ";") {
			//alert(ReadVideoCookie("VideoIDToPlay"));
			video_iframe.location="video_iframe.asp?id=" + ReadVideoCookie("VideoIDToPlay");
		}
		return false;
	}
	
	function SetVideoCookie(strName, strValue) {
		var today = new Date();
		var expire = new Date();
		expire.setTime(today.getTime() + 3600000*24*90); //expires in 90 days
		document.cookie = strName + "="+escape(strValue)+ ";expires="+expire.toGMTString();
	}

	function ReadVideoCookie(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));
	}