	 function findTable(table) { // For faster usage
	   while((table.localName || table.tagName).toLowerCase() != 'table') {
              table=table.parentNode;
           }
	   return table;
	 }
	 
	 function setClassHoverTable(node) {
			 if (!node.table) node.table=findTable(node);
			 var cellIndex=node.cellIndex;

			 setClassHover(node, 'hoverCell');
			 setClassHover(node.parentNode, 'hoverRow');			 
			 for(var row=0; row < node.table.rows.length; row++) {
					 setClassHover(node.table.rows[row].cells[cellIndex], 'hoverCol');
			 }
	 }

	 function unsetClassHoverTable(node) {
			 if (!node.table) node.table=findTable(node);
			 var cellIndex=node.cellIndex;

			 unsetClassHover(node, 'hoverCell');
			 unsetClassHover(node.parentNode, 'hoverRow');
			 for(var row=0; row < node.table.rows.length; row++) {
					 unsetClassHover(node.table.rows[row].cells[cellIndex], 'hoverCol');
			 }
	 }


 	 function setClassHover(node, sClass) {
           if (!node) return;
	   node.className=(node.className || node.getAttribute('class')) + ' '+sClass;
	   node.setAttribute('class', node.className);
	 }

	 function unsetClassHover(node, sClass) {
           if (!node) return;
	   node.className=(node.className || node.getAttribute('class')).replace(new RegExp(" "+sClass), '');
	   node.setAttribute('class', node.className);	 
	 }



		function toCenter(el) {                                                                                                  	
			
			var bl = document.getElementById("blackOut");
			
			el.style.display = 'block';
			bl.style.display = 'block';

			el.style.position = "absolute";
			
                        if (window.innerWidth) {
				var screenMaxW = window.innerWidth;
				var screenMaxH = window.innerHeight;
			} else if (document.documentElement && document.documentElement.clientWidth) {
				var screenMaxH = document.documentElement.clientHeight;
				var screenMaxW = document.documentElement.clientWidth;
			} else if (document.body) {
				var screenMaxW = document.body.clientWidth;
				var screenMaxH = document.body.clientHeight;
			}
			var x = (screenMaxW - el.clientWidth)/2;
        		var y = (screenMaxH - el.clientHeight)/2;


			if (document.all) {	
				iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
                   		y = y + iebody.scrollTop;
				bl.style.height = iebody.scrollWidth;

			} else {
				// el.style.position = "fixed";
				bl.style.position = "fixed";
			}

	                el.style.left = x + 'px';
			$(el).show();
			el.style.top = "-600px"; /*y + 'px';*/
			$("#gallerycontainer").hide();
			if ($.browser.msie) {
				
				/*$(bl).fadeIn("slow");
				$(el).animate({"top":y}, "slow", "swing");*/
			} else {
				/*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
			}
			/*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
			$(el).animate({"top":y}, "slow", "swing");
		}

		function hideLogin() {
			
			$("#helpNotes").animate({"top":"-600"},"slow", "swing", function() {
				$("#blackOut").hide();
				$("#gallerycontainer").show();
	
				if ($.browser.msie) {
					
				} else {
					/*$("#blackOut").fadeOut("slow");*/

				}
			});

		}




		function sendWindow () {                                                                                                  	
			
			var bl = document.getElementById("blackOut");
			var el = document.getElementById("sendThisPage");
			
			el.style.display = 'block';
			bl.style.display = 'block';

			el.style.position = "absolute";
			
                        if (window.innerWidth) {
				var screenMaxW = window.innerWidth;
				var screenMaxH = window.innerHeight;
			} else if (document.documentElement && document.documentElement.clientWidth) {
				var screenMaxH = document.documentElement.clientHeight;
				var screenMaxW = document.documentElement.clientWidth;
			} else if (document.body) {
				var screenMaxW = document.body.clientWidth;
				var screenMaxH = document.body.clientHeight;
			}
			var x = (screenMaxW - el.clientWidth)/2;
        		var y = (screenMaxH - el.clientHeight)/2;


			if (document.all) {	
				iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
                   		y = y + iebody.scrollTop;
				bl.style.height = iebody.scrollWidth;

			} else {
				// el.style.position = "fixed";
				bl.style.position = "fixed";
			}

	                el.style.left = x + 'px';
			$(el).show();
			el.style.top = "-600px"; /*y + 'px';*/
			$("#gallerycontainer").hide();
			if ($.browser.msie) {
				
				/*$(bl).fadeIn("slow");
				$(el).animate({"top":y}, "slow", "swing");*/
			} else {
				/*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
			}
			/*$(bl).fadeIn("slow", function() {$(el).animate({"top":y}, "slow", "swing")});*/
			$(el).animate({"top":y}, "slow", "swing");
		}

		function hideSend() {
			
			$("#sendThisPage").animate({"top":"-600"},"slow", "swing", function() {
				$("#blackOut").hide();
				$("#gallerycontainer").show();
	
				if ($.browser.msie) {
					
				} else {
					/*$("#blackOut").fadeOut("slow");*/

				}
			});

		}

