$(document).ready(function(){
	
	//hover de menu superior index2
	
	$.preloadCssImages();
	
	$('.explode').css('z-index','10').delay(1500).show('explode', { pieces: 20 }, 1000);
	
	$('.explode2').css('z-index','10').delay(1500).show('explode', { pieces: 20 }, 1000);
	
	$('#corre_logos').pan({fps: 30, speed: 1.5, dir: 'left', depth: 30});
	$('#corre_logos2').pan({fps: 30, speed: 1.5, dir: 'left', depth: 30});
	
	
	$("#cua_pq_np, #pq_np").mouseover(function(){
		$('#pq_np span').css("background-position","0px -35px");
			$("#pq_np div").addClass("div_flecha_sub_h");
		}).mouseout(function(){
		 $('#pq_np span').css("background-position","0px 0px");
		 $("#pq_np div").removeClass("div_flecha_sub_h");
		
	});
	
	
	$("#corre_logos ,#corre_logos2, #redirec_exito, .izhist_exito, #clien_titu").mouseover(function(){
			$('#clien_titu span').css("background-position","0px -35px");
			$("#clien_titu div").addClass("div_flecha_sub_h");
			$("#corre_logos2").css("height","63px");
		$("#corre_logos").css("height","0px");
		
	}).mouseout(function(){
		 $('#clien_titu span').css("background-position","0px 0px");
		 $("#clien_titu div").removeClass("div_flecha_sub_h");
		 $("#corre_logos").css("height","63px");
		$("#corre_logos2").css("height","0px");
	});
	
	
	$(".boton_izq").mouseover(function(){
		
		$('#clien_titu span').css("background-position","0px -35px");
		
		$("#clien_titu div").addClass("div_flecha_sub_h");
		$('#corre_logos').spSpeed(4).spChangeDir('right');
		$('#corre_logos2').spSpeed(4).spChangeDir('right');
		$("#corre_logos2").css("height","63px");
		$("#corre_logos").css("height","0px");
		//$(".veloc_mar").attr("scrolldelay","1");
		//$(".veloc_mar").attr("direction","right" );
		return false;
		}).mouseout(function(){
			$('#clien_titu span').css("background-position","0px 0px");
		
		$("#clien_titu div").removeClass("div_flecha_sub_h");
			$('#corre_logos').spSpeed(1.5); 
			$('#corre_logos2').spSpeed(1.5); 
			$("#corre_logos").css("height","63px");
			$("#corre_logos2").css("height","0px");
		//$(".veloc_mar").attr("scrolldelay","100");
		//$(".veloc_mar").attr("direction","right" );
		return false;
		}); 
		
		
	$(".boton_der").mouseover(function(){
		$('#clien_titu span').css("background-position","0px -35px");
		
		$("#clien_titu div").addClass("div_flecha_sub_h");
		$('#corre_logos').spSpeed(4).spChangeDir('left');
		$('#corre_logos2').spSpeed(4).spChangeDir('left');
		$("#corre_logos2").css("height","63px");
		$("#corre_logos").css("height","0px");
		//$(".veloc_mar").attr("scrolldelay","1");
		//$(".veloc_mar").attr("direction","left" );
		return false;
		}).mouseout(function(){
			$('#clien_titu span').css("background-position","0px 0px");
		
		$("#clien_titu div").removeClass("div_flecha_sub_h");
			$('#corre_logos').spSpeed(1.5); 
			$('#corre_logos2').spSpeed(1.5); 
			$("#corre_logos").css("height","63px");
			$("#corre_logos2").css("height","0px");
		//$(".veloc_mar").attr("scrolldelay","100");
		//$(".veloc_mar").attr("direction","left" );
		return false;
		}); 	
	

	$(".cuadro_high").mouseover(function(){
		$(".menu_desp1").css("display","none");

		return false;
		}).mouseout(function(){
		$(".menu_desp1").css("display","none");

		return false;
	});
	
	$("#soluciones_men2").mouseover(function(){
		$("#img_soluciones2").attr("src","../images/esp/soluciones_h_i3.png");
		
	}).mouseout(function(){
		$("#img_soluciones2").attr("src","../images/esp/soluciones_i3.png");
	
	});
	
	
	$("#soluciones_men2p").mouseover(function(){
		$("#img_soluciones2").attr("src","../images/por/soluciones_h_i3.png");
		
	}).mouseout(function(){
		$("#img_soluciones2").attr("src","../images/por/soluciones_i3.png");
	
	});
	
	
	$(".soluciones_men2vh").mouseover(function(){
		
		$(".menu_desp2").fadeIn(700);
	}).mouseout(function(){
		
		$(".menu_desp2").css("display","none");
	});
	
	
	$("#industria_menu_e").mouseover(function(){
		$("#img_industria").attr("src","../images/esp/industria_h_i3.png");
		
		//$( ".menu_desp2" ).show('fold', {}, 500);
	}).mouseout(function(){
		$("#img_industria").attr("src","../images/esp/industria_i3.png");
		
	});
	
	$(".industria_men").mouseover(function(){
		
		$(".menu_desp_industria").fadeIn(700);
	}).mouseout(function(){
		
		$(".menu_desp_industria").css("display","none");
	});

		$(".menu_desp_industria").mouseover(function(){
		$(".menu_desp_industria").css("display","block");
		return false;
		}).mouseout(function(){
		$(".menu_desp_industria").css("display","none");
		return false;
			
			}) ;
	
	
	$("#nues_fir2").mouseover(function(){
		$("#img_nues_fir").attr("src","../images/esp/nuestra_firma_h_i3.png");
		
		//$( ".menu_desp2" ).show('fold', {}, 500);
	}).mouseout(function(){
		$("#img_nues_fir").attr("src","../images/esp/nuestra_firma_i3.png");
		
	});
	
	
	$("#nues_fir2p").mouseover(function(){
		$("#img_nues_fir").attr("src","../images/por/nuestra_firma_h_i3.png");
		
		//$( ".menu_desp2" ).show('fold', {}, 500);
	}).mouseout(function(){
		$("#img_nues_fir").attr("src","../images/por/nuestra_firma_i3.png");
		
	});
	
	
	
	
	$(".nues_fir2vh").mouseover(function(){
	
		$(".menu_desp_firma").fadeIn(700);
		//$( ".menu_desp2" ).show('fold', {}, 500);
	}).mouseout(function(){
		
		$(".menu_desp_firma").css("display","none");
	});
	
	
	$("#histo_exi2").mouseover(function(){
		$("#img_histo_exi").attr("src","../images/esp/hist_exito_h_i3.png");
	}).mouseout(function(){
		$("#img_histo_exi").attr("src","../images/esp/hist_exito_i3.png");
	});
	
	
	$("#histo_exi2p").mouseover(function(){
		$("#img_histo_exi").attr("src","../images/por/hist_exito_h_i3.png");
	}).mouseout(function(){
		$("#img_histo_exi").attr("src","../images/por/hist_exito_i3.png");
	});
	
	
	/** ingles  ||||||| ***/
	$("#iznues_fir2").mouseover(function(){
		$("#izimg_nues_fir").attr("src","../images/eng/meni3h.png");
		
	}).mouseout(function(){
		$("#izimg_nues_fir").attr("src","../images/eng/meni3.png");
	
	});
	
	
	
	
	$("#izhisto_exi2").mouseover(function(){
		$("#izimg_histo_exi").attr("src","../images/eng/meni2h.png");
	}).mouseout(function(){
		$("#izimg_histo_exi").attr("src","../images/eng/meni2.png");
	});
	
	$("#izsoluciones_men2").mouseover(function(){
		$("#izimg_soluciones2").attr("src","../images/eng/meni1h.png");
				
		
	}).mouseout(function(){
		$("#izimg_soluciones2").attr("src","../images/eng/meni1.png");
				
	});
	
	
	
		
			$(".menu_desp2").mouseover(function(){
		$(".menu_desp2").css("display","block");
		return false;
		}).mouseout(function(){
		$(".menu_desp2").css("display","none");
		return false;
			
			}) ;	
	
	
	
	
	
	$(".menu_desp_firma").mouseover(function(){
		$(".menu_desp_firma").css("display","block");
		return false;
		}).mouseout(function(){
		$(".menu_desp_firma").css("display","none");
		return false;
			
			}) ;	
	
		
	$(".img_nosotros_popup").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_vimeo2.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
	});
	$(".img_unete_popup_esp").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_unete_esp.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
	});

	$(".img_unete_popup_por").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_unete_por.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
	});
	
	
	
	$("#cua_test_home, #testi_titu").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_vimeo.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
		
		});
		
	$("#testimonials_home").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_home_eng.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
		
	});

	$("#depoimentos_content, #depoimentos_title").click(function(){
		$.ajax({
			type:'POST',
			url:"../includes/php/video_home_por.php",
			cache:false,
						
			success: function(data){
					
					$("div.pop_video").html(data);
					
					
				}
			
		});
		
		$(".pop_fondo_video").fadeIn(2000);
		$(".pop_video").fadeIn(2000);
		
	});

	$("#icon_cerrar").click(function(){
		$(".pop_video").html('');
		$(".pop_fondo_video").fadeOut(1000);
		$(".pop_video").fadeOut(1000);
		
		});
	
	$('.barra_texto_banner2').delay(5000).fadeOut();
	
	/*	$(".mapa_sub_ame_peru").mouseover(function(){
		$(".mapa_sub_ame_peru").css("display","block"); 
	$('#img_zoom').css('height','125px').css('margin-Left','0px').css('margin-Top','0px');
		
		return false;
		
		}).mouseout(function(){
			$('#img_zoom').css('height','125px').css('margin-Left','0px').css('margin-Top','0px');
			$('.mapa_sub_ame_peru').delay(2000).fadeOut(); 
		return false;
			
			}); */

