// JavaScript Document
var browserName=navigator.appName; 
if (browserName=="Microsoft Internet Explorer")
 {
var myString = new String(navigator.appVersion);
var myArray = myString.split('MSIE');
var version = myArray[1].split(';');
var ver = version[0].split('.');
ve= ver[0];

 }else{ve=''}

if(ve==7){
document.write('<link href="css/ie7.css" rel="stylesheet" type="text/css" />');
}else{
document.write('<link href="css/main.css" rel="stylesheet" type="text/css" />');
}


$(document).ready(function(){
if(browserName=navigator.appName=='Netscape'){$('.fuente').hide();
$('.fuente').hide();
$('.sombra').css('color','#ffffff');
}	
	$("ul#nav li a").hover(function() { //When trigger is clicked...
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").stop(true, true).slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			
			$(this).parent().find("ul.subnav").stop(true, true).slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

	// Aņadir botones sociales
	$("#pow span div").remove();
	$('#foot').prepend('<div id="social"><ul class="azul"><li><iframe src="//www.facebook.com/plugins/like.php?href&amp;send=false&amp;layout=button_count&amp;width=130&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:130px; height:21px;" allowTransparency="true"></iframe></li>                  <li><a href="https://twitter.com/share" class="twitter-share-button" data-lang="es">Twittear</a></li><li><g:plusone size="medium"></g:plusone></li></ul></div>');
	// Boton Twitter
	!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
	// Boton Google
	window.___gcfg = {lang: 'es-419'};(function() {var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;po.src = 'https://apis.google.com/js/plusone.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);})();

});


function ventana (pagina) {
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=1020, height=680, top="+screen.width*0.5 + ", left="+ screen.height*0.5;
window.open(pagina,"",opciones);
}

function cargIMG(SR){
 $(function () {
        var img = new Image();
        $(img).load(function () {
            $(this).hide();
            $('#loader').removeClass('loading').append(this);
            $(this).fadeIn().height(525).width(1020)
        }).error(function () {
        }).attr('src', SR);
    });
}

