function closeWin(){;
	this.window.close;
}

function showPic(whichpic) {
  if (!document.getElementById("placeholder")) return true;
  var source = whichpic.getAttribute("href");
  var placeholder = document.getElementById("placeholder");
  placeholder.setAttribute("src",source);


  return false;
}


function prepareGallery(){ 
/**********  the ususal tests to make sure methods and ids are in place  ******************/
	if (!document.getElementsByTagName) {
		return false;
	}
	
	if (!document.getElementById) {
		return false;
	}
	if (!document.getElementById("galleryNav")){
		return false;
	}
	
	//**********set up the links by attaching a function literal ***************/
	var gallery = document.getElementById("galleryNav");
	var links = gallery.getElementsByTagName("a");
	for (var i=0; i < links.length; i++){
	
		links[i].onclick = function() {
		//send an object from prepgallery function(src attribute etc) to the showPic function
		showPic(this);
		//stop the default a link behavior
		return false;	
		}
	}
}

function addClass(element, value) {
	/*check if the class attrib exists....*/
	if (!element.className){
		/*if not assign the incoming style name....*/
		element.className = value;
	}else{
		newClassName = element.className;
		newClassName+= " ";
		newClassName+= value;
		element.className = newClassName;
	}
}

function stripeTables() {
	if (!document.getElementsByTagName) return false;
	var tables = document.getElementsByTagName("table");
	for (var i=0; i<tables.length; i++){
		var odd = false;
		var rows = tables[i].getElementsByTagName("tr");
		for (var j=0; j<rows.length; j++) {
			if (odd == true){
				addClass(rows[j], "odd");
				odd = false;
			}else{
				odd = true;
			}
		}
	}
}


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


addLoadEvent(prepareGallery);
addLoadEvent(stripeTables);
/*addLoadEvent(prepareForms);*/