$("#dentro_sub_america").mouseenter(function(){
	$('#img_zoom').stop(false,true).animate({width:"196px",height: "168px",left: "-15",top:"-15"},  {duration:500});
	
	
	$("#dentro_sub_america").attr('coords',"0,0,0,0");
	
	
	$("#map_chile").attr('coords',"130,121,142,129");
	
	$("#map_brazil").attr('coords',"164,93,176,106");
	
	$("#map_colombia").attr('coords',"131,70,143,82");
	
	$("#map_eu").attr('coords',"124,18,136,30");  
	
	$("#map_canada").attr('coords',"108,18,118,24"); 
	
	$("#map_argentina").attr('coords',"140,125,150,136"); 
		
	return false;
	})
	

$(".barra_azul, .barra_texto_banner, .barra_texto_banner2, .barra_espacio_prin, #fcuadro_fueasd").mouseenter(function(){
	
	$("#dentro_sub_america").attr('coords',"48,4,139,125");
	$('#img_zoom').stop(false,true).animate({width:"153px",height: "131px",left: "0",top:"0"},  {duration:300});
	
	$("#map_chile").attr('coords',"0,0,0,0");
	
	$("#map_brazil").attr('coords',"0,0,0,0");
	
	$("#map_colombia").attr('coords',"0,0,0,0");
	
	$("#map_eu").attr('coords',"0,0,0,0"); 
	
	$("#map_canada").attr('coords',"0,0,0,0"); 
	
	$("#map_argentina").attr('coords',"0,0,0,0"); 
	
	return false;
	})


