var menu = new Object();

menu.prefix = '/isAjax/true';

menu.openPage = function(url) {
	//alert(url + menu.prefix);
	loader(true);
	$.get(url + menu.prefix, {} , function(data) {
		//eval(data);
		loader(false);
		//googleAnalitics();
		document.getElementById("page").innerHTML = data;
	});
	
}

function loader(show) {
	var obj = document.getElementById("loader");
	if (show)
		obj.style.display = "block";
	else
		obj.style.display = "none";
				
	obj.style.left = (parseInt(screen.availWidth / 2) - 75) + "px";
	obj.style.top = 250 + "px";
}

var opened = 0;
function showPage(id)
{
	if (opened == id) return;
	
	$('#page' + opened).hide();
	opened = id;
	$('#page' + opened).fadeIn('slow');
}

function googleAnalitics() {
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	var pageTracker = _gat._getTracker("UA-309342-3");
	pageTracker._initData();
	pageTracker._trackPageview();
}

function PopupPic(sPicURL) {
	sPicURL = sPicURL.replace(/small/g, "");
	window.open( "http://www.draytek.com.ro/static/pop_img.html?" + sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}