// JavaScript Document
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
   browserType= "gecko"
}

function resizeMenuContainerHeight(height){
		if (document.getElementById) {
			document.getElementById("navigation_container").style.height = height + "px";
		} else {
			document.layers["navigation_container"].style.height = height + "px";
		}
	//var flash_container = document.getElementById("navigation_container");
	//flash_container.style.height = height + "px";
}
		
function updateLocation(){
	var hamster_navigation = document.getElementById("hamster_navigation");
	var input_element = document.getElementById("location");
	hamster_navigation.setLocation(input_element.value);
}

function SendDataToFlashMovie(frameNum) {
	var flashMovie = getFlashMovieObject("sounds");
	flashMovie.GotoFrame(frameNum);
}

function hide() {
		if (document.getElementById) {
			document.getElementById("error").style.visibility = "hidden";
		} else {
			document.layers["error"].style.visibility = "hidden";
		}
	}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function hide() {
	if (browserType == "gecko" ) {
		document.poppedLayer = eval('document.getElementById("error")');
	} else if (browserType == "ie") {
		document.poppedLayer = eval('document.getElementById("error")');
	} else {
		document.poppedLayer = val('document.layers["error"]');
	}
	document.poppedLayer.style.visibility = "hidden";
}

function show() {
	if (browserType == "gecko" ) {
		document.poppedLayer = eval('document.getElementById("error")');
	} else if (browserType == "ie") {
		document.poppedLayer = eval('document.getElementById("error")');
	} else {
		document.poppedLayer = eval('document.layers["error"]');
	}
	document.poppedLayer.style.visibility = "visible";
}

function netstatLoad(tellernaam) {
	
	
}

function _init_links() 
{
 if (!document.getElementsByTagName) return;

 var anchors = document.getElementsByTagName("a");

 for (var i=0; i<anchors.length; i++)
 {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") 
		&&
       (anchor.getAttribute("rel") == "external"		
		||
       anchor.getAttribute("class") == "download"))
	{
     		anchor.target = "_blank";
	}
 }
}

window.onload = _init_links;

var _col_win;

function open_collage_tool(u)
{

	if (_col_win && !_col_win.closed)
	{
		_col_win.focus();
		return;
	}
	
	//var u = "http://www.hamsterwereld.nl/collagetool/";
	var w = 730;
	var h = 640;
	var l	= (w == screen.width ? 0 : (screen.width / 2) - (w / 2));
	var t	= (h == screen.height ? 0 : (screen.height / 2) - (h / 2) - 25);

	_col_win = window.open(u, '_col_win', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,' + 'left=' + l + ', top=' + t + ', width=' + w + ', height=' + h);
	_col_win.focus();
}

var _popup_win;

function open_picture(u)
	{
		
	
		if (_popup_win && !_popup_win.closed)
		{
			_popup_win.document.location = u;
			_popup_win.focus();
			return;
		}
		
		
		var w = 520;
		var h = 525;
		var l	= (w == screen.width ? 0 : (screen.width / 2) - (w / 2));
		var t	= (h == screen.height ? 0 : (screen.height / 2) - (h / 2) - 25);

		_popup_win = window.open(u, '_popup_win', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,' + 'left=' + l + ', top=' + t + ', width=' + w + ', height=' + h);
		_popup_win.focus();
	}