<!--
	var mac = (navigator.userAgent.indexOf("Mac")>-1)?true:false;
	var ie = (navigator.userAgent.indexOf("MSIE")>-1)?true:false;	
	
	function openWinPrec(u,n,fs,sc,loc,tool,dir,menu,res,stat,w,h,top,left){
		window.open(u,n,'fullscreen='+fs+',scrollbars='+sc+',location='+loc+',toolbar='+tool+',directories='+dir+',menubar='+menu+',resizable='+res+',status='+stat+',width='+w+',height='+h+',top='+top+',left='+left);
	}

	function openWin(u,n){
		openWinPrec(u,n,'no','no','no','no','no','no','no','yes',512,534,0,0);
	}	

	function openSizedWin(u,n,h,w){
		openWinPrec(u,n,'no','no','no','no','no','yes','no','no',w,h,0,0);
	}	

	function openSizedScrollingWin(u,n,h,w){
		openWinPrec(u,n,'no','yes','no','no','no','yes','no','no',w,h,0,0);
	}	
    
	function highLightCell(n){
	     //var target = 'navLeftCell'+n;
		 document.getElementById('navLeftCell'+n).style.backgroundColor='#666666';
		 document.getElementById('navLeftLink'+n).style.color='#FFFFFF';
	}

    function revertCell(n){
     //var target = 'navLeftCell'+n;
		 document.getElementById('navLeftLink'+n).style.color='#000000';             
		 document.getElementById('navLeftCell'+n).style.backgroundColor='#FFFFFF';
	}

    function MM_jumpMenu(targ,selObj,restore){
    		alert('targ: '+targ+'selobj: '+selObj+'restore'+restore);
        eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
        if (restore) selObj.selectedIndex=0;
    }
	
    
	 

    //this method may be pointless, but as yet I have not found a JS method to get a cookie value

    function getCookieValue(cookieName){
	if(document.cookie.indexOf(cookieName) > -1){
		cookieVal = document.cookie;
		cookieVal = cookieVal.substring(cookieVal.indexOf(cookieName), (cookieVal.indexOf(';',cookieVal.indexOf(cookieName))) );
		cookieValParts = cookieVal.split("=");
		return cookieValParts[1];
	} else {
	  return false;
        }
    }

	function Hilite(name,over){
	    if(window.document.images){
	        if (over){
	            window.document.images[name].src = "/images/admin/" + name + "_on.gif";
	        }else{
	            window.document.images[name].src =  "/images/admin/" + name + "_off.gif";
	        }
	    }
    }
    
    
    function HiliteByRef(name,over,ref){
	    if(window.document.images){
	        
            if (over){
	            document.getElementById(ref).src = "/images/admin/" + name + "_on.gif";
	        }else{
	            document.getElementById(ref).src =  "/images/admin/" + name + "_off.gif";
	        }
	    }
    }
    
    function HilitePPByRef(name,over,ref){
	    if(window.document.images){
	        
            if (over){
	            document.getElementById(ref).src = "/images/pagepilot/" + name + "_on.gif";
	        }else{
	            document.getElementById(ref).src =  "/images/pagepilot/" + name + "_off.gif";
	        }
	    }
    }
    
    function addMiniText(text,fielditem){
        var currtext=document.forms['addForm'][fielditem].value;
        var newtest=currtext+""+text;
        document.forms['addForm'][fielditem].value=newtest;
    }
    
    function getArticle(node){
        mIndex = document.forms.articleForm.chooseArticle.selectedIndex;
        mAmount = document.forms.articleForm.chooseArticle.options[mIndex].value;
        window.location = "?node_id="+node+"&id="+mAmount;
    }
    
    

var miniEditObjects = Array();
var miniHTMLObjects = Array();
var hiddenEditObjects = Array();

