<!--
function makesure(message) {
	if (confirm(message)) {
		return true;
	} else {
		return false;
	}
}
function ge(el){
	return document.getElementById(el).getElementsByTagName('ul');
}
function is_displayed(el){
	if(el.style.display == "block" || el.style.display == ""){return true;}else{return false;}
}
function set_display(el, set){
	el.style.display = set;
}
function change_img(el, set){
	 document.getElementById(el).src = "templates/alsarayanet/images/"+set;
}
function toggle(el){
	var toggled = ge(el);
	if(is_displayed(toggled[0])){
		set_display(toggled[0], "none");
		change_img(el+'_img','plus.gif');
	}else{
		set_display(toggled[0], "block");
		change_img(el+'_img','minus.gif');
	}
}
function toggle1(el){
	var toggled = ge(el);
	if(is_displayed(toggled)){
		set_display(toggled, "none");
	}else{
		set_display(toggled, "block");
	}
}
function show(divID) {
	document.getElementById(divID).style.visibility = 'visible';
	document.getElementById(divID).style.zIndex = 1000;
} 
function hide(divID) { 
	document.getElementById(divID).style.visibility = 'hidden';
	document.getElementById(divID).style.zIndex = 10;
}
function show1(divID) {
	document.getElementById(divID).style.display = 'block'; 
} 
function hide1(divID) { 
	document.getElementById(divID).style.display = 'none';
}
var ajaxObjects = new Array();
function sack(file){
	this.AjaxFailedAlert = "Your browser does not support the enhanced functionality of this website, and therefore you will have an experience that differs from the intended one.\n";
	this.requestFile = file;
	this.method = "POST";
	this.URLString = "";
	this.encodeURIString = true;
	this.execute = false;
	this.onLoading = function() { };
	this.onLoaded = function() { };
	this.onInteractive = function() { };
	this.onCompletion = function() { };
	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err) {
				this.xmlhttp = null;
			}
		}
		if(!this.xmlhttp && typeof XMLHttpRequest != "undefined")
			this.xmlhttp = new XMLHttpRequest();
		if (!this.xmlhttp){
			this.failed = true; 
		}
	};
	
	this.setVar = function(name, value){
		if (this.URLString.length < 3){
			this.URLString = name + "=" + value;
		} else {
			this.URLString += "&" + name + "=" + value;
		}
	}
	
	this.encVar = function(name, value){
		var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value);
	return varString;
	}
	
	this.encodeURLString = function(string){
		varArray = string.split('&');
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split('=');
			if (urlVars[0].indexOf('amp;') != -1){
				urlVars[0] = urlVars[0].substring(4);
			}
			varArray[i] = this.encVar(urlVars[0],urlVars[1]);
		}
	return varArray.join('&');
	}
	
	this.runResponse = function(){
		eval(this.response);
	}
	
	this.runAJAX = function(urlstring){
		this.responseStatus = new Array(2);
		if(this.failed && this.AjaxFailedAlert){ 
			alert(this.AjaxFailedAlert); 
		} else {
			if (urlstring){ 
				if (this.URLString.length){
					this.URLString = this.URLString + "&" + urlstring; 
				} else {
					this.URLString = urlstring; 
				}
			}
			if (this.encodeURIString){
				var timeval = new Date().getTime(); 
				this.URLString = this.encodeURLString(this.URLString);
				this.setVar("rndval", timeval);
			}
			if (this.element) { this.elementObj = document.getElementById(this.element); }
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					var totalurlstring = this.requestFile + "?" + this.URLString;
				}
				if (this.method == "POST"){
  					try {
						this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')  
					} catch (e) {}
				}
				this.xmlhttp.open(this.method, this.requestFile, true);
				this.xmlhttp.send(this.URLString);
				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState){
						case 1:
							self.onLoading();
						break;
						case 2:
							self.onLoaded();
						break;
						case 3:
							self.onInteractive();
						break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;
							self.onCompletion();
							if(self.execute){ self.runResponse(); }
							if (self.elementObj) {
								var elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							self.URLString = "";
						break;
					}
				};
			}
		}
	};
this.createAJAX();
}
// General utility Functions called from multiple external js
var utilsLib = {
	getPageScroll: function()
	{
		var yScroll;
		if(self.pageYOffset)
		{
			yScroll = self.pageYOffset;
		}
		else if(document.documentElement && document.documentElement.scrollTop) // Explorer 6
		{
			yScroll = document.documentElement.scrollTop;
		}
		else if(document.body) // all other Explorers
		{
			yScroll = document.body.scrollTop;
		}
		arrayPageScroll = new Array('',yScroll);
		return arrayPageScroll;
	},
	getPageSize: function()
	{
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
	}
}

