﻿/*

javascript functions for eaj

*/


function disableSelect(enable_action)
{
	if(enable_action == "disable")
	{
		document.getElementById('pageParentID').disabled = true;
	} 
	
	if(enable_action == "enable")
	{
		document.getElementById('pageParentID').disabled = false;			
	}
}

function delconf(){
	
	var delcheck = confirm("Are you sure that you would like to delete this item?");
	if(delcheck){
		return true;
	} else {
		return false;	
	}
}

function preview_pic(fileid)
{
	window.open('image_preview.php?fileid=' + fileid,'mywindow','width=400,height=400');
}


    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);	
    
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3 = (is_ie && (is_major < 4));
    var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );        
	
    var is_mac = (agt.indexOf("mac")!=-1); 
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    
    if(is_mac && is_ie5up)
    {
    	 document.location.href = "ie4mac.html";
    }
