////////////////////////////////////////////////
// Javascripts for checking mouse-coordinates //
////////////////////////////////////////////////

	var isIE = document.all;	// For Internet Explorer
	var mouseX = 0;			// Variable for saving the x-coordinate
	var mouseY = 0;			// Variable for saving the x-coordinate
	
	// Gets the mouse-coordinates (x, y) and saves them in the variables mouseX and mouseY
	function getMouseXY(e) {
		if (!e) e = window.event;
		if (e) {
			// If the document isn't at the top (scrolled)
			if (!document.body.scrollTop) {
				// Get how much pixels the document is scrolled (for IE)
				var scrollX = document.documentElement.scrollLeft;
				var scrollY = document.documentElement.scrollTop;
			}
			// If the document is at the top (not scrolled)
			else {
				// Document isn't scrolled (for IE)
				var scrollX = document.body.scrollLeft;
				var scrollY = document.body.scrollTop;
			}
			// Save the coordinates
			mouseX = isIE ? (e.clientX + scrollX) : e.pageX;
			mouseY = isIE ? (e.clientY + scrollY) : e.pageY;
		}
	}
	// When the mouse moves - get coordinates
	document.onmousemove = getMouseXY;

///END//////////////////////////////////////////
// Javascripts for checking mouse-coordinates //
////////////////////////////////////////////////



//////////////////////////////////////
// Javascripts for placing elements //
//////////////////////////////////////

	// Place element horisontally (x)
	function placeX(element, x) {
		document.getElementById(element).style.left = x;
	}

	// Place element vertically (y)
	function placeY(element, y) {
		document.getElementById(element).style.top = y;
	}
	
	// Place element horisontally and vertically (x, y)
	function place(element, x, y) {
		placeX(element, x);
		placeY(element, y);
	}

///END////////////////////////////////
// Javascripts for placing elements //
//////////////////////////////////////



///////////////////////////////////////
// Javascripts for resizing elements //
///////////////////////////////////////

	// Sets the width of the element
	function setWidth(element, width) {
		document.getElementById(element).style.width = width;
	}

	// Sets the height of the element
	function setHeight(element, height) {
		document.getElementById(element).style.height = height;
	}

	// Sets the width and height of the element
	function setSize(element, width, height) {
		document.getElementById(element).style.width = width;
		document.getElementById(element).style.height = height;
	}

///END/////////////////////////////////
// Javascripts for resizing elements //
///////////////////////////////////////



////////////////////////////////////////////////////////
// Javascripts for controlling visibility of elements //
////////////////////////////////////////////////////////

	// Makes the element visible
	function show(element) {
		document.getElementById(element).style.display = 'block';
	}

	// Makes the element invisible
	function hide(element) { 
		document.getElementById(element).style.display = 'none';
	}
	
	// Makes the element invisible
	function changeVisibility(element) { 
		if(document.getElementById(element).style.display == 'block') {
			hide(element);
		}
		else {
			show(element);
		}
	}	
	
///END//////////////////////////////////////////////////
// Javascripts for controlling visibility of elements //
////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////
// Javascripts for editing the content and values of elements //
////////////////////////////////////////////////////////////////

	// Sets the content (innerHTML) of the element
	function setContent(element, content) { 
		document.getElementById(element).innerHTML = content;
	}

	// Gets the content (innerHTML) of the element
	function getContent(element) { 
		return document.getElementById(element).innerHTML;
	}

	// Sets the value of the element
	function setValue(element, value) { 
		document.getElementById(element).value = value;
	}
	
	// Gets the value of the element
	function getValue(element) {
		return document.getElementById(element).value;
	}

///END//////////////////////////////////////////////////////////
// Javascripts for editing the content and values of elements //
////////////////////////////////////////////////////////////////
