/*
Static Media Utilities - Check Cookie Funtion
Checks WBOL cookie for presence of WBOLMedia Cookie and properties

*******************************************************************************
Please do not edit or copy, if you have questions contact David Pedowitz
*******************************************************************************

REVISION HISTORY

12-19-01 Added speed check if speed is greater than 300000 that don't send to play page

*/

function checkWBOLMediaCookie(playPath) {
	var query = location.search;
	
	//Check to see if the cookie is set and parameter 'settings' wasn't passed to the page
	if(document.cookie.indexOf("WBOLMediaCookie") != -1 && query.indexOf("settings") == -1) {

		//get the part of the cookie we need
		var cookieInfo = document.cookie.substring(document.cookie.indexOf("WBOLMediaCookie"), document.cookie.length);

		//break our part of the cookie into type and speed
		var type = cookieInfo.substring(cookieInfo.indexOf("player=")+7, cookieInfo.indexOf("<!>speed"));
		var speed = cookieInfo.substring(cookieInfo.indexOf("speed=")+6, cookieInfo.indexOf("0<!>")+1);

		if (speed <= 300000) {
			//send the user to the play page with their settings
			location.replace(playPath + query + "&type=" + type + "&speed=" + speed);
		}
	}
}