$("#map_eu").mouseover(function(){
	$(".texto_eu").css("top","295px").css("left","649px").css("display","block");
	return false;
}).mouseleave(function(){
	$(".texto_eu").css("display","none");
	return false;
});


$("#map_canada").mouseover(function(){
	$(".texto_canada").css("top","285px").css("left","550px").css("display","block");
	return false;
}).mouseleave(function(){
	$(".texto_canada").css("display","none");
	return false;
});

$("#map_argentina").mouseover(function(){

	$(".texto_argentina").css("top","385px").css("left","669px").css("display","block");
	
	return false;
}).mouseleave(function(){
	$(".texto_argentina").css("display","none");
	return false;
});


$("#map_mexico").mouseover(function(){
	$(".texto_mexico").css("top","330px").css("left","550px").css("display","block");
	return false;
	
}).mouseleave(function(){
	$(".texto_mexico").css("display","none");
	return false;
});


$("#map_colombia").mouseover(function(){
	
	$(".texto_colombia").css("top","342px").css("left","567px").css("display","block");
	return false;
	
}).mouseleave(function(){
	$(".texto_colombia").css("display","none");
	return false;
});

$("#map_peru").mouseenter(function(){
	$(".texto_peru").css("top","360px").css("left","603px").css("display","block");
	return false;	
}).mouseleave(function(){
	$(".texto_peru").css("display","none");
	return false;
});


$("#map_brazil").mouseover(function(){

	
	$(".texto_brazil").css("top","360px").css("left","691px").css("display","block");
	return false;

}).mouseleave(function(){
	$(".texto_brazil").css("display","none");
	return false;
});


