// FUNCIONES PARA EL TAMAŅO DEL LIENZO
function WindowHeight(){
	var WindowHeight = 0;
	if( typeof( window.innerWidth ) == 'number' )
	WindowHeight = window.innerHeight;
	else if (document.documentElement &&  document.documentElement.clientHeight)
	WindowHeight = document.documentElement.clientHeight;
	else if(document.body && document.body.clientHeight)
	WindowHeight = document.body.clientHeight;
	return WindowHeight;
}
	
function WindowWidth(){
	var WindowWidth = 0;
	if( typeof( window.innerWidth ) == 'number' )
	WindowWidth = window.innerWidth;
	else if (document.documentElement &&  document.documentElement.clientWidth)
	WindowWidth = document.documentElement.clientWidth;
	else if(document.body && document.body.clientWidth)
	WindowWidth = document.body.clientWidth;
	return WindowWidth;
}

//AJAX Y EFECTOS}
/*
function ajax_open_home(contenido,get){
	document.getElementById('div_reflejo').style.display="none";
	$("#div_marco_cotenido").fadeOut("fast",function()
		{
			$("#div_portafolio").fadeOut("fast");
			$("#div_paginador").fadeOut("fast");
			$("#div_paginador_1").fadeOut("fast");
			$("#div_paginador_2").fadeOut("fast");
			$("#div_paginador_3").fadeOut("fast");
			
			$("#div_sombra_franja").fadeIn("normal");
			document.getElementById('img_codigo').src="images/puzz/codigo.png";
			document.getElementById('img_franja').src="images/puzz/franja.png";
			document.getElementById('img_luz_franja').src="images/puzz/luz_franja.png";
			
			$("#div_logo_min").fadeOut("fast");
			$("#div_logo_min_letra").fadeOut("fast");
			$("#div_contenido_perfil").fadeOut("fast");
			$("#div_contenido_servicios").fadeOut("fast");
			$("#div_contenido_contacto").fadeOut("fast");
			$("#div_reflejo").fadeOut("fast");
			$("#div_logo_big").fadeIn("fast");
		});
}
*/

function ajax_open_portafolio(contenido,get){
	$("#div_marco_cotenido").fadeOut("fast",function()
		{
			$("#div_logo_big").fadeOut("fast",function()
			{
				$("#div_logo_min").fadeIn("fast");
				$("#div_logo_min_letra").fadeIn("fast");
				
				document.getElementById('div_reflejo').style.display="none";
				
				document.getElementById('div_codigo').style.display="none";
				
				document.getElementById('img_codigo').src="images/puzz/codigo_verde.png";
				
				$("#div_codigo").fadeIn(5000);	
				
				document.getElementById('img_franja').src="images/puzz/franja_verde.png";
				document.getElementById('img_luz_franja').src="images/puzz/luz_franja_verde.png";						 
				$("#div_sombra_franja").fadeOut("fast");
				$("#div_portafolio").fadeIn("fast");
				
				document.getElementById('div_portafolio').innerHTML=document.getElementById('div_portafolio_1').innerHTML;
				$('#div_portafolio').fadeIn("fast");
				$("#div_paginador").fadeIn("fast");
				setTimeout('$("#div_paginador_1").fadeIn("fast")',100);
				setTimeout('$("#div_paginador_2").fadeIn("fast")',200);
				setTimeout('$("#div_paginador_3").fadeIn("fast")',300);
				document.getElementById('img_paginador_1').src="images/puzz/paginador_1_over.png";
				document.getElementById('img_paginador_2').src="images/puzz/paginador_2.png";
				document.getElementById('img_paginador_3').src="images/puzz/paginador_3.png";
			});
	 });
}

function set_portafolio(num){
	pag_portafolio=num;
	
	document.getElementById('img_paginador_1').src="images/puzz/paginador_1.png";
	document.getElementById('img_paginador_2').src="images/puzz/paginador_2.png";
	document.getElementById('img_paginador_3').src="images/puzz/paginador_3.png";
	document.getElementById('img_paginador_' + num).src="images/puzz/paginador_" + num + "_over.png";
		
	$('#div_portafolio').fadeOut("fast",function(){	
		
		document.getElementById('div_portafolio').innerHTML=document.getElementById('div_portafolio_' + num).innerHTML;
		
		
		$('#div_portafolio').fadeIn("fast");
	});
	
}

