<!--
function menu(a){	
	$("#"+a ).css({'color':'#fff','background':'url(images/'+a+'.png) no-repeat'});
}
function fecha(){
	var fec = new Date();	
	document.write("® Eleman Trives "+fec.getFullYear());
	//alert(fec.getFullYear());
}
var ancho;
var contenedor;
var paso;
var celdas ;
var ocultas;
var laX;
var visibles;
var inicioD = 0;
var inicioI = 0;
function mideSlider(){
	ancho = $(".sliderInt table").width();
	contenedor = $(".slider").width();
	celdas =  $(".sliderInt td").length;
	paso = $(".sliderInt td").width();
	visibles = Math.round(contenedor/paso);
	ocultas = Math.round(celdas-visibles);
	//alert(ocultas);
	//alert("ancho = "+ancho+", contenedor = "+contenedor);
	if(ancho>contenedor){
		$("#flechaDcha").show();	
	}
}
var imG;
var imGOld;
$(document).ready(function(){

  $.preloadCssImages();  
	$("a[rel^='prettyPopin']").prettyPopin({
			modal : false, /* true/false */
			width : false, /* false/integer */
			height: false, /* false/integer */
			opacity: 0.7, /* value from 0 to 1 */
			animationSpeed: 'fast', /* slow/medium/fast/integer */
			followScroll: true, /* true/false */
			loader_path: '/Content/images/prettyPopin/loader.gif', /* path to your loading image */
			callback: function(){} /* callback called when closing the popin */
		});
	
	$(".sliderInt a").click(function () {
		var orden =  $(".sliderInt a").index(this);	
		
		imGOld = imG;
		imG = orden;
		
		if(imGOld!=undefined&&imGOld!=imG){
			$(".sliderInt img:eq("+imGOld+")").css({'border':'#cececc solid 3px'});
		}
			$(".sliderInt img:eq("+imG+")").css({'border':'#81a63d solid 3px'});
		/*var carga = $(".sliderInt a:eq("+imG+")").attr('href');
		llamarasincrono(carga, "contentAjax");*/
		return false;
    });
	
	$("input:text").click(function () {
      var orden =  $("input:text").index(this);	
	    $("input:text:eq("+orden+")").val("");
    });
	$("textarea").click(function () {
      var orden =  $("textarea").index(this);	
	    $("textarea:eq("+orden+")").val("");
    });
	
	var listo = 0;
	$("#flechaDcha").click(function () {
		if (listo == 0){
			listo = 1;
			if(inicioD<ocultas){
				laX = $('.sliderInt table').position().left;
				//alert(laX);
				var newX = laX-paso;
				$('.sliderInt table').animate({
					left: newX
				  }, 500, function() {
					inicioD++;
					if(inicioD==ocultas){
						$("#flechaDcha").hide();	
					}
					$("#flechaIzda").show();	
					listo = 0;
			  });
			}
			

		}
    });
	$("#flechaIzda").click(function () {
		if (listo == 0){
			listo = 1;
			if(inicioD>0){
				laX = $('.sliderInt table').position().left;
				//alert(laX);
				var newX = laX+paso;
				$('.sliderInt table').animate({
					left: newX
				  }, 500, function() {
					inicioD--;
					if(inicioD==0){
						$("#flechaIzda").hide();	
					}
					$("#flechaDcha").show();	
					listo = 0;
			  });
			}
		}
    });
	
}); 

function abrir(a,e,b,c,d){
	if(document.all){var ventanaW=document.body.clientWidth;}
	else{var ventanaW=window.innerWidth}
	if(document.all){var ventanaH=document.body.clientHeight+150;}
	else{var ventanaH=window.innerHeight}
	var w = ventanaW/2;
	w = w-(b/2);
	var h = ventanaH/2;
	h = h-(c/2);
	window.open(a, e, 'width='+b+', height='+c+', top='+h+',left='+w+', scrollbars='+d+', location=0');
}

function validarHome(formu) {
    var texto = '';
    if (formu.nombre.value == '')
        texto += "- El campo nombre es obligatorio.\n";
    if (formu.email.value == '')
        texto += "- El campo email es obligatorio.\n";
    else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formu.email.value))) {
        texto += "- Formato de email incorrecto.\n";
    }
    if (formu.consulta.value == '')
        texto += "- El campo consulta es obligatorio.\n";
    if (texto != '') {
        alert(texto);
        return false;
    }
    return true;
};

function validar(formu) {
    var texto = '';
    if (formu.nombre.value == '')
        texto += "- El campo nombre es obligatorio.\n";
    if (formu.email.value == '')
        texto += "- El campo email es obligatorio.\n";
    else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formu.email.value))) {
        texto += "- Formato de email incorrecto.\n";
    }
    if (formu.consulta.value == '')
        texto += "- El campo consulta es obligatorio.\n";
    if (texto != '') {
        alert(texto);
        return false;
    }
    return true;
};

function llamarasincrono(url, id_contenedor){	
	$.ajax({
		  method: "get",	
		  url: url,
		  error: function(event, request, settings){
alert("Error requesting page " + settings.url );},
		  beforeSend: function(){$("#"+id_contenedor).html("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100'><tr><td align='center'><img src='images/ajax_loader.gif' /><br />Cargando...</td></tr></table>");},
		  success: function(html){ 
			  $("#"+id_contenedor).html(html);
		  }
	   }); //close $.ajax(	
}

//-->
