
/*

DESARROLLADO POR SERGIO BALLESTERO
WWW.WEB507.COM

*/

function setCookie(value) { document.cookie='lang'+ "=" +escape(value); }

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function checkCookie() {
	lang=getCookie('lang');
	if (lang==null || lang=="") {
		location.href='intro.php';
	}
}

function change_language(value) {
	setCookie(value);
	location.reload(true);
}

//------------------------------------------------------------------------


var hoverEffect;

//-------- OVER SERVICIOS INDEX --------

var hover_serv_index = Class.create({
		
	initialize: function(conteiner, cuanto) {
    	//this.conteiner = $$('div#' + conteiner + ' ul li a');
		this.conteiner = $$('div.' + conteiner);
    	this.cuanto = cuanto;
		this.set_listeners();
  	},

	set_listeners: function() {
		var obj = this;
		this.conteiner.each(function(element){
			element.setStyle({ 'position':'relative' });
			
			element.observe('mouseover', function(event){
			  obj.mouseOverItem(element);
			});
			
			element.observe('mouseout', function(event){
			  obj.mouseOutItem(element);
			});
		})
		
	},
	
	/*** ANIMATION HOVER ***/

 	mouseOverItem: function(element) {
		var obj = this;
		hoverEffect = new Effect.Morph(element, {
			style:'background-color: #2c5b75; cursor:hand ',
			duration:0.4
		});
	},

	mouseOutItem: function(element) {
		hoverEffect.cancel();
		element.morph('background-color: #0e3952; cursor="none"',{duration:0.3});
	}
	
});







