<!-- Begin hiding JavaScript


function selection_window(image, width, height, user) {         // Pop-up Window function.
     // Add extra pixels to the width and height.
     width = width + 20;
     height = height + 20;

     // If window open, resize to new dimentions.
     if (window.popup_window && !window.popup_window.closed) {
         window.popup_window.resizeTo(width, height);  }


     // Set the window properties.
     var window_specs = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=0, top=0, width=" + width + ", height=" + height + "";

     // Set the URL.
     var url =  "" + image + '?user=' + user + "" ;

     // Create pop-up window.
     popup_window = window.open(url, "SelectWindow", window_specs);
     popup_window.focus();

}

function create_window(image, width, height) {         // Pop-up Window function.
     // Add extra pixels to the width and height.
     width = width + 20;
     height = height + 60;

     // If window open, resize to new dimentions.
     if (window.popup_window && !window.popup_window.closed) {
         window.popup_window.resizeTo(width, height);  }


     // Set the window properties.
     var window_specs = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=0, top=0, width=" + width + ", height=" + height + "";

     // Set the URL.
     var url = "Album/image_view.php?image=" + image + "";

     // Create pop-up window.
     popup_window = window.open(url, "PictureWindow", window_specs);
     popup_window.focus();

}

function login_window(image, width, height) {         // Pop-up Window function.
     // Add extra pixels to the width and height.
     width = width + 20;
     height = height + 20;

     // If window open, resize to new dimentions.
     if (window.popup_window && !window.popup_window.closed) {
         window.popup_window.resizeTo(width, height);  }


     // Set the window properties.
     var window_specs = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=150, top=150, width=" + width + ", height=" + height + "";

     // Set the URL.
     var url = "" + image + "";

     // Create pop-up window.
     popup_window = window.open(url, "LoginWindow", window_specs);
     popup_window.focus();

}

function getHTML(pagename) {
	new Ajax.Request(pagename,   {
		method:'get',
		onSuccess: getHTMLSuccess,
		onFailure: getHTMLFailure
	});
}

function getHTMLSuccess(originalRequest) {
	var response = originalRequest.responseText;
	$('htmlResult').innerHTML = response;
}

function getHTMLFailure() {
	alert('OMG, woops, what happened?');
}

function getXML() {
	new Ajax.Request('backendXML.xml',   {     
		method:'get',     
		onSuccess: getXMLSuccess,
		onFailure: getHTMLFailure
	}); 
}

function getXMLSuccess(originalRequest) {
	var response = originalRequest.responseXML;
	var numberOfBooks = response.getElementsByTagName('book').length;
	var titles = response.getElementsByTagName('title');
	var authors = response.getElementsByTagName('author');
	var isbns = response.getElementsByTagName('isbn');
	var resultText = "";
	resultText = "Total number of books = " + numberOfBooks;
	for( i=0; i<numberOfBooks; i++ ) {
		currentTitle = titles[i].firstChild.nodeValue;
		currentAuthor = authors[i].firstChild.nodeValue;
		currentIsbn = isbns[i].firstChild.nodeValue;
		resultText = resultText + "<p>";
		resultText = resultText + "<br/> Book " + (i+1);
		resultText = resultText + "<br/> Title = " + currentTitle;
		resultText = resultText + "<br/> Author = " + currentAuthor;
		resultText = resultText + "<br/> ISBN = " + currentIsbn;
		resultText = resultText + "</p>";
	}
	$('xmlResult').innerHTML = resultText;
}

function clearNode(node) {
$(node).innerHTML = "";
}

// (C) 2001 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
function closeMe(){
     var howLong = 5000;
     t = null;

     t = setTimeout("self.close()",howLong);
}

// End hiding JavaScript -->