$("#map_chile").mouseover(function(){

	$(".texto_chile").css("top","390px").css("left","599px").css("display","block");
	
	return false;
}).mouseleave(function(){
	$(".texto_chile").css("display","none");
	return false;
});











	
	
	$('.slideshow').nivoSlider({
		effect:'fold',
		animSpeed:500,
		pauseTime:5000,
		pauseOnHover:false,
		directionNav:false
		
	});
	
	

//	$('.text_solu_baner_fadein').delay(9000).fadeIn().delay(9000);


	
	$("#cua_test_home").mouseover(function(){
		$("#cua_test_home").css("background-position","0px -144px");
		
	}).mouseout(function(){
		$("#cua_test_home").css("background-position","0px 0px");
	});

	$("#testimonials_home").mouseover(function(){
		$("#testimonials_home").css("background-position","0px -144px");
		
	}).mouseout(function(){
		$("#testimonials_home").css("background-position","0px 0px");
	});
	
	$("#depoimentos_content").mouseover(function(){
		$("#depoimentos_content").css("background-position","0px -144px");
		
	}).mouseout(function(){
		$("#depoimentos_content").css("background-position","0px 0px");
	});

	$("#cua_solu_home").mouseover(function(){
		$("#cua_solu_home").css("background-position","0px -144px");
		
	}).mouseout(function(){
		$("#cua_solu_home").css("background-position","0px 0px");
		});	
	
	$("#cua_une_home").mouseover(function(){
		$("#cua_une_home").css("background-position","0px -144px");
		
	}).mouseout(function(){
		$("#cua_une_home").css("background-position","0px 0px");
		});	
	
	
	$("#testi_titu").mouseover(function(){
		$("#cua_test_home").css("background-position","0px -144px");
		$("#testi_titu span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		$("#cua_test_home").css("background-position","0px 0px");
		$("#testi_titu span").css("background-position","0px 0px")
	});
	$("#testi_titu").mouseover(function(){
		$("#testimonials_home").css("background-position","0px -144px");
		$("#testi_titu span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		$("#testimonials_home").css("background-position","0px 0px");
		$("#testi_titu span").css("background-position","0px 0px")
	});
	
	$("#depoimentos_title").mouseover(function(){
		$("#depoimentos_content").css("background-position","0px -144px");
		$("#depoimentos_title span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		$("#depoimentos_content").css("background-position","0px 0px");
		$("#depoimentos_title span").css("background-position","0px 0px")
	});
		
	$("#solu_titu").mouseover(function(){
		$("#cua_solu_home").css("background-position","0px -144px");
		$("#solu_titu span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		$("#cua_solu_home").css("background-position","0px 0px");
		$("#solu_titu span").css("background-position","0px 0px")
		});	
		
	
	$("#clien_titu").mouseover(function(){
		
		$("#clien_titu span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		
		$("#clien_titu span").css("background-position","0px 0px")
		});		
		
	
	$("#une_titu").mouseover(function(){
		$("#cua_une_home").css("background-position","0px -144px");
		$("#une_titu span").css("background-position","0px -35px")
		
	}).mouseout(function(){
		$("#cua_une_home").css("background-position","0px 0px");
		$("#une_titu span").css("background-position","0px 0px")
		});		
		
		
		
	
	$("#cua_test_home").mouseover(function(){
		$("#testi_titu span").css("background-position","0px -35px")
		$("#testi_titu div").addClass("div_flecha_sub_h");
		
	}).mouseout(function(){
		$("#testi_titu span").css("background-position","0px 0px");
		$("#testi_titu div").removeClass("div_flecha_sub_h");
	});
	$("#testimonials_home").mouseover(function(){
		$("#testi_titu span").css("background-position","0px -35px")
		$("#testi_titu div").addClass("div_flecha_sub_h");
		
	}).mouseout(function(){
		$("#testi_titu span").css("background-position","0px 0px");
		$("#testi_titu div").removeClass("div_flecha_sub_h");
	});

	$("#depoimentos_content").mouseover(function(){
		$("#depoimentos_title span").css("background-position","0px -35px")
		$("#depoimentos_title div").addClass("div_flecha_sub_h");
		
	}).mouseout(function(){
		$("#depoimentos_title span").css("background-position","0px 0px");
		$("#depoimentos_title div").removeClass("div_flecha_sub_h");
	});
	
	$("#cua_solu_home").mouseover(function(){
		$("#solu_titu span").css("background-position","0px -35px")
		$("#solu_titu div").addClass("div_flecha_sub_h");
	}).mouseout(function(){
		$("#solu_titu span").css("background-position","0px 0px");
		$("#solu_titu div").removeClass("div_flecha_sub_h");
		});	
	
	$("#cua_une_home").mouseover(function(){
		$("#une_titu span").css("background-position","0px -35px")
		$("#une_titu div").addClass("div_flecha_sub_h");
		
	}).mouseout(function(){
		$("#une_titu span").css("background-position","0px 0px");
		$("#une_titu div").removeClass("div_flecha_sub_h");
	});
	
	
	
	$(".linkeo_nue_dif").click(function(){
		document.location.href='nuestros_diferenciadores.php';
		})	
	
	$(".porlinkeo_nue_dif").click(function(){
		document.location.href='nossos_diferenciadores.php';
		})	
	
	$(".izlinkeo_nue_dif").click(function(){
		document.location.href='differentiators.php';
		})	
	
	
	
	$(".izhist_exito").click(function(){
		document.location.href='success_stories.php';
		})	
		
	
			
	$('.link_careers1').click(function(){
		document.location.href='join_us.php';
		})	
		
	$('.iznues_soluc').click(function(){
		document.location.href='solutions.php';
		})	
		
	
	
	$(".ephist_exito").click(function(){
		document.location.href='historias_exito.php';
		})		
		
	$(".pohist_exito").click(function(){
		document.location.href='historias_sucesso.php';
		})	
	
	
	$('.epnues_soluc').click(function(){
		document.location.href='soluciones.php';
		})	
		
	$('.epnot').click(function(){
		document.location.href='noticias.php';
		})
		
	$('.ponues_soluc').click(function(){
		document.location.href='solucoes.php';
		})			
	
	$('.link_une_nosot').click(function(){
		document.location.href='unete_nosotros.php';
		})	

	$('.link_junte-se-a-nos').click(function(){
		document.location.href='junte-se-a-nos.php';
		})	


	//document.location.href='exito.php';
	
	
	
	
	
	
	
	//link de las relaciones de las soluciones
	
	
	$(".epup_solo").click(function(){
		document.location.href='soluciones_upgrade.php';
	});
	
	$(".epams_solo").click(function(){
		document.location.href='soluciones_ams.php';
	});
	
	$(".epalm_solo").click(function(){
		document.location.href='soluciones_alm.php';
	});
	
	$(".epbi_solo").click(function(){
		document.location.href='soluciones_bi.php';
	});
	
	$(".epro_solo").click(function(){
		document.location.href='soluciones_rollout.php';
	});
	
	$(".eperp_solo").click(function(){
		document.location.href='soluciones_erp.php';
	});
	
	
	
	$(".poup_solo").click(function(){
		document.location.href='solucoes_upgrade.php';
	});
	
	$(".poams_solo").click(function(){
		document.location.href='solucoes_ams.php';
	});
	
	$(".poalm_solo").click(function(){
		document.location.href='solucoes_alm.php';
	});
	
	$(".pobi_solo").click(function(){
		document.location.href='solucoes_bi.php';
	});
	
	$(".poro_solo").click(function(){
		document.location.href='solucoes_rollout.php';
	});
	
	$(".poerp_solo").click(function(){
		document.location.href='solucoes_erp.php';
	});
	
	
	
	$(".izup_solo").click(function(){
		document.location.href='upgrade_solutions.php';
	});
	
	$(".izams_solo").click(function(){
		document.location.href='ams_solutions.php';
	});
	
	$(".izalm_solo").click(function(){
		document.location.href='alm_solutions.php';
	});
	
	$(".izbi_solo").click(function(){
		document.location.href='bi_solutions.php';
	});
	
	$(".izro_solo").click(function(){
		document.location.href='rollout_solutions.php';
	});
	
	$(".izerp_solo").click(function(){
		document.location.href='erp_solutions.php';
	});
	
	
	
	
	
	$('.demo_ciclo1').cycle({
		fx: 'fade' 
	});
	
	 $('.demo_ciclo2').cycle({
		fx: 'zoom' 
	});
	
});



