
var path = "http://www.datablade.com/cgi-bin/software.html/";
var exe = "/SpanishInterCasinoInstall.exe"; // not needed?
var sitesToTrack = new Array ("dollar", "uk", "italia", "espana", "japan", "france", "danish");

function makeVisible(id)
{
	if(document.getElementById(id)) 
	{
		document.getElementById(id).className = "visible";    //Same but one wwork with IE, the other with Firefox
		document.getElementById(id).setAttribute("class","visible");
	}
}

function timer(url) { setTimeout("location.href = '/getting_started/download.shtml';" , 8400); }

function write_me(html) {
	document.write(html);	
}

function write_me_check_flash(html,alternate) {
	if (flash.version >= "6") {
			document.write(html);
	} else {
			document.write(alternate);
	}
}

function getCookie(Name) {   	

	var search = Name + "="   

	if (document.cookie.length > 0) { 
	
	// if there are any cookies      
	offset = document.cookie.indexOf(search)       

	if (offset != -1) { 
		// if cookie exists          
		offset += search.length          
		// set index of beginning of value         
		end = document.cookie.indexOf(";", offset)          
		// set index of end of cookie value         
		if (end == -1)             
			end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
		}    
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showhide(id) {
	var terms = document.getElementById(id);
	if( terms.style.display == 'block' ) {
	terms.style.display = 'none';
	} else {
	terms.style.display = 'block';
	}
}

$(document).ready(function(){
	if (getCookie('src_cd')) {
		$("a[href^='http://www.datablade.com']").each(function(){
			var a = $(this).attr('href').split("/");
			$(this).attr('href', path+getCookie('src_cd')+"/"+a[a.length-1]);
				$(this).click(function(){		
				pageTracker._trackPageview('/download/InterCasino-dollar-spanish-Installer.exe');
			});
		});
	
		// $("a[href^='http://www.interpoker.com']").each(function() {
				// $(this).attr('href',$(this).attr('href')+'/?'+getCookie('src_cd'));   
		// });
		
		//outbound links
		inter.trackingcode=getCookie('src_cd'); // todo: move this up // test if meaningful
		$('#topnav .languageselmore ul li a').add('#topnav .products .poker a').each(function(){
			$(this).attr('href',$(this).attr('href')+'?'+inter.trackingcode);
		});
		// instant play
		$("a[href*='cgi-bin/add_email.pl']").filter("a[href*='no-download']").each(function(){
			$(this).click(function(){
				//GA code
				pageTracker._trackPageview('/instantplay/InterCasino-dollar-spanish');
			});
		});
				
	}
});