// -----------------------------------------------------------------------------
// Ebscripts - Javascript file
// -----------------------------------------------------------------------------
// Create a Cookie
// -----------------------------------------------------------------------------
function bakeCookie(n,v) {
    document.cookie=n+"="+v+";";
    link = window.location.href;
    newlink = link.split("#")[0];
    window.location.href=newlink;
}
// -----------------------------------------------------------------------------
// Delete a page from the content database
// -----------------------------------------------------------------------------
function delete_page(id) {
    msg="Are you sure you want to delete this page?";
    if (window.confirm(msg)==true) {
            idstring = "content/control/delete_content.php?m=page&id="+id;
            window.location.href=idstring;
    }
}
// -----------------------------------------------------------------------------
// Delete a subcategory from the content database
// -----------------------------------------------------------------------------
function delete_subcategory(id) {
    msg ="Are you sure you want to delete this subcategory?\n";
    msg+="All pages and sub-subcategories in this subcategory will be deleted!\n";
    msg+="Hit OK to continue";
    if (window.confirm(msg)==true) {
            idstring = "content/control/delete_content.php?m=subcategory&id="+id;
            window.location.href=idstring;
    }
}
// -----------------------------------------------------------------------------
// Delete a sub-subcategory from the content database
// -----------------------------------------------------------------------------
function delete_subsubcategory(id) {
    msg ="Are you sure you want to delete this subsubcategory?\n";
    msg+="All pages in this subsubcategory will be deleted also!\n";
    msg+="Hit OK to continue";
    if (window.confirm(msg)==true) {
            idstring = "content/control/delete_content.php?m=subsubcategory&id="+id;
            window.location.href=idstring;
    }
}
// -----------------------------------------------------------------------------
// Delete a draft page
// -----------------------------------------------------------------------------
function delete_draft_page(id,cp) {
    msg="Are you sure you want to delete this draft?";
    if (window.confirm(msg)==true) {
            idstring = "content/control/delete_draft.php?id="+id+"&cp="+cp;
            window.location.href=idstring;
    }
}
// -----------------------------------------------------------------------------
// Delete a member from the members database
// -----------------------------------------------------------------------------
function delete_member(id) {
    msg = "Are you sure you want to delete this member?";
    if (window.confirm(msg)) {
            idstring = "control/members/member_control.php?m=delete&id="+id;
            window.location.href=idstring;
    }
}
// -----------------------------------------------------------------------------
// This function will return a XMLHttp connection
// -----------------------------------------------------------------------------
function get_xmlHttp() {
  var xmlHttp;
  try { // Firefox, Opera 8.0+, Safari   
		xmlHttp=new XMLHttpRequest(); }
  catch (e) { // Internet Explorer    
	try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
    catch (e) {
		try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
    catch (e) { 
		alert("Your browser does not support AJAX!");
		return false;  
	}}}
	return xmlHttp;
}
