<!--
function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}

function MakeRequest(htmlfile,extension,resultId,loaderId,currency)
{
if (htmlfile == 'init'){ // US $
  var country = extension;
  extension = 'html';
  if (country == 'GB'){
    htmlfile = 'ajaxUK';
  currency = 'pound';
  }else{
    if ((country == 'US') || (country == 'CA')){
      htmlfile = 'ajaxUS';
  currency = 'usd';
    }else{
      htmlfile = 'ajaxEU';  // default    
  currency = 'euro';
    }
  }
}
if (htmlfile == 'initpoker'){  // UK , pound
  var country = extension;
  extension = 'html';
  if (country == 'GB'){
    htmlfile = 'pokerUK';
  currency = 'pound';
  }else{
    if ((country == 'US') || (country == 'CA')){
      htmlfile = 'pokerUS';
  currency = 'usd';
    }else{
      htmlfile = 'pokerEU';  // default    
  currency = 'euro';
    }
  }
}
if (htmlfile == 'initreview'){  // UK , pound
  extension = 'html';
  htmlfile = 'rev';
  currency = 'iew';
}

if (htmlfile == 'initslots'){ // EU  Euro
  var country = extension;
  extension = 'html';
  if (country == 'GB'){
    htmlfile = 'slotsUK';
  currency = 'pound';
  }else{
    if ((country == 'US') || (country == 'CA')){
      htmlfile = 'slotsUS';
  currency = 'usd';
    }else{
      htmlfile = 'slotsEU';  // default    
  currency = 'euro';
    }
  }
}
{

  var xmlHttp = getXMLHttp();
  document.getElementById(loaderId).style.visibility = 'visible';
    if (htmlfile ===''){
		if ( document.getElementById('butt_us').innerHTML.search(' Poker') != -1 ){  // if is XXPoker
			if (document.getElementById('butt_us').className === 'right_act'  )  {htmlfile = 'pokerUS'};
			if (document.getElementById('butt_uk').className === 'right_act'  )  {htmlfile = 'pokerUK'};
			if (document.getElementById('butt_eu').className === 'right_act'  )  {htmlfile = 'pokerEU'};
		}else if ( document.getElementById('butt_us').innerHTML.search(' Slots') != -1 ){  // if is XXSlots
			if (document.getElementById('butt_us').className === 'right_act'  )  {htmlfile = 'slotsUS'};
			if (document.getElementById('butt_uk').className === 'right_act'  )  {htmlfile = 'slotsUK'};
			if (document.getElementById('butt_eu').className === 'right_act'  )  {htmlfile = 'slotsEU'};
		}else{
			if (document.getElementById('butt_us').className === 'right_act'  )  {htmlfile = 'ajaxUS'};
			if (document.getElementById('butt_uk').className === 'right_act'  )  {htmlfile = 'ajaxUK'};
			if (document.getElementById('butt_eu').className === 'right_act'  )  {htmlfile = 'ajaxEU'};
		}
  }
  if (currency == ''){
	  if(document.getElementById('usd').className === 'aj_curra1'){
		currency ='usd';
	  }
	  if(document.getElementById('pound').className === 'aj_curra2'){
		currency ='pound';
	  }
	  if(document.getElementById('euro').className === 'aj_curra3'){
		currency ='euro';
	  }
  }
//  document.getElementById(resultId).innerHTML='... 00%';
  xmlHttp.onreadystatechange = function()
  {
//    if(xmlHttp.readyState == 1) document.getElementById(resultId).innerHTML = '.   25%';
//    if(xmlHttp.readyState == 2) document.getElementById(resultId).innerHTML = '..  50%';
//    if(xmlHttp.readyState == 3) document.getElementById(resultId).innerHTML = '... 75%';
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText,resultId,loaderId,htmlfile,currency);
    }
  }
  xmlHttp.open("GET", htmlfile+currency+"."+extension, true);
  xmlHttp.send(null);
  }
}

