//Get User Feedback
function userfeedback(id) {
		if(isNaN(id)) {
			alert('Please select a valid page.');
			return;
		}
		new Ajax.Request('/modules/admin_feedback.php?id='+id, {
			asynchronous:true,
			evalScripts:true,
			onSuccess: function(transport) {
				Control.Modal.open(transport.responseText);
			},
			onFailure: function(transport) {
				alert(transport.responseText);
			}
		});
	}
	
	
//Auto Select Edit Page
function editPage(url) {
	parent.location='/admin.php?page=edit&id='+url
}

//Popup Function
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=335,height=430');");
}

//Check Confirm
function checkConfirm(string,form) {
	if(form.deleteconfirm.checked==true) {
		if(confirm(string)==true) {
			return true;
		}
		else {
			return false;
		}
	}
	else {
		return true;
	}
}

//View File Upload
function viewFileUpload(value) {
	if(value == 8) {
		controlLayer("fileUpload","show");
	}
	if(value != 8) {
		controlLayer("fileUpload","hide");
	}
}

//Control Layer
function controlLayer(whichLayer,toggle) {
	if(toggle == "hide") {
		var display = "none";
	}
	if(toggle == "show") {
		var display = "block";
	}
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
	}
	style2.display = display;
}
