//------------------------------ COOKIE START
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	var today = new Date();
	today.setTime( today.getTime() );

	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}

	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}

	if ( start == -1 ) return null;

	var end = document.cookie.indexOf( ";", len );

	if ( end == -1 ) end = document.cookie.length;
	
	return unescape( document.cookie.substring( len, end ) );
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
//------------------------------ COOKIE END

if (typeof deconcept == "undefined") var deconcept = new Object();
if (typeof deconcept.util == "undefined") deconcept.util = new Object();
if (typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();

deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}

deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}

function checkCookie() {
	Set_Cookie( 'test', 'none', '', '/', '', '' );
	if ( Get_Cookie( 'test' ) )
	{
		Delete_Cookie('test', '/', '');
		return 1;
	}
	else
	{
		return 0;
	}
}

function getTimeZone() {
	var visitortime = new Date();
	if(visitortime)
		return visitortime.getTimezoneOffset()/60;
		else
		return '';
}

function getParam() {

	var installedVer = deconcept.SWFObjectUtil.getPlayerVersion();

	line = new String();
	paramscreen = window.screen;
	if(window.screen) line = '&scr='+paramscreen.width+'x'+paramscreen.height+'&colorbit='+paramscreen.colorDepth;
	if(navigator.javaEnabled()) var j=1;
	line += '&f='+installedVer.major+'&j='+j;
	if(document.all || document.layers) line += '&java='+navigator.javaEnabled();
	line+= '&cookie='+checkCookie();
	line+= '&timezone='+getTimeZone();
	var language=(navigator["language"])?navigator["language"]:navigator["userLanguage"];
	line+= '&language='+language.substr(0,2)
	line+= '&language2='+language.substr(3,2);
//	alert(line);
	return line;
}
//getParam();



var cms_url=new String('http://cms.colormultimedia.com/statistics.php?id=0&stat_account='+stat_account+'&idref=' + escape(document.referrer) + '&'+ getParam());
var cms_image = new Image(1,1);
cms_image.src = cms_url;
