
function flashDetect(version) {
	if (navigator.plugins['Shockwave Flash']) {
		plugin_descr = navigator.plugins['Shockwave Flash'].description;
		return (parseInt(plugin_descr.substring(plugin_descr.indexOf(".") - 1)) >= version)
	}
	return false
}

function isFlash() {
	return !(navigator.userAgent.indexOf("iCab") != -1 || navigator.userAgent.indexOf("MSIE 3") != -1);
}

function ieFlashDetect(version) {
	//window.onerror = function() { return true; }
	return new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + version);
}

function flashEnable(version) {
	if (!isFlash()) return false;
	if (navigator.userAgent.indexOf("MSIE") != -1 &&
		navigator.userAgent.indexOf("Windows") != -1 &&
		navigator.userAgent.indexOf("Opera") == -1)
		return ieFlashDetect(version);
	return flashDetect(version);
}

function flashRegister(name) {
   var today = new Date();
   var expires = new Date();
   expires.setTime(today.getTime() + 1000*60*60*24*365);
   setCookie("flash", name, expires);
}

function setCookie(name, value, expire) {
   document.cookie = name + "=" + escape(value)
   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
   + "; path=/";
}

function getCookie(Name) {
	var search = Name + '=';
	if (document.cookie.length > 0) { // if there are any cookies
		offset = document.cookie.indexOf(search);
		if (offset != -1) { // if cookie exists
			offset += search.length;
			// set index of beginning of value
			end = document.cookie.indexOf(';', offset);
			// set index of end of cookie value
			if (end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		}
	}
	return '';
}

function isFlashDisabled() {
	return getCookie("flash_is") == "off";
}

function flashSettings(settings) {
	var today = new Date();
	var expires = new Date();
	expires.setTime(today.getTime() + 1000*60*60*24*365);
	setCookie("flash_is", settings, expires);
	document.location.reload();
}

var flashOFF='<IMG SRC="images/index_01.gif" WIDTH=780 HEIGHT=112 ALT="">';
var flashON ='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="780" HEIGHT="112" id="main" ALIGN="">  <PARAM NAME=movie VALUE="index_1.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="index_1.swf" menu=false quality=high bgcolor=#FFFFFF  WIDTH="780" HEIGHT="112" NAME="main" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';