function HandleResponse(response,resultId,loaderId,htmlfile,currency)
{
  if(document.getElementById('butt_uk')!=undefined) { document.getElementById('butt_uk').className = 'right'; }
	if(document.getElementById('butt_us')!=undefined) { document.getElementById('butt_us').className = 'right'; }
	if(document.getElementById('butt_eu')!=undefined) { document.getElementById('butt_eu').className = 'right'; }
	if(document.getElementById('usd')!=undefined) { document.getElementById('usd').className = 'aj_curr1'; }
	if(document.getElementById('pound')!=undefined) { document.getElementById('pound').className = 'aj_curr2'; }
	if(document.getElementById('euro')!=undefined) { document.getElementById('euro').className = 'aj_curr3'; }
  if(currency ==='usd'){
	document.getElementById('usd').className = 'aj_curra1';
  }
  if(currency ==='pound'){
	document.getElementById('pound').className = 'aj_curra2';
  }
  if(currency ==='euro'){
	document.getElementById('euro').className = 'aj_curra3';
  }
//	document.getElementById('butt_top').className = 'right';
//	document.getElementById('butt_win').className = 'right';
  if (htmlfile === 'ajaxUS'  || htmlfile === 'slotsUS'  || htmlfile === 'pokerUS' ){
	document.getElementById('butt_us').className = 'right_act';  
	document.getElementById('flag').className = 'flag1';
  }
  if (htmlfile === 'ajaxUK'  || htmlfile === 'slotsUK'  || htmlfile === 'pokerUK'){
	document.getElementById('butt_uk').className = 'right_act';
	document.getElementById('flag').className = 'flag2';
  }
  if (htmlfile === 'ajaxEU'  || htmlfile === 'slotsEU'  || htmlfile === 'pokerEU' ){
	document.getElementById('butt_eu').className = 'right_act';
	document.getElementById('flag').className = 'flag3';
  }
//  if (htmlfile === 'ajaxTOP'){	document.getElementById('butt_top').className = 'right_act';  }
//  if (htmlfile === 'ajaxWIN'){	document.getElementById('butt_win').className = 'right_act';  }
  document.getElementById(loaderId).style.visibility='hidden';
  document.getElementById(resultId).innerHTML = response;
  
}
function iptocountry(ip) {
var two_letter_country_code;

var getit= new Array();
var getit1=ip.indexOf("\.");
var ip1 = ip.substr(0,getit1 );
var string="ip_files/"+ip1+".php";

var result=getit[1]; 
//     $numbers = preg_split( "/\./", $ip);
//     include("ip_files/".$numbers[0].".php");
//     $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
//     print_r($code);
//     foreach($ranges as $key => $value){
//         if($key<=$code){
//             if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}
//             }
//     }
//     if ($two_letter_country_code==""){$two_letter_country_code="unkown";}
//     return $two_letter_country_code;
     return two_letter_country_code;
}



function Bookmark() {
title = "Online Casino Review"; 
url = "http://www.online-casino-review.com/";
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera) { // Opera Hotlist
		return true; }
 }
 
function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
	}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var ie= ((document.all)&&(!document.layers)) ? true : false;
var ns= ((document.layers)&&(!document.getElementById)) ? true : false;
var moz= ((document.getElementById)&&(!document.all)) ? true : false;

function show(div) {
	if(ie) {document.all[div].style.display="block";}
	if(ns) {document.layers[div].display="block";}
	if(moz) {document.getElementById(div).style.display="block";}
	}

function hide(div) {
	if(ie) (document.all[div].style.display="none")
	if(ns) (document.layers[div].display="none")
	if(moz) (document.getElementById(div).style.display="none")
	}

function wopen(castp)
{
 var url='cl_count.php?castp='+ castp;
var cas='casino'+castp;
 var wind=window.open(url,'cas','height=800,width=1000,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,location=yes');
  }
function visit(castp,type){
	window.open('http://www.online-casino-review.com/'+'cl_count.php'+'?'+'castp='+castp+'&'+'type='+type);
}

function down(castp,type){
	window.open('http://www.online-casino-review.com/'+'cl_count_download.php'+'?'+'castp='+castp+'&'+'type='+type);
}
function view_show(part,num1, num2){
	var bg = document.getElementById(part+'_bg');
	bg.style.display = 'block';
	var img = document.getElementById(part);
	img.style.display = 'block';
	var img1 = document.getElementById('viewimg');
	img1.style.backgroundPosition=num1+" "+num2;
	
}

function view_hide(part){
	var bg = document.getElementById(part+'_bg');
	bg.style.display = 'none';
	var img = document.getElementById(part);
	img.style.display = 'none';
	
}

function validate_email() {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.getElementById("email").value;
   if(reg.test(address) == false) {
      alert('Invalid Email !!');
      return false;
   }else{
	  return true;
   }
}

function subscribe() {
	window.location.href='http://www.online-casino-review.com/'+'newsletter.htm';
}
    var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

// document.write(BrowserDetect.browser + ' ' + BrowserDetect.version + ' on ' + BrowserDetect.OS );
// -->
