 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) {
	//alert(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) {
// reimplementing.
	var server = 'casino.ru';
	var height=0;
	var width=0;
	if (category == undefined)
	    category = "online";
	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;
	//	document.write('s:'+s+',c:'+c+', ip:'+ip);
	//	document.write('w:'+width+',h:'+height+',c:'+colors);
	// Get info	
	
	document.write('<img src="http://'+server+'/finalize?&i='+c+'&t='+s+'&c='+colors+'&s='+width+'x'+height+'&p='+site+'&ip=&u=334455&k=">');
	var mas = new Array("23", "24", "25", "26", "27", "28", "29", "30", "31", "32");
	var masgif = new Array("41", "42", "43", "44", "45", "46", "47", "48", "51", "52", "53", "54", "55", "56", "57", "58");
	if (_casinoru_inArray(mas, 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+'/'+category+'/'+code+'" onmouseover="return _casinoru_over(this,\'http://'+server+'/img/counter/'+c+'_'+s+'.html\')" onmouseout="return _casinoru_out(this)"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.gif" border=0></a>');
		document.write('</div>');
  
	}
	else
	{
		//	view counter
		if (_casinoru_inArray(masgif, s))
		{
			document.write('<a href="http://'+server+'/'+category+'/'+code+'"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.gif" border=0></a>');
		}
		else
		{
			document.write('<a href="http://'+server+'/'+category+'/'+code+'"><img src="http://'+server+'/img/counter/'+c+'_'+s+'.png" border=0></a>');
		}
			
	}
}
