// JavaScript Document

// EDIT THESE VALUES IF REQUIRED
var alertText = 'Are you sure you wish to perform this action' + "\n"; //DEFAULT TEXT DISPLAYED ON CONFIRM BUTTONS/LINKS WHEN NO ALT/TITLE
var newWindowLink = false; //OPEN EXTERNAL LINKS BY DEFAULT IN A NEW WINDOW (TRUE/FALSE)?


var woms = new Array(); //CREATE ARRAY OF FUNCTIONS TO LAUNCH ONLOAD

//ONLOAD MANAGER
function womOn(){
  window.onload = womGo;
}

function womGo(){
  for(var i = 0;i < woms.length;i++)
    eval(woms[i]);
}

function womAdd(func){
  woms[woms.length] = func;
}

function CreateBookmarkLink() {

	title = document.title;
	url = window.location.href;
	
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,"");
	} else if(window.external) {
		window.external.AddFavorite( url, title); 
	} else if(window.opera && window.print) {
		return true;
	}
	
}

function objToggle(obj) { 

	var obj = document.getElementById(obj);

	if(obj.style.display == "block") { 
		obj.style.display = "none";
	} else { 
		obj.style.display = "block";
	}

}

function tabbedTabs()
{

	$(".tabbedinfo .tabbedinfoinner, .projectinfo .projectinfoinner").each(
		function (i)
		{
			if(i !== 0) $(this).hide();
		});
	//$(".tabbedinfo ul li .chebs:first, .projectinfo ul li .chebs:first").addClass("selected");

	$(".tabbedinfo ul li .chebs, .projectinfo ul li .chebs").click(
		function ()
		{
			var currentTab = $(".tabbedinfo ul li a.selected, .projectinfo ul li a.selected");
			var currentTabIndex = $(".tabbedinfo ul li a, .projectinfo ul li .chebs").index(currentTab);

			var indexPos = $(".tabbedinfo ul li a, .projectinfo ul li .chebs").index(this);
			
			if(currentTabIndex !== indexPos) {
				$(".tabbedinfo .tabbedinfoinner, .projectinfo .projectinfoinner").hide();
				$(".tabbedinfo .tabbedinfoinner:eq(" + indexPos + "), .projectinfo .projectinfoinner:eq(" + indexPos + ")").fadeIn(900);
				$(".tabbedinfo ul li .chebs, .projectinfo ul li .chebs").removeClass("selected");
				$(this).addClass("selected");
			}
			
			$(this).blur();
			
			return false;
		});
	
}



$(document).ready(
	function () 
	{
		tabbedTabs();
	});