<!--
var dy=10;
var srcollID = 0;
var positionigDone = false;
var divTimers = Array();

var menuDivs = Array();
window.onload = function (){
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++){
		if (x[i].className == 'm_over_div')
			menuDivs[menuDivs.length] = x[i].id;
	}
}
document.write('<div id="debug" style="position: absolute; left: 0; top: 0;"></div>');
function debug(text){
	document.getElementById('debug').innerHTML = text;
}

function showDiv(name, repos, horizontal, offset_X){
	if (!offset_X){offset_X = 50;}
	if (get_obj(name)==null)
		return;
	if (divTimers[name]){clearTimeout(divTimers[name]);}
	var e = window.event;
	if (e.target) var tg = e.target;
	else if (e.srcElement) var tg = e.srcElement;
	if (tg.parentElement){tg = tg.parentElement;}
	else if (tg.parentNode){tg = tg.parentNode;}
	//alert(tg.parentElement.id);

	if (repos) return;
	var newX = findPosX(tg) + ((horizontal) ? offset_X : 0);
	var dy = (op5) ? tg.style.pixelHeight : tg.offsetHeight;
	var newY = findPosY(tg) + ((horizontal) ? 0 : dy);
	moveXY(name, newX, newY);
	for (i=0;i<menuDivs.length;i++){
		MM_showHideLayers('+menuDivs[i]+','','hide');
	}
	MM_showHideLayers(name,'','show');
}

function hideDiv(name, fast){
	var tOutTime = (fast) ? 100 : 500;
	divTimers[name] = setTimeout("MM_showHideLayers('"+name+"','','hide');", tOutTime);
}

function up(name,fast){
	var obj = document.getElementById(name);
	if (fast){
		obj.style.top = "0px";
	}
	else{
		if (obj.style.pixelTop<0){
			obj.style.top = parseInt(obj.style.pixelTop)+dy+"px";
			srcollID = setTimeout("up('"+name+"')", 100);
		}
		else{
			obj.style.top = "0px";
		}
	}
}

function down(name,fast){
	var obj = document.getElementById(name);
	if (fast){
		obj.style.top = (-1)*obj.offsetHeight+25+"px";
	}
	else{
		if (obj.style.pixelTop>((-1)*obj.offsetHeight)+25){
			obj.style.top = parseInt(obj.style.pixelTop)-dy+"px";
			srcollID = setTimeout("down('"+name+"')", 100);
		}
	}
}

function stopScroll(){
	if (srcollID){clearTimeout(srcollID);}
}

function new_win(url){
	var win = window.open(url, "_blank", "scrollbars=no,statusbar=no");
	if (win){win.focus();}
	return false;
}

function popUpPrintPage(page){
	pwidth = 800;
	pheight = 450;
	pleft = (screen.width - pwidth)/2;
	ptop = (screen.height - pheight)/2;
	window.open(page, "PrintPage", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+pwidth+",height="+pheight+",left="+pleft+",top="+ptop);
}

function print_page(){
	var url = location.href.replace(/index.php\?page=/gi, 'print.php?page=');
	url = url.replace(/\/\?page=/gi, '/print.php?page=');
	//alert(url);
	popUpPrintPage(url);
}

function open_page(page, page_name, pwidth, pheight, resizable, center, scrollbars, status){
	page_name = (page_name) ? page_name : '_blank';
	pwidth = (pwidth) ? pwidth : 400;
	pheight = (pheight) ? pheight : 300;
	resizable = (resizable) ? 1 : 0;
	scrollbars = (scrollbars) ? 1 : 0;
	status = (status) ? 1 : 0;
	var pleft = (center) ? (screen.width - pwidth)/2 : 0;
	var ptop = (center) ? (screen.height - pheight)/2 : 0;
	var props = 'toolbar=0,scrollbars='+scrollbars+',location=0,status='+status+',menubar=0,resizable='+resizable+',width='+pwidth+',height='+pheight+',left='+pleft+',top='+ptop;
	var win = window.open(page, page_name, props);
	if (win){win.focus();}
}

var urlAddress = "http://www.cmbtravel.ro/";
var pageName = "Agentia mea de turism";

function addToFavorites(){
	if (window.external){
		window.external.AddFavorite(urlAddress,pageName)
	}
	else{ 
		alert("Pentru a adauga aceasta pagina la paginile favorite folositi optiunea din meniul browserului!");
	}
}

function show_m_over_layer(name, show){
	if (get_obj(name)==null)
		return;
	var e = window.event;
	if (e.target) var tg = e.target;
	else if (e.srcElement) var tg = e.srcElement;
	var newX = findPosX(tg);
	var newY = findPosY(tg)-getElementHeight(name);
	moveXY(name, newX, newY);
	MM_showHideLayers(name, '', show);
}

function pos_load_div(){
	if (get_obj('loader')==null)
		return;
	
	var scroll = getScrollXY();
	
	// make explicits check to undefined because the value may be 0 (zero)
	win_w = (document.body.offsetWidth !== undefined) ? document.body.offsetWidth : window.innerWidth;
	win_h = (document.body.offsetHeight !== undefined) ? document.body.offsetHeight : window.innerHeight;
	
	x = Math.round((win_w-150)/2) + scroll[0];
	y = Math.round((win_h-15)/2) + scroll[1];
	moveXY('loader', x, y);
}

function toggle_div(div_name){
	var obj = get_obj(div_name);
	obj.style.display = (obj.style.display == '' || obj.style.display == 'none') ? 'block' : 'none';
}

/* mozilla event */
if (typeof(window.event) == 'undefined'){
	function emulateEventHandlers(eventNames) {
		for (var i = 0; i < eventNames.length; i++) {	
			document.addEventListener(eventNames[i], function (e) {
			   window.event = e;
			}, true); // using capture
		}
	}
	
	emulateEventHandlers(["click", "mousemove", "mouseover", "mouseout"]);
}
-->
