	function validatedel(WhichForm) {
		var answer = confirm ("Are you sure you want to delete?");
		if (answer) {
			document[WhichForm].submit();
		} else {
			return false;
		}
	}
	function validateundel(WhichForm) {
		var answer = confirm ("Are you sure you want to undelete?");
		if (answer) {
			document[WhichForm].submit();
		} else {
			return false;
		}
	}

	function move_me(s){ 
		if(s == "*new*"){
			document.getElementById('photocat_det').style.display='';
		}else{
			document.getElementById('photocat_det').style.display='none';
		}
	}
	function signIn(){
		alert ("for this photo, the photoblogger would like you to sign into your shutterchance account to leave a comment");
	}
	
	//Fade in function
	function initImage() {
		imageId = 'main_image';
		image = document.getElementById(imageId);
		setOpacity(image, 0);
		image.style.visibility = "visible";
		fadeIn(imageId,0);
	}
	function fadeIn(objId,opacity) {
		if (document.getElementById) {
			obj = document.getElementById(objId);
			if (opacity <= 100) {
				setOpacity(obj, opacity);
				opacity += 4;
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			}
		}
	}
	function setOpacity(obj, opacity) {
		opacity = (opacity == 100)?99.999:opacity;
		obj.style.filter = "alpha(opacity:"+opacity+")";
		obj.style.KHTMLOpacity = opacity/100;
		obj.style.MozOpacity = opacity/100;
		obj.style.opacity = opacity/100;
	}
	
 	// Function to make easier showing/hiding divs
	function displayID(idName,show) {
		var the_style = getStyleObject(idName);
		if (show=='y' && the_style != false) {
			the_style.display = '';
		} else if(show=='n' && the_style != false) {
			the_style.display = 'none';
		}	
	}
	
function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}	

// EXIF text for camera mode
function cameraMode(theMode) {
	var modeName;
	if (theMode==1) {
		modeName = "full manual";
	} else if (theMode==2) {
		modeName = "shutter priority";
	} else if (theMode==3) {
		modeName = "aperture priority";
	} else if (theMode==4) {
		modeName = "program mode";
	} else if (theMode==5) {
		modeName = "A-DEP program";
	} else {
		modeName = "unknown";
	}
	document.write(modeName);
}

// EXIF text for shutterspeed
function shutter(theSpeed) {
	var shutterSpeed;
	if (theSpeed=="") {
		shutterSpeed = "unknown";
	} else {
		var splitSpeed = theSpeed.split("/");
		if (splitSpeed[1] && splitSpeed[0]>splitSpeed[1]) {
			theSpeed = splitSpeed[0]/splitSpeed[1];
			theSpeed = Math.round(theSpeed);
			shutterSpeed = theSpeed + " seconds";
		} else if (splitSpeed[0]==splitSpeed[1]) {
			shutterSpeed = "1 second";
		} else {
			shutterSpeed = theSpeed + "s";
		}
	}
	document.write(shutterSpeed);
}
