function _casinoru_inArray(mas, element) {
    for (var i = 0; i < mas.length; i++) {
      if (mas[i] == element) {
        return true;
      }
    }
    return false;
}
function _casinoru_toggle(etot) {
	if (document.getElementById('_casinoru_iframe').style.display == 'block') {	
		document.getElementById('_casinoru_iframe').style.display = 'none';
		return false;
	}
	document.getElementById('_casinoru_iframe').style.display = 'block';
	return false;
}
function _casinoru_over(etot, url) {
	document.getElementById('_casinoru_iframe').style.display = 'block';
	document.getElementById('_casinoru_iframe_').src = url;
	return false;
}
function _casinoru_out(etot) {
	document.getElementById('_casinoru_iframe').style.display = 'none';
	return false;
}
function _casinoru_ctr(c,s,code,category) {
	var server = 'casino.ru';
	var height=0;
	var width=0;
	if (category == undefined)
	    category = "casino";
	if (self.screen) {
    	// for NN4 and IE4
		width = screen.width
		height = screen.height
	}
	else if (self.java) {
    	// for NN3 with enabled Java
		var jkit = java.awt.Toolkit.getDefaultToolkit();
		var scrsize = jkit.getScreenSize();
		width = scrsize.width;
		height = scrsize.height;
	}
	//get client color depth
	var colors = screen.colorDepth;
	//get site ulr
	var site = document.location.href;
	//Get real IP 
	var ip = '';
	var left_or_right;

	// Get info	
	var counterIds = new Array("23", "24", "25", "26", "27", "28", "29", "30", "31", "32");
	var triangleIds = new Array("41", "42", "43", "44", "45", "46", "47", "48", "51", "52", "53", "54", "55", "56", "57", "58", "61", "62", "63", "64", "65", "66", "67", "68", "71", "72", "73", "74", "75", "76", "77", "78");
	if (_casinoru_inArray(counterIds, s)) {
		//	view counter
		if ((s >= 23) && (s <=27)) left_or_right = "left";
		else  left_or_right = "right";
		document.write('<div style="position: fixed ! important; bottom: 50px ! important; '+left_or_right+': 50px ! important; display: none;" id="_casinoru_iframe" ><iframe id="_casinoru_iframe_" width="230" height="180" frameborder="0" src="http://'+server+'/img/counter/'+c+'_'+s+'.html"></iframe></div>');
		document.write('<div style="position: fixed ! important; bottom: 0pt ! important; '+left_or_right+': 0pt ! important;">');
		document.write('<a href="http://'+server+'/online/'+category+'/'+code+'" onmouseover="return _casinoru_over(this,\'http://'+server+'/img/counter/'+c+'_'+s+'.html?&i='+c+'&t='+s+'&c='+colors+'&s='+width+'x'+height+'&p='+site +'\')" onmouseout="return _casinoru_out(this)" target="_blank"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.gif?&i='+c+'&t='+s+'&c='+colors+'&s='+width+'x'+height+'&p='+site +'" border=0></a>');
		document.write('</div>');
	} else {
		//	view counter
		if (_casinoru_inArray(triangleIds, s)) {
			document.write('<a href="http://'+server+'/online/'+category+'/'+code+'" target="_blank"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.gif?&i='+c+'&t='+s+'&c='+colors+'&s='+width+'x'+height+'&p='+site +'" border=0></a>');
		} else {
			document.write('<a href="http://'+server+'/online/'+category+'/'+code+'" target="_blank"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.png?&i='+c+'&t='+s+'&c='+colors+'&s='+width+'x'+height+'&p='+site +'" border=0></a>');
		}
	}
}