function addToUpdater(objName){
    //alert("Adding " + objName + " to updater. Looking For: " + 'fields['+objName+']');
    hiddenElObj = document.all['fields['+objName+']'];
    divObj = document.all['div' + objName];
    taObj = document.all['ta' + objName];
    //alert("Div Object name is div" + objName);
    hiddenElObj.value = divObj.innerHTML;
    
    miniEditObjects.push(divObj);
    miniHTMLObjects.push(taObj);
    hiddenEditObjects.push(hiddenElObj);
}

function updateAll(){
    for(i in miniEditObjects){
        if(miniHTMLObjects[i].style.display == "block"){
            hiddenEditObjects[i].value = miniHTMLObjects[i].value;
            //alert("Setting " + hiddenEditObjects[i].name + " to " + miniHTMLObjects[i].value);
        }else     
            hiddenEditObjects[i].value = miniEditObjects[i].innerHTML;
        
    }
}

function swapRTfields($n){
    div = document.all['div' + $n];
    ta = document.all['ta' + $n];
    if(div.style.display == "none"){
       ta.style.display = "none";
       div.style.display = "block";
       div.innerHTML = ta.value; 
    }
    else{
       div.style.display = "none";
       ta.style.display = "block";
       ta.value = div.innerHTML;
    } 
}
    

function doExec(ex, obj){		
	if (ex == "Bold")
		document.execCommand("Bold");

	else if (ex == "Italic")
		document.execCommand("Italic");
        
    else if (ex == "Left")
		document.execCommand("JustifyLeft");

    else if (ex == "Center")
		document.execCommand("JustifyCenter");

    else if (ex == "Right")
		document.execCommand("JustifyRight");
        
    else if (ex == "Link")
		document.execCommand("CreateLink");
        
    else if (ex == "Underline")
		document.execCommand("Underline");
        
    else if (ex == "OrderedList")
		document.execCommand("InsertOrderedList");  
    
     else if (ex == "UnorderedList")
		document.execCommand("InsertUnorderedList");  
            
    else if (ex == "Indent")
		document.execCommand("Indent");  
  
    else if (ex == "Outdent")
		document.execCommand("Outdent");
        
    else if (ex == "RemoveFormating"){
        /** regex the tags **/
        div = document.all['div' + obj];
        var rE = new RegExp();
        rE.compile(/<([^>]*)>/);
        /**while(div.innerHTML.toString().match(rE) != null){
            div.innerHTML = div.innerHTML.toString().replace(rE, "");
        }**/
    }
    
        
}

	var mac = (navigator.userAgent.indexOf("Mac")>-1)?true:false;
	var ie = (navigator.userAgent.indexOf("MSIE")>-1)?true:false;	
	
	function openWinPrec(u,n,fs,sc,loc,tool,dir,menu,res,stat,w,h,top,left){
		window.open(u,n,'fullscreen='+fs+',scrollbars='+sc+',location='+loc+',toolbar='+tool+',directories='+dir+',menubar='+menu+',resizable='+res+',status='+stat+',width='+w+',height='+h+',top='+top+',left='+left);
	}

	function openWin(u,n){
		openWinPrec(u,n,'no','no','no','no','no','no','no','yes',512,534,0,0);
	}	

	function openSizedWin(u,n,h,w){
		openWinPrec(u,n,'no','no','no','no','no','yes','no','no',w,h,0,0);
	}	

	function openSizedScrollingWin(u,n,h,w){
		openWinPrec(u,n,'no','yes','no','no','no','yes','no','no',w,h,0,0);
	}	
    
	function highLightCell(n){
	     //var target = 'navLeftCell'+n;
		 document.getElementById('navLeftCell'+n).style.backgroundColor='#666666';
		 document.getElementById('navLeftLink'+n).style.color='#FFFFFF';
	}

    function revertCell(n){
         //var target = 'navLeftCell'+n;
		 document.getElementById('navLeftLink'+n).style.color='#000000';             
		 document.getElementById('navLeftCell'+n).style.backgroundColor='#FFFFFF';
	}

    function MM_jumpMenu(targ,selObj,restore){ //v3.0
        eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
        if (restore) selObj.selectedIndex=0;
    }
	
	 

    //this method may be pointless, but as yet I have not found a JS method to get a cookie value

    function getCookieValue(cookieName){
	if(document.cookie.indexOf(cookieName) > -1){
		cookieVal = document.cookie;
		cookieVal = cookieVal.substring(cookieVal.indexOf(cookieName), (cookieVal.indexOf(';',cookieVal.indexOf(cookieName))) );
		cookieValParts = cookieVal.split("=");
		return cookieValParts[1];
	} else {
	  return false;
        }
    }

    function addMiniText(text,fielditem){
        var currtext=document.forms['addForm'][fielditem].value;
        var newtest=currtext+""+text;
        document.forms['addForm'][fielditem].value=newtest;
    }
    
    function getArticle(node){
        mIndex = document.forms.articleForm.chooseArticle.selectedIndex;
        mAmount = document.forms.articleForm.chooseArticle.options[mIndex].value;
        window.location = "?node_id="+node+"&id="+mAmount;
    }

