function dFlash(fVer,xFlash,xHTML){ //(c) Vil
	var d=document;
	var plugin=(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;
	if(plugin){
		var words=navigator.plugins["Shockwave Flash"].description.split(" ");
		for(var i=0;i<words.length;++i){
			if(isNaN(parseInt(words[i])))continue;
			var pVer=words[i]
		}
		var CanPlay=pVer>=fVer
	}
	else if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(navigator.appVersion.indexOf("Win")!=-1)){
		d.write('<script language="VBScript">Function CanP()\non error resume next\nCanP=false\nCanP=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+fVer+'))\nEnd Function</script>')
		var CanPlay=CanP()
	}
	d.write((CanPlay)?xFlash:xHTML)

}




function checkFont(locale){
/*	if (navigator.appName.indexOf("Explorer") <= 0){
		if(getCookie("fontinstalled")!=1){
			if(window.confirm("Site e3e5.com uses chess font CA Chess. Press OK to get an instuctions.")){
				setCookie("fontinstalled",1,0,'/','');
				document.location.href= locale + '/fonts/';
			}
		}
	}
*/}

function setCookie(name, value, expires, path, domain, secure) 
{
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

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));      
		}    
	}
}




