// Pops Window
function popupWindow(URL,width,height) {
  day = new Date();
  id = day.getTime();
  var left = (screen.width-width)/2;
  var top = (screen.height-height)/2;
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=yes,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "');");
}

// Pops Window
function popupStaticWindow(name,URL,width,height) {
  var left = (screen.width-width)/2;
  var top = (screen.height-height)/2;
  eval(name + " = window.open(URL, '" + name + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=yes,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "');");
}

// restore tell friend text
function setInputText(field,text) {
	if (field.value == "") {
		field.value = text;
	}
}

// hide tell friend text
function clearInputText(field,text) {
	if (field.value == text) {
		field.value = "";
	}
}

// navigates using menu
function menu_nav(url) {
  if(url!=""){window.location.href=url;}
}

// navigates using menu
function delete_warning(type,url) {
	if(type=="forum"){
		resp = confirm("Are you sure you want to permanently delete this forum? All topics and posts will be lost.");
	}
	if(type=="delete_backup"){
		resp = confirm("Are you sure you want to delete this database backup? You will no longer be able to restore the data in this backup.");
	}
	if(type=="restore_backup"){
		resp = confirm("Are you sure you want to restore this database backup? All current will be replaced.");
	}
	if (resp == true){
		window.location.href=url;
	}
}
