var map;

function dn() {
	//do nothing
}
function loadMap(){
	if (GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map"));
			map.setCenter(new GLatLng(parseFloat(44.653), parseFloat(-123.801248)), 12);
			map.addControl(new GMapTypeControl());
			map.enableDragging();				
	}
}
// this parses the tag_list field and
// checks the corresponding boxes
function loadTags() {
	var tags = $("#photo_tag_list").attr("value");
	if (tags.length != 0) {
	tags = tags.split(",");
		$(tags).each(function(i){
			var find = "#" + this.replace(/^\s+|\s+$/g,"").replace(" ", "_");
			$(find).attr("checked", true);
		});
	}
}

// iterates through checked boxes and 
// joins them with commas and
// places them in the tags textarea
function doTag() {
	var returnString = ""
	$("input[type=checkbox]:checked").each(function(i){
			returnString += this.value + ", ";
	});
	$("#photo_tag_list").attr("value", returnString.substr(0, returnString.length - 2));
	toggleTags();
}

$(document).ready(function(){
	$login = $(".log_in");
	$login.hide();
	$("#footer").hover(
		function(){
			$login.fadeIn();
		},
		function(){
			$login.fadeOut();
		}
	);
});