function getCookie(name){
	if (document.cookie){
		var cookies = document.cookie.split(';');
		for (var i=0; i<cookies.length; i++){
			var varName = cookies[i].split('=')[0];
			var varValue = cookies[i].split('=')[1];
			while (varName.charAt(0) == ' '){
				varName = varName.substr(1, varName.length);
			}
			if (varName == name) return escape(varValue);
		}
	}
	return '';
}
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 writeFlash(mv, wd, ht, color, vars){
	var tmp = '';
	tmp += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\n';
	tmp += '\tcodebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"\n';
	tmp += '\tid="FlashPlayer" align="middle" width="' + wd + '" height="' + ht + '" />\n';
	tmp += '\t<param name="movie" value="' + mv + '" />\n';
	if (vars != null && vars != '')
		tmp += '\t<param name="flashVars" value="' + vars + '" />\n';
	tmp += '\t<param name="allowScriptAccess" value="sameDomain" />\n';
	tmp += '\t<param name="quality" value="high" />\n';
	tmp += '\t<param name="bgcolor" value="' + color + '" />\n';
	tmp += '\t<param name="wmode" value="opaque" />\n';
	tmp += '\t<embed quality="high" name="FlashPlayer" align="middle" allowScriptAccess="sameDomain" ' + ' \n';
	tmp += '\t\tsrc="' + mv + '" \n';
	if (vars != null && vars != '')
		tmp += '\t\tflashvars="' + vars + '" \n';
	tmp += '\t\tbgcolor="' + color + '" width="' + wd + '" height="' + ht + '" \n';
	tmp += '\t\ttype="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer">\n';
	tmp += '\t</embed>\n';
	tmp += '</object>\n';
	document.write(tmp);
}


