if (!document.getElementById) { 
	var is_dom = false;
} else {
	var is_dom = true;
}

function upgrade() {
  top.location.href = "http://www.webstandards.org/upgrade/";
}

function goToUrl(theUrl) {
  top.location.href = theUrl;
}

function browserCheck() {
	/*
  if (is_nav4 || is_ie3) {
    upgrade();
  } else {
    windowCheck();
  }
  */
}

function writeNewDiv(id,newCnt) {
	
	var theDelay = true;
	
	if (is_dom) {
		document.getElementById(id).innerHTML=newCnt;
	}
	else {
		if (is_nav) {
			document.layers[id].document.write(newCnt);
			document.layers[id].document.close();
		}
		else {
		//IE4 crashes if you set the innerhtml without a delay, strange
			if (is_ie4) {
				if (theDelay == true) {
					thisID = id;
					setTimeout("writeNewDiv(thisID);",100);
					theDelay = false;
				}
				else {
					document.all[id].innerHTML=newCnt;
					theDelay = true;
				}
			}
			else {
				document.all[id].innerHTML=newCnt;
			}
		}
	}
	return false;
}

function preloadImages(imgString){
 var imgArray;
 var count;
 imgArray = imgString.split(",");
 for (count = 0; count < imgArray.length;count++) {
  newImage = new Image();
  newImage.src = imgArray[count];
 }
}

function preload(imgObj,imgSrc) {
if (document.images) {
eval(imgObj+' = new Image()')
eval(imgObj+'.src = "'+imgSrc+'"')
  }
}
function changeImage(layer,imgName,imgObj) {
if (document.images) {
if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
else document.images[imgName].src = eval(imgObj+".src")
  }
}

// Transfer without delay
function transfer_to(url) {
  locationstring = url;
  window.location = locationstring;
}
function verify(message,destination) { 
    
	thumbsUp = confirm(message);
	url = destination;
	
    if (thumbsUp) {
    	setTimeout("transfer_to(url)", 1);
    } else {
		// if clicked cancel   
    } 
}

function toggle(id) { 
	var el = document.getElementById(id).style; 
	if(el.display == "none" || !el.display) { 
		el.display = "block"; 
	} 
	else if(el.display == "block") { 
		el.display = "none"; 
	} 
}
function show(id) { 
	var el = document.getElementById(id).style; 
	el.display = "block"; 
}
function hide(id) { 
	var el = document.getElementById(id).style; 
	el.display = "none"; 
}

