function insert_flash(nombre, ancho, altura)
{ 
	movie_name = nombre;  // nombre sin mencionar el .swf
	movie_width = ancho;
	movie_height = altura;	
	
	AC_FL_RunContent(
	   'codebase', 
	'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
	   'width', movie_width,
	   'height', movie_height,
	   'src', movie_name,
	   'quality', 'high',
	   'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
	   'align', 'middle',
	   'play', 'true',
	   'loop', 'true',
	   'scale', 'noScale',
	   'wmode', 'transparent',
	   'devicefont', 'false',
	   'id', 'index',
	   'bgcolor', '#ffffff',
	   'name', movie_name,
	   'menu', 'true',
	   'allowScriptAccess','always',
	   'movie', movie_name,
	   'salign', ''
	   ); //end AC code
}


$(document).ready(function(){
						   
	var animateMenus = false;					   

	$("ul.topnav li a").not("ul.topnav li ul li a").mouseover(function() {		

			if(animateMenus)
			$(this).parent().find("ul").slideDown("slow");
			else
			$(this).parent().find("ul").show();
	
			$(this).parent().hover(function() {
			}, function(){
				if(animateMenus)
				$(this).parent().find("ul").slideUp("fast");
				else
				$(this).parent().find("ul").hide();
			});	
			
		
		}).hover(function() {
			//
		}, function(){	//On Hover Out
			//
	});
});

$(document).ready(function(){

	
	$("#intro_text_box").click(function(){
			
		goToLink(this);
		
	});
	
	//Go to the URL set on tho objects' "link" attribute
	function goToLink(it) 
	{
		var url =	$(it).attr("link");
			
		if(url != "" && url != undefined)	
		{
			window.location = url;
		}		
	}	
	
	$(".main_boxes").click(function(){
			
		goToLink(this);
		
	});
	
});

$(document).ready(function(){		
		
	//Cambio de tabs secciones
	$("#tabs .tabs_links a").click(function(){
									   
		var divs = $(".tab_contents:visible").attr("id").split("tab_content_");						   
							
		var currentDiv = divs[1];					
									   
		var itemId = $(this).attr("rel");

		if(currentDiv != itemId)
		{
			$("#tabs .tabs_links a").removeClass("active");
			$(this).addClass("active");
			
			$(".tab_contents, .show_first").removeClass("show_first");
							
			$(".tab_contents.active").hide().removeClass("active");
			$("#tab_content_" + itemId).addClass("active").show();
		}
	
	});	
	
	//Cambio de contenidos interiores
	$("#horiz_submenu a").click(function(){
			
		if($(this).attr("rel") != "")	
		{ 
			var divs = $(".contents:visible").attr("id").split("content_");						   
								
			var currentDiv = divs[1];					
										   
			var itemId = $(this).attr("rel");
	
			if(currentDiv != itemId)
			{
				$("#horiz_submenu a").removeClass("active");
				$(this).addClass("active");
				
				$(".contents, .show_first").removeClass("show_first");
								
				$(".contents.active").hide().removeClass("active");
				$("#content_" + itemId).addClass("active").show();
			}
		}
	
	});	
		
});



function getUrlVars() {
	var vars = {};
	var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		vars[key] = value;
	});
	return vars;
}
function getRequestedItem() {
	var it = getUrlVars()["it"];
	return(it);	
}

$(document).ready(function(){
				
	//muestra el elemento recibido por GET por la variable "it"			
	var showItem = getRequestedItem();	
	
	if(showItem != undefined)
	{		
		$("#horiz_submenu a").removeClass("active");
		$("#horiz_submenu a:[rel='"+showItem+"']").addClass("active");
	
		$(".contents, .show_first").removeClass("show_first");
		
		$(".contents.active").hide().removeClass("active");
		$("#content_" + showItem).addClass("active").show();		
	}					   
});


//PRINT FUNCTIONS
$(document).ready(function() {
	 $(".printButton").click(function() {
		 printElem({
				   pageTitle: 'www.resonatenetworks.com',
				   printMode: 'popup',
				   leaveOpen:true,
				   overrideElementCSS:[
									   'css/style.css',
									   { href:'css/print.css',media:'screen'}]				   
				   });		
	 });
 });

function printElem(options){
 $('.contents').printElement(options);
}




