<!--
function lightup(imageobject, degree){
    if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
    	imageobject.style.MozOpacity=degree/100;
     }else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){
    	
    	//imageobject.style.filters.alpha.opacity=opacity;
    	//imageobject.filters.alpha.opacity=degree;
    }
    
}
var req;
		
function loadXMLDoc(url) 
{
	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {
		
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		req.open("GET", url, true);
		req.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = processReqChange;
			req.open("GET", url, true);
			req.send();
		}
	}else{
		// forward unsupported browsers to a different version
		alert("Your browser does not support XMLHTTP.")
	}
}
function getElementTextNS(local, parentElem) {
	var result = "";
        result = parentElem.getElementsByTagName(local)[0];

	if (result) {
	        // get text, accounting for possible
 	       // whitespace (carriage return) text nodes 
	        if (result.childNodes.length > 1) {
			return result.childNodes[1].nodeValue;
		} else {
			return result.firstChild.nodeValue;	
		}
	} else {
		return "n/a";
	}
}
var winW = 630, winH = 460;

// initialize some global vars

var br, ver;


// very basic check for browser type and version
if (navigator.appName == "Netscape") {
	br="ns";
}
ver = navigator.appVersion.substring(0,1);


var div;
function place(content,table){

if (parseInt(navigator.appVersion)>3) {
 if (window.innerWidth) {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }else if(document.body.clientWidth){
  winW = document.body.clientWidth;
  winH = document.body.clientHeight;
 }
}
	if(document.getElementById){ // watch out for older browsers
		div = document.getElementById(table);
		if(div){
			div.innerHTML = "";
			// new HTML content
			div.innerHTML = content;
		}
	}
}

function processReqChange() 
{
	var items,comment,img,title,size,next,prev,type;

	// only if req shows "complete"  3=recieving
	if (req.readyState == 4) {
		// only if "OK"
		if (req.status == 200) {
		// ...processing statements go here...
			
			items = req.responseXML.getElementsByTagName("list");  
               		
			// check for content
			if(items.length>0){
				type=getElementTextNS("type", items[0]);
				if(type=="Calendar"){
				comment = getElementTextNS("content", items[0]);
				place(comment,"content");
				if(div.clientWidth){
					
					if(div.clientWidth>=winW-20){
						div.style.left=0;
					}else{
						div.style.left=(winW-div.clientWidth)/2;
					}
					//alert(div.clientWidth+" "+winW)
					
					if(div.clientHeight>=winH-20){
						div.style.top=0;
					}else{
						div.style.top=(winH-div.clientHeight)/2;
					}
					//alert((winW-div.clientWidth)/2);
				}

				}else{
				img = getElementTextNS("img", items[0]);
				title = getElementTextNS("title", items[0]);
				comment = getElementTextNS("comment", items[0]);
				size=getElementTextNS("size", items[0]);
				next=getElementTextNS("next", items[0]);
				prev=getElementTextNS("prev", items[0]);
				if(img!="missing"){
					img="<img src="+img+" "+size+" onload=disableRightClickImg('disabled',this)>"+comment;
				}
				place(img,"img");
				place(title,"title");
				place(prev,"prev");
				place(next,"next");
				}
				
				
						
					
			}
		} else {
			alert("There was a problem retrieving the XML data:\n" + req.statusText);
		}
	}

}


// function to make tool tip hidden
function closePage(){
		if(br == "ns" && ver <= 4) { 		

			var lyr = document.layers[content];
			lyr.visibility = 'hidden';
		} else {
			var lyr = document.getElementById('content');
			lyr.style.visibility='hidden';
		}

	place("loading...","content");
}
function loadPage(input)
{
	var url;
	// Input mode
	
	url  =   '/xml.php?id=' + input;
	loadXMLDoc(url);
}
function loadCalendar(input)
{
		if(br == "ns" && ver <= 4) { 		
			var lyr = document.layers[content];
			lyr.visibility = 'visible';
		} else {
			var lyr = document.getElementById('content');
			lyr.style.visibility='visible';
		}

	var url;
	// Input mode
	
	url  =   '/calendar.php?id=' + input;
	loadXMLDoc(url);
}


    window.nam ="main";

    var isNav4, isIE4, isMac, isNav6;

    

    if( parseInt( navigator.appVersion.charAt( 0 )) >= 4) {

      isNav4 = ( navigator.appName == "Netscape" && parseInt( navigator.appVersion ) != 5 ) ? true : false

      isNav6 = ( navigator.appName == "Netscape" && parseInt( navigator.appVersion ) == 5 ) ? true : false

      isIE4 = ( navigator.appName.indexOf( "Microsoft" ) != -1 ) ? true : false

      isMac = ( navigator.platform.indexOf( "Mac" ) != -1 ) ? true : false

    }

    

    function doSubWin( url, winWidth, winHeight ) {

      if( isNav4 || isIE4 ) {

        var screenPosX,screenPosY;

        screenPosX = ( screen.availWidth - winWidth ) / 2;

        screenPosY = ( screen.availHeight - winHeight ) / 2;

        

        if( isNav4 ) {

          window.open( url, 'subwin','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1, copyhistory=0,width=' + winWidth + ',height=' + winHeight + ',screenX=' + screenPosX + ',screenY=' + screenPosY );

        }

        

        if( isIE4 ) {

          newwin = window.open( url, 'subwin','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1, copyhistory=0,width=' + winWidth + ',height=' + winHeight + ',left=' +screenPosX+ ',top=' + screenPosY );

        }

      } else {

        window.open( url, 'subwin','toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1, copyhistory=0,width=' + winWidth + ',height=' + winHeight );

      }

    }

//-->

