function loadContent(elementSelector, sourceURL) {
	$(""+elementSelector+"").load(""+sourceURL+"");
}

function setBG(whichBG){
	$("body").css("background" , "#0D0D0D url(images/"+whichBG+") 0 0 repeat");
}

function showPic (whichpic) {
	$("#projectImage").attr("src", ($(whichpic).attr("href")));
	$("div.image_links a").removeClass()
	$(whichpic).addClass("image_link_selected")
	return false;
}

function showMap (whichpic) {
	$("#projectImage").attr("src", ($(whichpic).attr("href")));
	$("div.image_links a").removeClass();
	$(whichpic).addClass("image_link_selected");
	$("#desc").html($(whichpic).attr("title"));
	return false;
}

function advancePic (whichpic) { 
	
	$("div.image_links a").each(function(i){
	
	 if ($(this).attr("href") == ($("#projectImage").attr("src"))){
	 	
		if(i == $("div.image_links a").length-1){
			i=0;
		}else{
			i=i+1;
		}
		
		$("#projectImage").attr("src", $("div.image_links a").eq(i).attr("href"));
		$("div.image_links a").removeClass()
		$("div.image_links a").eq(i).addClass("image_link_selected")
		
		return false;
	 }
	 
	});
	
	return false
}

function preloadImages(){
	// Preload images
	$("div.image_links a").each(function(i){
		jQuery("<img>").attr("src", $(this).attr("href"));
	});
}

var flashMovie;
var query_string;
		
function init() {
	if (document.getElementById) {
		flashMovie = document.getElementById("divercity_nav_id");
	}
	//flashMovie.sendVarFromHtml("bum chups");
}

function flashLoaded(){
	//
	if(query_string[1].length<3){
		flashMovie.sendVarFromHtml(query_string[1]);
	}else{
		flashMovie.sendVarFromHtml("stop");
	}
}

$(window).load(function () {
	//loadContent("#content_column", "project_00_example.html");
	if(document.location.hash){
		query_string = document.location.hash
		query_string = query_string.split('#');
		//
		
		if(query_string[1].length>3){
			loadContent("#content_column", query_string[1]);
		}
	};
	//
	init();
});


