// drop down menu script
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				if(this.className){
					classNameSep = " ";
				} else {
					classNameSep = "";
				}
				node.onmouseover=function() {
					this.className+=classNameSep+"over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(classNameSep+"over", "");
				}
			}
		}
	}
}
//alert(window.onload);
window.onload=startList;
//alert(window.onload);

function gallery() {
	var safari = (navigator.userAgent.indexOf('Safari')!=-1);
	if (document.getElementById('gallery')) {
		var el		=	document.getElementById('gallery');
		var as		=	el.getElementsByTagName('IMG');
		for (i=0;i<as.length;i++) {
			as[i].onmouseover = function() {
			var tnsrc	=	this.src;
			var tnsrcs	=	tnsrc.replace('_tn','');
			var vw		=	document.getElementById('view');
			if (safari) {vw.src		=	tnsrc}
			vw.src		=	tnsrcs;
			}
		}
	}
}
gallery();


if(window.preload){
	a      = preload;
	loaded = new Array(a.length);
	for(i=0;i<a.length;i++){
		loaded[i]     = new Image();
	  	loaded[i].src = a[i];
	}
}

function pop(url,title,w,h,r,s,m,t) {

	if (title==null) {
		title = 'popup';
	} if (w==null) {
		w=600;
	} if (h==null) {
		h=600;
	} if (r==null) {
		r='no';
	} if (s==null) {
		s='no';
	} if (m==null) {
		m='no';
	} if (t==null) {
		t='no';
	}
	vars = 'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+',menubar='+m+',toolbar='+t;
	var newWin = window.open(url,title,vars);
	newWin.focus();
	return false;
}