function m(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function jumpMenuUrl(url,targ,selObj,restore){ //v3.0
  eval(targ+".location='"+url+""+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function unblur() {
	this.blur();
}

function getLinksToBlur() {
	if (!document.getElementById) return
	links = document.getElementsByTagName("a");
	for(i=0; i<links.length; i++) {
		links[i].onfocus = unblur;
	}
}


var jukebox_height = 527;

function jukebox(lang) {

  var agt=navigator.userAgent.toLowerCase();
  var is_major = parseInt(navigator.appVersion);
  var is_minor = parseFloat(navigator.appVersion);
  var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) &&  (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
  var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  var is_mac = (agt.indexOf("mac")!=-1);

  var popW = 500, popH = jukebox_height;

  if (is_mac) {
    if (is_ie) {
      var leftPos = (document.body.clientWidth-popW)/2, topPos = (document.body.clientHeight-popH)/2;
    }
    else {
      leftPos = (screen.width) ? (screen.width-popW)/2 : 0;
      topPos = (screen.height) ? (screen.height-popH)/2 : 0;
    }
  } else {
    leftPos = (screen.width) ? (screen.width-popW)/2 : 0;
    topPos = (screen.height) ? (screen.height-popH)/2 : 0;
  }
  
  window.open('../recs/jukebox/?lang=' + lang,'juke','resizable=yes, status=yes, copyhistory=no, scrollbars=no, width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

function jukebox_play(lang, av, id) {

  var agt=navigator.userAgent.toLowerCase();
  var is_major = parseInt(navigator.appVersion);
  var is_minor = parseFloat(navigator.appVersion);
  var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) &&  (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
  var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  var is_mac = (agt.indexOf("mac")!=-1);

  var popW = 500, popH = jukebox_height;

  if (is_mac) {
    if (is_ie) {
      var leftPos = (document.body.clientWidth-popW)/2, topPos = (document.body.clientHeight-popH)/2;
    }
    else {
      leftPos = (screen.width) ? (screen.width-popW)/2 : 0;
      topPos = (screen.height) ? (screen.height-popH)/2 : 0;
    }
  } else {
    leftPos = (screen.width) ? (screen.width-popW)/2 : 0;
    topPos = (screen.height) ? (screen.height-popH)/2 : 0;
  }
  
  window.open('../recs/jukebox/' + av + '.php?lang=' + lang + '&id=' + id,'juke','resizable=yes, status=yes, copyhistory=no, scrollbars=no, width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}


function soopaPopSetup() {
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.target && a.target.indexOf("_soopaPop") == 0) {
			a.onclick = soopaPop;
		}
	}
}

function soopaPop() {
	var a = this.target.split(":");
	var sFeatures = a[1];
	window.open(this.href, a.length > 2 ? a[2] : String((new Date()).getTime()), sFeatures);
	return false;
	alert("hi")
}

window.onload = function () {
	//Fat.fade_all();
	getLinksToBlur();
	soopaPopSetup();
}

/*
 * This script is written by Geert Van Aken
 * Please read the official documentation for more information
 * about the functions of this file.
 *
 * http://altum.be/products/emailobfuscator
 *
 * Please do not remove this information from the file and
 * report improvements that you make to this sourcecode
 *
 * Version 1.1.0
 * Date    2006/04/11
 */

var monkeyCode = 4 << 4;
var oldStatusText = "";

function EOa() {
  return String.fromCharCode(monkeyCode);
}

function EOd(pText) {
  var splitted = pText.split(",");
  var result = "";

  for (i = 0 ; i < splitted.length ; i++) {
    result += String.fromCharCode(splitted[i]);
  }
  return result;
}

function EOp() {
  var prefix = EOd('109,97,105');
  prefix += EOd('108,116');
  return prefix + EOd('111,58');
}

function EOad(pName, pdomain) {
  EOad(pName, pDomain, null);
}

function EOinitStatus(pName, pDomain) {
  oldStatusText = window.status;
  window.status = Loc(pName, pDomain);
}

function EOrestoreStatus() {
  window.status = oldStatusText;
}

function EOae(pName, pDomain, pSubj, pHover, pText, pClass) {

//  alert("pName = " + pName + "\npDomain = " + pDomain + "\npSubj = " + pSubj + "\npHover = " + pHover + "\npText = " + pText + "\npClass = " + pClass);

  var result = "<a href=\"JavaScript:EOad('" + pName + "','" + pDomain + "'";
  if (pSubj != null && pSubj.length > 2) {
    result += ",'" + pSubj + "'";
  }
  result += ");\"";

  if (pHover != null && pHover.length > 0) {
    result += " title=\"" + EOd(pHover) + "\"";
  }

  if (pClass != null && pClass.length > 0) {
    result += " class=\"" + pClass + "\"";
  }

  result += " onMouseOver=\"EOinitStatus('" + pName + "','" + pDomain + "');return true;\" onMouseOut=\"EOrestoreStatus();\"";

  result += ">" + EOd(pText) + "</a>";

//  alert(result);

  document.write(result);

}

function EOad(pName, pDomain, pSubj) {
  var loc = Loc(pName, pDomain);
  if (pSubj != null && pSubj.length > 0) {
    loc += "?" + EOd('115,117,98,106,101,99,116') + "=" + encodeURIComponent(EOd(pSubj));
  }

  document.location = loc;
}

function Loc(pName, pDomain) {
  var first = EOd(pName);
  var second = EOd(pDomain);
  var loc = EOp() + first + EOa() + second; 
  
  return loc;
}