// JavaScript Document: AccentTravel
	

		var isShown = ''; var linkHeight = 20; // pixels
		var scrollTop = ''; // used for gallery
		function obj(id) {
			if (!document.getElementById(id)) return false;
			return document.getElementById(id)
		}

		function showHideMenu(object) { 
			object = object.parentNode;
			if (isShown == object.id) {
				object.className = 'noshowUL';
				isShown = '';
			}
			else {
				if (isShown != '') {
					obj(isShown).className = 'noshowUL';
				}
				object.className = 'showUL';
				isShown = object.id;
			}
		}




// JavaScript Document: ajax kickstarter

	function hideElem(id) {
		obj(id).style.display = 'none'; 
	}
	function showElem(id) {
		obj(id).style.display= 'block';
	}
	function selectValue(obiect) {
		if (obj(obiect)) { // este id, nu obiect
			obiect = obj(obiect);
		}
		if (obiect.tagName == 'select' || obiect.tagName == 'SELECT') {
			return obiect.options[obiect.selectedIndex].value;
		}
		else alert('obiectul nu este select -'+obiect.tagName);
		return false;
	}
	

	function makeRequest(url, called_function) {
		var http_request = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari, ...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/xml');
			}
		} 
		else if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e) {}
			}
		}
		if (!http_request) {
			alert('Giving up :( Cannot create an XMLHTTP instance');
			return false;
		}
		http_request.onreadystatechange = function() { generalHandler(http_request, called_function) }
		http_request.open('GET', url, true);
		http_request.send(null);
	}
		
	function generalHandler(http_request, called_function) {
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				var xml_text = http_request.responseText;
				eval(called_function);
			} 
			else {
				alert('There was a problem with the request.');
			}
		}
	}
// called functions:  examples
	function innerWrite(location, xml_text) {
		showToMouse(location);
		obj(location).innerHTML = xml_text;
	}

// show2mouse
	function showToMouse(location) {
		obj(location).style.display = 'block';
		obj(location).style.left = tempX+'px'; 
		obj(location).style.top = tempY+'px';
	}

// show photo gallery
	function showPhotoGallery() {
		document.getElementsByTagName('html')[0].style.overflow = 'hidden';
		document.getElementsByTagName('body')[0].style.overflow = 'hidden';
		showElem('gallery_light');
		showElem('gallery_holder');
		obj('gallery_holder').style.height = getHeight();
//		document.body.scroll = 'no';
//		window.scroll = 'no';
		scrollTop = document.body.scrollTop;
		document.body.scrollTop = 0;
		if (scrollTop == 0) {
			scrollTop = document.documentElement.scrollTop;
			document.documentElement.scrollTop = 0;
		}
	}

// hide photo gallery
	function hidePhotoGallery() {
		hideElem('gallery_light');
		hideElem('gallery_holder');
		document.getElementsByTagName('html')[0].style.overflow = 'auto';
		document.getElementsByTagName('body')[0].style.overflow = 'auto';
		document.body.scrollTop = scrollTop;
//		document.body.scroll = 'yes';
//		window.scroll = 'yes';
	}


// legislatie
	function writeToDiv(location, xml_text) {
		obj(location).style.display = 'block';
		obj(location).innerHTML = xml_text;
	}


/*
	// example of use:
	// makeRequest('dummy_ajax.html', 'innerWrite(\'contentHolder\', xml_text)');

*/

	function getHeight() {
		if (document.compatMode && document.compatMode != "BackCompat")
			theHeight = document.documentElement.clientHeight;
		else
			theHeight = document.body.clientHeight;
		return theHeight;
	}



// get mouse position

var IE = document.all?true:false
if (!IE)  document.captureEvents(Event.MOUSEMOVE)

var tempX = 0
var tempY = 0

function getMouseXY(e) { 
  if (IE) { 
	var temp = document.body.scrollTop
	if (document.body.scrollTop == 0 && document.documentElement.scrollTop > 0) temp = document.documentElement.scrollTop // IE 6, doctype
    tempY = event.clientY + temp
    tempX = event.clientX + document.body.scrollLeft
  } 
  else {  
    tempX = e.pageX
    tempY = e.pageY
  }  

  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}   
}
