var path = "http://www.datablade.com/cgi-bin/software.html/";
var exe = "/InterCasinoItaliaInstall.exe";
var sitesToTrack = new Array ("dollar", "uk", "espana", "deutsch", "japan", "france", "danish");
window.onload = function() {
	if (getCookie('src_cd')) {
		if (document.getElementsByTagName) {
			var hrefs = document.getElementsByTagName('a');
		} else if(document.all) {
			var hrefs = document.all.tags('a');
		}
		for (i=0;i<hrefs.length;i++)
		{
			if(hrefs[i].href.indexOf(path) != -1)
			{
				hrefs[i].href = path+unescape(getCookie('src_cd'))+exe;
			}
		}
	}
	//outbound links
	if (getCookie('src_cd')) {
		for (j=0;j<sitesToTrack.length;j++)
		{
			if (document.getElementById(sitesToTrack[j])) {
				var currentnode = document.getElementById(sitesToTrack[j])
				currentnode.childNodes[0].href = currentnode.childNodes[0].href + "?" + getCookie('src_cd');
			}	
		}
	}
	// Supplimentary onload functions
	doMenu();
}

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");
	}
}

//depending upon the page, highlight the correct sub menu item
//each page has a hiMenuID which matches the sub menu id.
function doMenu()
{
	var Menu = document.getElementById ? document.getElementById(MenuID) : document.all ? document.all[MenuID] : null;
	if(Menu) Menu.className = 'currentnav';
	
	var subMenu = document.getElementById ? document.getElementById(subMenuID) : document.all ? document.all[subMenuID] : null;
	if(subMenu) subMenu.className = 'currentsubnav';
}

function timer(url) {
	setTimeout("location.href = '" + url + "';", 5000);
}
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 showhide(id) {
var terms = document.getElementById(id);
if( terms.style.display == 'block' ) {
terms.style.display = 'none';
} else {
terms.style.display = 'block';
}
}
