// szm_mclient.js 20041209
// *.gamona.de :: Stand 22.02.2008
function mClientSZM(){

	this.cookie="gamona_szm_mc";
	this.id="gamona";
	this.url="http://mclient.ivwbox.de/cgi-bin/ivw/CP/0803/";

	this.check=function(hcode){
		if (this.getcookie() != hcode){
			this.request(hcode);
			this.setcookie(hcode);
		}
	}

	this.clear=function(){
		this.unsetcookie();
	}	

	this.request=function(hcode){
		var img = new Image();
		img.src = this.url+this.id+'/'+hcode;
	}
	
	this.getcookie=function(){
		var split = new Array();
		split = document.cookie.split(";");
		for(var i=0; i<split.length;i++){
			if(split[i].match(".*"+this.cookie+".*"))
				return (split[i].split("="))[1];
		}
		return "";
	}

	this.setcookie=function(code){
		document.cookie = this.cookie+"="+code;
	}
	
	this.unsetcookie=function(){
		document.cookie = this.cookie+"=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
}