//  settings ----------------------------
var CloseImg = IMAGES_PATH + "closepl.gif";
// General settings
var popshowdelay = 800;
// Inizialization
var objOverlay = false;
var objLightbox = false;
/********************** ShowPop ********************************/
function _showPop(divID, delayno)
{
	// Clear all the external calling ant timeouts delay
	Pop_clear();
	if(!objOverlay)
	{
		var objBody = document.getElementsByTagName("body").item(0);
		objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','overlay');
		objOverlay.style.position = 'absolute';
		//objOverlay.onclick = function () {_hideLightbox(); return false;}
		objOverlay.style.display = 'none';
		objOverlay.style.top = '0';
		objOverlay.style.left = '0';
		objOverlay.style.zIndex = '90';
 		objOverlay.style.width = '100%';
		// This method seems to be very much faster than using a png background
		objOverlay.style.backgroundColor = '#000';
		objOverlay.style.opacity = '.80';
		objOverlay.style.filter = 'alpha(opacity=80)'; 
		objOverlay.style.MozOpacity = '0.8';
		objBody.insertBefore(objOverlay, objBody.firstChild);
		objLightbox = document.createElement("div");
		objLightbox.setAttribute('id','lightbox');
		objLightbox.style.display = 'none';
		objLightbox.style.position = 'absolute';
		objLightbox.style.zIndex = '100';
		objLightbox.style.border = '1px solid #698490';
		objLightbox.style.backgroundColor = '#f1f6fb';
		objLightbox.style.padding = '4px';
		//objLightbox.style.fontSize = '0.8em';
		objBody.insertBefore(objLightbox, objOverlay.nextSibling);
		var objLink = document.createElement("a");
		objLink.setAttribute('href','#');
		objLink.setAttribute('title','Click to close');
		objLink.onclick = function () {_hideLightbox(); return false;}
		objLink.style.textAlign = 'right';
		objLightbox.appendChild(objLink);
		var objCloseButton = document.createElement("img");
		objCloseButton.src = CloseImg;
		objCloseButton.setAttribute('id','closeButton');
		objCloseButton.style.position = 'absolute';
		objCloseButton.style.zIndex = '200';
		objCloseButton.style.border = '0';
		objLink.appendChild(objCloseButton);
		var objContent = document.createElement("div");
		objContent.setAttribute('id','lightboxContent');
		objContent.style.overflow = 'hidden';
		objLightbox.appendChild(objContent);
	}
	var arrayPageSize = utilsLib.getPageSize();
	objOverlay.style.width = (arrayPageSize[0] + 'px');
	objOverlay.style.height = (arrayPageSize[1] + 'px');
	// Reset runtime changed values
	document.getElementById('lightboxContent').style.height = "";
	document.getElementById('lightboxContent').style.width = "";
	objLightbox.style.width =  "";
	objLightbox.style.height = "";
	// immediate or delay Calling?
	if (delayno == null){
		divPopup_showContent(divID);
	} else {
		delayshow = setTimeout("divPopup_showContent('" + divID + "')",popshowdelay);
	}
}
function _hideLightbox()
{
	document.getElementById('overlay').style.display = 'none';
	document.getElementById('lightbox').style.display = 'none';
	if (typeof delayshow!="undefined") clearTimeout(delayshow);
}
function divPopup_showContent(request)
{
	objOverlay.style.display = 'block';
	objLightbox.style.display = 'block';
	objLightbox.style.visibility='hidden';
	document.getElementById('lightboxContent').innerHTML = document.getElementById(request).innerHTML;
	var arrayPageSize = utilsLib.getPageSize();
	var arrayPageScroll = utilsLib.getPageScroll();
	var myw = document.getElementById('lightboxContent').offsetWidth - 10;
	var myh = document.getElementById('lightboxContent').offsetHeight;
	if (myh > arrayPageSize[3]) {
		myh = myh -170;
		document.getElementById('lightboxContent').style.height = myh + "px";
		objLightbox.style.height = myh + 'px';		
	}
	var lightboxTop = event.clientY - (myh/2);
	//var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 20 - myh) /2);
	var lightboxLeft = event.clientX - (myw/2);
	//var lightboxLeft = ((arrayPageSize[0] - myw - 20) /2);
	objLightbox.style.width =  myw + 'px';
	objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px";
	objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px";
	objLightbox.style.left = (lightboxLeft > (arrayPageSize[0] - myw) ) ? (arrayPageSize[0] - myw - 40) + "px" : lightboxLeft + "px";
	document.getElementById('closeButton').style.top = "0px";
	document.getElementById('closeButton').style.left = (myw + 10) + "px";
	objLightbox.style.visibility='visible';
}
// clear the timeouts
function Pop_clear(){
	if (typeof delayshow!="undefined")
		clearTimeout(delayshow);
}
function ajaxPopup_loadContent(url)
{
	var ajaxIndex = ajaxObjects.length;
	ajaxObjects[ajaxIndex] = new sack();
	ajaxObjects[ajaxIndex].requestFile = url;	// Specifying which file to get
	ajaxObjects[ajaxIndex].onCompletion = function(){ ajaxPopup_showContent(ajaxObjects[ajaxIndex]); };	// Specify function that will be executed after file has been found
	ajaxObjects[ajaxIndex].runAJAX();		// Execute AJAX function
}
function ajaxPopup_showContent(request)
{
	objOverlay.style.display = 'block';
	objLightbox.style.display = 'block';
	//objLightbox.style.visibility='hidden';
	document.getElementById('lightboxContent').innerHTML = request.response;
	var arrayPageSize = utilsLib.getPageSize();
	var arrayPageScroll = utilsLib.getPageScroll();
	var myw = document.getElementById('lightboxContent').offsetWidth;
	var myh = document.getElementById('lightboxContent').offsetHeight;
	if (myh > arrayPageSize[3]) {
		myh = myh -170;
		document.getElementById('lightboxContent').style.height = myh + "px";
		objLightbox.style.height = myh + 'px';		
	}
	var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 20 - myh) / 2);
	var lightboxLeft = ((arrayPageSize[0] - 20 - myw) / 2);
	objLightbox.style.width =  myw + 'px';
	objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px";
	objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px";
	document.getElementById('closeButton').style.top = "8px";	
	document.getElementById('closeButton').style.left = (myw -28) + "px";
	objLightbox.style.visibility='visible';
}