$(document).ready(function() {	
	$(".login_box").click(
		function() { 
			$("#update_box").slideUp(300, function() {
				$("#login_box").slideToggle(300);
			});
			return false;
		}
	);
	
	$(".update_box").click(
		function() { 
			$("#login_box").slideUp(300, function() {
				$("#update_box").slideToggle(300);
			});
			return false;
		}
	);
	
	$(".popup_link").click(
		function() { 
			//Popup=window.open($(this).attr("href"),'Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no, width=420,height=400,left=430,top=23');
			tb_show($(this).attr("href"));
			return false;
		}
	);
	
});


/// What below this is used?
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navigation_list");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

function show_login(){
	$("#login_box").slideDown();
	return false;
}	

function hide_login(){
	$("#login_box").slideUp();
	return false;
}

function toggleLoginBox(which){
	if(document.getElementById(which).style.display=="none"){
		$('#' + which).slideDown("slow");
		//$(which).blindDown({duration:0.3});
	}else{
		$('#' + which).slideUp("slow");
		//$(which).blindUp({duration:0.3});
	}
	 return false;
}

var main_nav_path = "/images/nav/"
if (document.images) {
	btn_home_over = new Image(90,43); btn_home_over.src = main_nav_path + "btn_home_over.gif";
	btn_awards_over = new Image(90,43); btn_awards_over.src = main_nav_path + "btn_awards_over.gif";
	btn_delegates_over = new Image(90,43); btn_delegates_over.src = main_nav_path + "btn_delegates_over.gif";
	btn_festival_over = new Image(90,43); btn_festival_over.src = main_nav_path + "btn_festival_over.gif";
	btn_ylz_over = new Image(90,43); btn_ylz_over.src = main_nav_path + "btn_ylz_over.gif";
	btn_lions_over = new Image(90,43); btn_lions_over.src = main_nav_path + "btn_lions_over.gif";
}
function navrollover(imgname) 
{
if (document.images) {document[imgname].src = eval( imgname + "_over.src" ); }
}
function navrolloff(imgname) 
{
if (document.images) {document[imgname].src = main_nav_path + imgname + ".gif" ; }
}

//	LINKED CONTENT
function showcontent(linkedcontent){
	$("div#linked_content_" + currentcontent).hide();
	$("div#linked_content_" + linkedcontent).show();
	
	$("div#linked_bottom_item_" + currentcontent).hide();
	$("div#linked_bottom_item_" + linkedcontent).show();
	
	//$("a#linked_top_link_" + currentcontent).toggleClass("linked_top_link_on");
	//$("a#linked_top_link_" + linkedcontent).toggleClass("linked_top_link_on");
	
	$(".linked_sections a").removeClass("link_on");
	$("#link_" + linkedcontent).addClass("link_on");
	
	currentcontent = linkedcontent;
	return false;
}

// Linked Content Display
function showsection(linkedsection,linkedcontent){
	$("div#linked_bottom_item_" + currentsection).hide();
	$("div#linked_bottom_item_" + linkedsection).show();
	
	$("div#linked_sections_" + currentsection).hide();
	$("div#linked_sections_" + linkedsection).show();
	
	$("div#linked_content_" + currentcontent).hide();
	$("div#linked_content_" + linkedcontent).show();
	
	$("a#linked_top_link_" + currentsection).toggleClass("linked_top_link_on");
	$("a#linked_top_link_" + linkedsection).toggleClass("linked_top_link_on");
	
	$(".linked_sections a").removeClass("link_on");
	$("#link_" + linkedcontent).addClass("link_on");
	
	currentcontent = linkedcontent;
	currentsection = linkedsection;
	return false;
}

// Hotel Favourites
function fHotelFav(vAction,hotelId) {
	$("#fav" + hotelId).load("/delegates/accommodation_ajax.cfm",{action:vAction, hotel_id: hotelId});
	return false;
}