var path = "http://www.datablade.com/cgi-bin/software.html/";
var exe = "/InterPokerInstall.exe";

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;
			}
		}
	}
	// Supplimentary onload functions
	doMenu();
	prepareExternalLinks();
}

function showhide(id) {
var terms = document.getElementById(id);
if( terms.style.display == 'block' ) {
terms.style.display = 'none';
} else {
terms.style.display = 'block';
}
}

function prepareExternalLinks()
{
  if( document.getElementById && document.getElementsByTagName )
  {
		addExternalLinks("contentText","newWindow");
		addExternalLinks("footer","newWindow");
  }
}

function addExternalLinks(id, class_name)
{
	if(document.getElementById(id))
	{
		  var node_element = document.getElementById(id);
		  var links = node_element.getElementsByTagName('a');
		  for (var i=0; i < links.length; i++)
		  {
				if (links[i].className.match(class_name))
				{
					  links[i].onclick = function() {
						window.open(this.href);
						return false;
					  }
				}
		  }
	}
}


//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);
	}
}

/* FLASH DETECTION */
var versions = 10;

var flash = new Object();
flash.installed=false;
flash.version='0.0';



// FOR IE
if (window.ActiveXObject) {
	for (i = 2; i <= versions; i++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + i + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = i + '.0';
			}
		}
		catch(e) {}
	}
}

//FOR NETSCAPE
else if (navigator.plugins && navigator.plugins.length) {
	for (i=0; i < navigator.plugins.length; i++) {
		if (navigator.plugins[i].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[i].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}