var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
	var pageTracker = _gat._getTracker("UA-11297686-3");
	pageTracker._trackPageview();
} catch(err) {}

$(function() { 
	$('.rollover').hover(function() { 
	var currentImg = $(this).attr('src'); 
	$(this).attr('src', $(this).attr('hover')); 
$(this).attr('hover', currentImg); 
}, function() { 
	var currentImg = $(this).attr('src'); 
	$(this).attr('src', $(this).attr('hover')); 
	$(this).attr('hover', currentImg); 
	}); 
});

$(function() {
	$('.element').click(function(){
		window.location = $(this).attr('href');
	});
});
$(function() {
	$('.hrefNyroModal').click(function(){
		window.location = $(this).attr('href');
	});
});

function Download(data){
	var ref = $('#' + data).val();
		$.get("download_ref.asp", {TxtRef: ref}, function (xml){
			if ( $("RESPUESTA", xml).text() == "OK" ) {
				callNyroManual(ref, data, $("APID", xml).text());
			}	
		}
	);
};

function send_contact() {
	var urlLoad
	urlLoad = "consult_ficha.asp?consulta=" + $("#text_send").val();
	if ( $("#text_send").val() == "" ) {
		alert("Introduzca una consulta");
	}else{
		$.nyroModalManual({
			  url: urlLoad
		});
	}
		return false;
	
};

function openGreyBox_OUTDOOR()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/OUTDOOR/Vibia_OUTDOOR_09');
};

function openGreyBox_LEDS_de()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/LEDS/VIBIA_Formacion_LED_ALE');
};

function openGreyBox_LEDS_es()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/LEDS/VIBIA_Formacion_LED_ESP');
};

function openGreyBox_LEDS_en()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/LEDS/VIBIA_Formacion_LED_ING');
};

function openGreyBox_LEDS_it()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/LEDS/VIBIA_Formacion_LED_ITA');
};

function openGreyBox_SKYLIGHTS_de()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/SKYLIGHTS/VIBIA_Formacion_SKYLIGHTS_ALE');
};

function openGreyBox_SKYLIGHTS_es()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/SKYLIGHTS/VIBIA_Formacion_SKYLIGHTS_ESP');
};

function openGreyBox_SKYLIGHTS_en()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/SKYLIGHTS/VIBIA_Formacion_SKYLIGHTS_ING');
};

function openGreyBox_SKYLIGHTS_it()
{
  callNyroURL('/down.asp?down_product=pdfs/banner_web/SKYLIGHTS/VIBIA_Formacion_SKYLIGHTS_ITA');
};

function callNyroURL(urlLoad){
$.nyroModalManual({
	 bgColor: '#000000',
	 width: 610,
	 height: 630,
	 url: urlLoad
    });
};

function callNyroIMG(urlLoad){
$.nyroModalManual({
	 url: urlLoad
    });
};		
function callNyroManual (ref, data, apid){
	var urlLoad ="";
	if (data == 'iPdf'){
		urlLoad= "down.asp?down_pdf=pdfsdownload/fichas/" + apid + "/" + ref + ".zip";
	}else if (data == 'iAbmient'){
		urlLoad= "down.asp?down_ambient=imagenes/aplicaciones/" + apid + "/ambiente/download/" + ref;
	}else if (data == 'iProduct'){
		urlLoad= "down.asp?down_product=imagenes/aplicaciones/" + apid + "/producto/download/" + ref;
	}else if (data == 'iCat'){
		urlLoad= "down.asp?down_catalogo=pdfsdownload/catalogo/vibia_catalogue.zip";
	}else if (data == 'iOut'){
		urlLoad= "down.asp?down_outdoor=pdfsdownload/catalogo/Vibia_OUTDOOR_09.zip";	
	}
	$.nyroModalManual({
	  bgColor: '#000000',
	  width: 610,
	  height: 630,
      url: urlLoad
    });
	return false;
};
