function maximize() {
	self.moveTo(0,0);
	self.resizeTo(screen.availWidth,screen.availHeight-5);
}

function NewWin(url,name,xpos,ypos,width,height)
{
	window.open(
	url,
	name,

	"screenX="+xpos+",screenY="+ypos+",WIDTH="+width+",HEIGHT="+height+
	",location=0,resizable=1,status=1,titlebar=1,directories=0,toolbar=0,menubar=0,scrollbars=yes,status=1"
	);
}

function NewWin1(url,name,xpos,ypos,width,height)
{
	window.open(
	url,
	name,

	"screenX="+xpos+",screenY="+ypos+",WIDTH="+width+",HEIGHT="+height+
	",location=0,resizable=0,status=0,titlebar=1,directories=0,toolbar=0,menubar=0,scrollbars=no,status=0"
	);
}

function loading() {
	showLayer("load");
}


function close_loading() {
	hideLayer("load");
}

function hideLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "hidden";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "hidden";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "hidden";
	}
}

function showLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "visible";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "visible";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "visible";
	}
}
function openwin(lnk)
{
	window.open(
	lnk,
	"Grafice",
	"screenX="+100+",screenY="+100+",width="+670+",height="+610+
	",location=0,resizable=1,status=0,titlebar=1,directories=0,toolbar=0,menubar=0,scrollbars=yes,status=0"
	);
}

function getVar(name)
{
	get_string = document.location.search;
	return_value = '';

	do { //This loop is made to catch all instances of any get variable.
	name_index = get_string.indexOf(name + '=');

	if(name_index != -1)
	{
		get_string = get_string.substr(name_index + name.length + 1, get_string.length - name_index);

		end_of_value = get_string.indexOf('&');
		if(end_of_value != -1)
		value = get_string.substr(0, end_of_value);
		else
		value = get_string;

		if(return_value == '' || value == '')
		return_value += value;
		else
		return_value += ', ' + value;
	}
	} while(name_index != -1)

	//Restores all the blank spaces.
	space = return_value.indexOf('+');
	while(space != -1)
	{
		return_value = return_value.substr(0, space) + ' ' +
		return_value.substr(space + 1, return_value.length);

		space = return_value.indexOf('+');
	}

	return(return_value);
}