/* Function: This Does a Javascript confirm for ADMIN*/
function delete_confirmation(form_prefix, form_name_id, item_name) {
    var answer = confirm('Are you sure you want to delete this ' + item_name + '?')
    if (answer){
       if( deleted_form = document.getElementById(form_prefix + form_name_id) ) {
       		deleted_form.submit();
       }
    }
}

function confirmation(url, message){
	var answer = confirm(message)
	if (answer){
		window.location = url;
	}
}



/**
* Load large image to the gallery
*/
function loadImage(number, that) 
{
	if(image['current']!=number)
	{
		// used to show the selected thumbnail
		$(".thumbSelected").children().css("border","");
		$(".thumbSelected").removeClass('thumbSelected');
		$(that).addClass('thumbSelected');
		$(that).children().css("border","3px solid #FFFFFF");
		
		// load the actual image (fadeout first)
		$("#largeImage").fadeTo("normal",0, changeImage);
		image['current']=number;
	}
}

function changeImage() {
	this.src=image[ image['current'] ].src;
	$("#largeImage").fadeTo("normal",1);
}

/**
* Switch images on rollover
* obj (this)
* imagerollover path to image to use for rollover
*/
function switchImages(obj, imagerollover) {
	if(obj.originale==undefined) {
		obj.originale  = obj.src;
		obj.onmouseout = function() { this.src=this.originale; }
	}
	obj.src=imagerollover;
}
