/*_______________________________________________________________________
 | 
 | Module owner  : Digital sun productions (http://www.digsun.com)
 | Created (by)  : Pär Nordlund
 |               : 2006-06-19
 | Modified (by) : ______ ___________ 
 |               : xxxx-xx-xx
 | 
 | Description   : Common java functions.
 |
 | License       : This file is created and owned by the Digital sun productions network
 |                 and may not be disseminated outside the organisation without persmission.
 |                 Contact sales@digsun.com for questions regarding licence.
 | 
  ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ*/


var working 			= false;
var current_element 	= null;
var motion_speed		= 50;

var container			= null;

var container_width	= 750;

function toggle_visibility(id) {
  	id = document.getElementById(id);

	var vs = id.style.visibility;

	if (!vs || vs == "hidden") {
		id.style.visibility = "visible";
		id.style.position = "";
	} else {
		id.style.visibility = "hidden";
		id.style.position = "absolute";
	}
	
}
function toggle_display(id, visible) {
	if (!visible) visible = "block";
  	id = document.getElementById(id);

	var vs = id.style.display;

	if (!vs || vs == "none") {
		id.style.display = visible;
	} else {
		id.style.display = "none";
	}
	
}


// Set display attribut for element.
function setDisplay(id_name, value)
{
  	id = document.getElementById(id_name);
	if (!id) return;
	id.style.display = value;
}

function set_fullscreen(id) {



	var d = document.getElementById(id);
	var a = getPageSize();

	winW = a[2];	
	winH = a[3];
	

	
	
	d.style.position 	= "absolute";
	d.style.top		= "0px";	
	d.style.left		= "0px";	
	d.style.width		= winW + "px";
	d.style.height		= winH + "px";

	
}
function create_fullscreen_wnd(url) {

	var screenW = 640, screenH = 480;
	if (parseInt(navigator.appVersion)>3) {
		screenW = screen.width;
		screenH = screen.height;
	} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled()) {
		var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		var jScreenSize = jToolkit.getScreenSize();
		screenW = jScreenSize.width;
		screenH = jScreenSize.height;
	}
	
	newwindow=window.open(url,"fullscreen_window","height=" + screenH + ",width=" + screenW + ", resizable = 1, status=0, fullscreen=1");
	if (window.focus) {
		newwindow.focus()
	}
	

}
