﻿/***************************/
//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

$(document).ready(function(){
	$(".menu > li").click(function(e){
		switch(e.target.id){
			case "info1":
				//change status & style menu
				$("#info1").addClass("active");
				$("#info2").removeClass("active");
				$("#info3").removeClass("active");
				$("#info4").removeClass("active");
				//display active division, hide others
				$("div.info1").fadeIn();
				$("div.info2").css("display", "none");
				$("div.info3").css("display", "none");
				$("div.info4").css("display", "none");
			break;
			case "info2":
				//change status & style menu
				$("#info1").removeClass("active");
				$("#info2").addClass("active");
				$("#info3").removeClass("active");
				$("#info4").removeClass("active");
				//display active division, hide others
				$("div.info2").fadeIn();
				$("div.info1").css("display", "none");
				$("div.info3").css("display", "none");
				$("div.info4").css("display", "none");
			break;
			case "info3":
				//change status & style menu
				$("#info1").removeClass("active");
				$("#info2").removeClass("active");
				$("#info3").addClass("active");
				$("#info4").removeClass("active");
				//display active division, hide others
				$("div.info3").fadeIn();
				$("div.info1").css("display", "none");
				$("div.info2").css("display", "none");
				$("div.info4").css("display", "none");
			break;
			case "info4":
				//change status & style menu
				$("#info1").removeClass("active");
				$("#info2").removeClass("active");
				$("#info3").removeClass("active");
				$("#info4").addClass("active");
				//display active division, hide others
				$("div.info4").fadeIn();
				$("div.info1").css("display", "none");
				$("div.info2").css("display", "none");
				$("div.info3").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});

function externalLinks() {   
 if (!document.getElementsByTagName) return;   
 var anchors = document.getElementsByTagName("a");   
 for (var i=0; i<anchors.length; i++) {   
   var anchor = anchors[i];   
   if (anchor.getAttribute("href") &&   
       anchor.getAttribute("rel") == "external")   
     anchor.target = "_blank";   
 }   
}   
window.onload = externalLinks;
