// 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 tabs() {
	
	var $tabs = $("#tabs").tabs();
	
}

function carousel() {
	
	jQuery('.speakersUL').jcarousel();

}

function backButton() {

	if(!document.getElementsByTagName('a')) return false;
	
	var links = document.getElementsByTagName('a'); //Get the links on the page
	
	for(var i=0; i<links.length; i++) { //Loop through the links
	
		if(links[i].className.indexOf('back') > -1) { //See if the link has a class name of back
			
			links[i].onclick = function () { //The link is clicked
			
				history.go(-1); //Send the user back one page
				
				return false;
			
			}
			
		}
	
	}

}

//Changes the HREF of the element tp point at an anchor
function updateUrl() {
	
	if($('#speakersCatNav').length == 0) return false;
	
	$('#speakersCatNav a').each(function() {
	
		var oldHref = $(this).attr('href');
		if(oldHref.indexOf('#') == -1) {
		
			$(this).attr('href', '#' + oldHref);
		
		}
	
	});

}

$(document).ready(function() {
						   
	if(navigator.userAgent.indexOf('MSIE 6') < 0) {
		
		//updateUrl();
		//tabs();	
		
	} else {
	
		//$('.tn_1').supersleight();
	
	}
	
	carousel();


});