function ajax_open_contenido(contenido,get){
	$("#div_portafolio").fadeOut("fast");
	$("#div_paginador").fadeOut("fast");
	$("#div_paginador_1").fadeOut("fast");
	$("#div_paginador_2").fadeOut("fast");
	$("#div_paginador_3").fadeOut("fast");
	
	document.getElementById('img_codigo').src="images/puzz/codigo.png";
	document.getElementById('img_franja').src="images/puzz/franja.png";
	document.getElementById('img_luz_franja').src="images/puzz/luz_franja.png";
	

	$("#div_logo_big").fadeOut("fast");
	$("#div_logo_min").fadeIn("fast");
	$("#div_sombra_franja").fadeIn("fast");
	$("#div_logo_min_letra").fadeIn("fast");
	
	$("#div_marco_cotenido").fadeIn("fast");
	
	$("#div_contenido").fadeOut("fast",function()
		{
			document.getElementById('div_contenido').innerHTML=document.getElementById('div_contenido_' + contenido).innerHTML;
		});
	
	$("#div_contenido").fadeIn("fast");

	$("#div_reflejo").fadeIn("fast");
}




function effectFadeIn(id) {
	$("#"+id).fadeTo(7000,0.55, function() {
    	effectFadeOut(id)
    });
}

function effectFadeOut(id) {
	$("#"+id).fadeTo(7000,0.8, function() {
    	effectFadeIn(id)
    });
}

	

function animar_plantilla_negro(){

	
	setTimeout('$("#div_codigo").fadeIn(8000)',500);
	setTimeout('$("#div_sombra").fadeIn(2000)',500);
	
	setTimeout('$("#div_sombra_franja").fadeIn("normal")',800);
	setTimeout('$("#div_franja").fadeIn("normal")',800);
	
	setTimeout('$("#div_luz_franja").fadeIn(3000)',1000);
	
	//setTimeout('effectFadeIn("div_codigo");',8500);

//	setTimeout('$("#div_logo_big").fadeIn("normal")',1600);
	
	//document.getElementById('div_logo_big_letra').style.backgroundImage="url(images/puzz/logo_big_letra_" + global_lang + ".png)";
	
	setTimeout('$("#div_bto_1").fadeIn(900)',3000);
	setTimeout('$("#div_bto_2").fadeIn(900)',3400);
	setTimeout('$("#div_bto_3").fadeIn(900)',3800);
	setTimeout('$("#div_bto_4").fadeIn(900)',4200);
	setTimeout('$("#div_bto_5").fadeIn(900)',4600);
	
	
//	setTimeout('$("#div_logo_big_letra").fadeIn("normal")',3200);
	
	
	
	setTimeout('$("#div_logo_min").fadeIn(3000)',5000);
	setTimeout('$("#div_logo_min_letra").fadeIn(2000)',6000);
	setTimeout('$("#div_corner").fadeIn("normal")',7400);
	
	setTimeout('$("#img_cuadro_contenido").fadeIn(2000)',8000);
	
}



function paginador_over(nro){
	document.getElementById('img_paginador_'+nro).src="images/puzz/paginador_" + nro + "_over.png";
}
function paginador_out(nro){
	if(nro!=pag_portafolio) document.getElementById('img_paginador_'+nro).src="images/puzz/paginador_" + nro + ".png";
}

// SHADOWBOX
function showiframe(path,title){
	Shadowbox.open({
		title:      title,
		type:       'iframe',
		content:    path,
		width:   925,
		height:   540
	},{   
		resizeDuration: 0.1, 
		fadeDuration: 0.1 });
} 

function showinline(path,title){
	Shadowbox.open({
	title:      title,
	type:       'inline',
	content:    path,
	width:   925,
	height:   540
	},{   
		resizeDuration: 1, 
		fadeDuration: 1 }); 
}
