//////////////////////////////////////
// Movie Control V 1.0
// By KB for Chabot for Congress 2008
// -> Will skip first frame of flashfeature if cookie is set
// -> If doesn't work, increase the value of SetTimeout
// -> Also will skip to frame with onclick 
// -> eg. <a href="#" onclick="sspLoadImage('1');">
// -> 0,1,2,3 = Frame choices
//
// Last Updated: 6/1/2008
/////////////////////////////////////////////////////////

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
	}

function sspLoadImage(imageNumber) {
	thisMovie("myContent").sspLoadImage(imageNumber);
	}

function set_cookie(name, value, exp_y, exp_m, exp_d, path, domain, secure) {
	var cookie_string = name + "=" + escape(value);
	if (exp_y) {
		var expires = new Date(exp_y, exp_m, exp_d);
		cookie_string += "; expires=" + expires.toGMTString();
	}
	if (path) {
		cookie_string += "; path=" + escape(path);
	}
	if (domain) {
		cookie_string += "; domain=" + escape(domain);
	}
	if (secure) {
		cookie_string += "; secure";
	}
	document.cookie = cookie_string;
}

function get_cookie(cookie_name) {
	var results = document.cookie.match("(^|;) ?" + cookie_name + "=([^;]*)(;|$)");
	if (results) {
		return unescape(results[2]);
	} else {
		return null;
	}
}

var x = get_cookie("videowatch");
	if (x) {
		// Found Cookie, Now Jump Slide
		//alert("cookie is already set."); //For debugging, removed on final
		setTimeout("sspLoadImage('4')",500);
	} else {
		// No Cookie, Set a New Cookie
		set_cookie("videowatch", "yes", 2008, 9, 15 );
	}
