// Nav Menu


function mainnavmenu() {
	
  var links = new Array();
    links[0] ="HOME";
    links[1] ="PRODUCTS";
    links[2] ="DOWNLOADS";
	links[3] ="CONTACT";
	links[4] ="QUESTIONS";
	links[5] ="SERVICES";
	
  var linkURL = new Array();
    linkURL[0] ="index.html";
    linkURL[1] ="prd_splash.html";
    linkURL[2] ="downloads.html";
	linkURL[3] ="contact.html";
	linkURL[4] ="faq.html";
	linkURL[5] ="services.html";
	
  for (i=0; i<links.length; i++){
    document.write("<li>"+links[i].link(linkURL[i])+"</li>");
  }
}


// Main Nav Function

$(document).ready(function() {

	$("#topnav li").prepend("<span></span>");

	$("#topnav li").each(function() {
		var linkText = $(this).find("a").html();
		$(this).find("span").show().html(linkText);
	}); 

	$("#topnav li").hover(function() {
		$(this).find("span").stop().animate({
			marginTop: "-60"
		}, 250);
	} , function() {
		$(this).find("span").stop().animate({
			marginTop: "0"
		}, 250);
	});

});


$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});

// Main Navigation Control

$(document).ready(function() {

	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag

	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-40" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 250);
	});

});


