
document.write("<script src=\"../scripts/jquery.prettyPhoto.js\"><\/script>");
document.write("<script src=\"../scripts/jquery.cookie.js\"><\/script>");
document.write("<script src=\"../scripts/jquery.treeview.pack.js\"><\/script>");

/*This is only for jquery Iviewer */
document.write("<script src=\"../scripts/jquery.mousewheel.min.js\"><\/script>");
document.write("<script src=\"../scripts/jquery.iviewer.js\"><\/script>");


$(document).ready(function(){

                  var iviewer = {};
                  $("#viewer2").iviewer(
                  {				  	
                      src: "../images/mapcolorcifor.jpg",	
					  zoom: 71					  

                  });

});


/*

$(document).ready(function(){
						   
	//AUTHORING PANEL
	bodyWidth = $('body').width();
	panelWidth = 188;
	centerPos = (bodyWidth - panelWidth) / 2 + 356;
	$('#authoringMenu').css('left',centerPos+'px');
	
	//CAPTION POSITION
	
	//get image size
	var imgWidth = $("#frontPhotoHeadline").width();
	var imgHeight = $("#frontPhotoHeadline").height();
	captionPos = imgHeight - 17;
	//overriding 'height' values on #photoHeadline
	$('#photoHeadline').css('height',captionPos+'px');


});

*/
//$(document).ready(function(){
//			$("a[rel^='prettyPhoto']").prettyPhoto();
//});




// EDIT CONSOLE has been set to be hidden by default

// EDIT CONSOLE POSITION
function doAuthoringPanelReposition() {
    //alert("I'm done resizing for the moment");
	$(document).ready(function(){
			bodyWidth = $('body').width();
			panelWidth = 188;
			centerPos = (bodyWidth - panelWidth) / 2 + 356;
			$('#authoringMenu').css('left',centerPos+'px');
	
	});
};

//after the document has ready
$(document).ready(function(){
	
	/////////////// AUTHORING PANEL ////////////////
	
	//Requirement: EDIT CONSOLE will only display after login
	//After login, system always create a table tag
	//This will become our identification
	$('.item').each(function(){
							 
		if($('table', this).length > 0){
			//AFTER LOGIN 
			//EDIT CONSOLE

			//Set the right position and 
			doAuthoringPanelReposition ();
			
			//Set its visibility
			$('#authoringMenu').css('visibility','visible');	
			
			//Also reset the position on window resize
			var resizeTimer = null;
			$(window).bind('resize', function() {
				if (resizeTimer) clearTimeout(resizeTimer);
				resizeTimer = setTimeout(doAuthoringPanelReposition, 100);
			});			
			
			
		}else {
			//NO LOGIN MODE
			//no action
			
		}
	});	
	/////////////// END OF AUTHORING PANEL ////////////////
						   
	
	/////////////// CAPTION ////////////////
		$("#hoverBox").hide();
		$(".captionButton").hover(function () {
			$('#hoverBox').css('visibility','visible');	
			var text = $(this).children(".captionDesc").html();
			$("#hoverBox").html(text);
			$("#hoverBox").fadeIn(200);/* VALUE to fade in quicker and slower */     
		}, function () {
			$("#hoverBox").hide();
			});
		
	/////////////// END OF CAPTION ////////////////
});



	//OLD CAPTION POSITION
	
	//get image size
	//		var imgWidth = $("#frontPhotoHeadline").width();
	//		var imgHeight = $("#frontPhotoHeadline").height();
	//		captionPos = imgHeight - 17;
			//overriding 'height' values on #photoHeadline
	//		$('#photoHeadline').css('height',captionPos+'px');	
	//});	
	

//highlighting staffdir
$(document).ready(function()
{
  //for div
  //$("div:odd").css("background-color", "#F4F4F8");
  //$("div:even").css("background-color", "#EFF1F1");

  //for table row
  //$("tr:even").css("background-color", "#F4F4F8");
  //$("tr:odd").css("background-color", "#EFF1F1");
  
  //$(".staffDir tr:even").addClass("staffDirRow1");
});	 


$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square'});
		
});


//treeview on Montpellier event
		$(function() {
			$("#tree").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree2").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree3").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree4").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree5").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree6").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree7").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree8").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree9").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree9a").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree10").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree11").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree12").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#treeposter").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree13").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree14").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
			$("#tree15").treeview({ collapsed: true, animated: "medium", control:"#sidetreecontrol", persist: "location"});
		})	