/* Dollar sign function from prototype */
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}


/* AJAX Functions */

//create cross-browser request object
function makeObject(){
	var x;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		x = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		x = new XMLHttpRequest();
	}
	return x;
}

var request = makeObject();


/* Uploader Timer */

function uploadTimerFetch(time){
	request.open('get', '../php/uploadtimer.php?time=' + time);
	request.onreadystatechange = showUploadTimerResult;
	request.send('');
}

function showUploadTimerResult() {
	if(request.readyState == 4){
		var response = request.responseText;
		var out = document.getElementById('uploadTimer');
		out.className = "active";
		out.innerHTML = response;
		uStartCount++;
	}
}

var uStartCount = 1;

function startUploadTimer() {
	var d1 = new Date();
	uploadTimerFetch(uStartCount);
	the_timeout = setTimeout("startUploadTimer(uStartCount)", 5000);

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}

/* Check that an email address is valid based on RFC 821 (?) */
function isValidEmail(address) {
    if (address != '' && address.search) {
        if (address.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
            return true;
        } else return false;
    } else return true;
}

function isValidPhone(NumStr, String) {
    for(var Idx=0; Idx<NumStr.length; Idx++) { 
        var Char = NumStr.charAt(Idx); 
        var Match = false; 

        for(var Idx1=0; Idx1<String.length; Idx1++) 
        { 
            if(Char == String.charAt (Idx1)) 
                Match = true; 
        } 

        if (!Match) 
            return false; 
    } 
    return true; 

}


/* 
   validation:::
   check required fields have been filled
   check email fields have a valid email address
   check username and password fields are at least 6 chars long 
*/
function validateforms() {
    if(! document.getElementsByTagName) return false;
    var forms = document.getElementsByTagName("form");
    for (var i=0;i<forms.length;i++) {   
        f = forms[i];
        f.onsubmit = function() {   
            for (var j=0;j<f.length;j++) {
                el = f.elements[j];
                if (el.type=='text' || el.type=='password') {
                    if (el.name.match('email')) {
                        if (! isValidEmail(el.value)) {
                            alert("Please supply a valid email address in the format you@yourdomain.com");
                            el.focus();
                            addClass(el,'required');
                            return false;
                        }
                    } else if (el.name.match('phone') || el.name.match('fax') || el.name.match('mobile')) {
                        if (! isValidPhone(el.value,"1234567890+- ")) { 
                            alert("Please supply a valid phone number.");
                            el.focus();
                            addClass(el,'required');
                            return false;
                        }                    
                    }                    
                }
            }
        }
    }
}

/* addLoadEvent(validateforms); */


/* ------------------------------------------------- [ EXTENSIONS ] **
* Native object extensions/prototypes
*/

String.prototype.parseJSON = function () {
	try {
		return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
		this.replace(/"(\\.|[^"\\])*"/g, ''))) &&
		eval('(' + this + ')');
	} catch (e) {
		return false;
	}
};


-->