/******************************
*
* Javascript for www.bassstudioarchitects.com
*
* @date: 2007-0303
*
* some code may be borrowed or heavily inspired by Jeremy Keith's DOM Scripting (2005) from Friends of Ed.
*
*********************************/

/* custom stuff */

/* function to handle thumbnails replacing main image in portfolio/project.php */
function prep_clientLinks(){
	if(!document.getElementsByTagName || !document.getElementById){
		return false;
	}
	if(document.getElementById("clients")){
		var box = document.getElementById("clients");
		if(document.getElementsByTagName("a")){
			var links = box.getElementsByTagName("a");
			for (var i=0; i<links.length; i++){
				links[i].onclick = function(){
					//alert(this.name);
					popUp(this.getAttribute("href"), this.name);
					return false;
				}
			}
		}
	}
}
addLoadEvent(prep_clientLinks);




/* global resources */

/* function to simply multiple functions in window.onload
* DOM Scripting (103) :: Simon Willison (http://simon.incution.com) */
function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}
	else {
		window.onload = function(){
			oldonload();
			func();
		}
	}
}


/* generic popup window function to act as an interface to window.open() 
* DOM Scripting (88) */
function popUp(winURL, title){
	window.open(winURL, title);
}
