
var aWindow = null;
function openWind(a,w,h,s) {
   if(aWindow != null){
     aWindow.close();
   }
   
   aWindow = window.open(a,"", "width="+w+",scrollbars="+s+",height="+h);
   return;
}

function goUrl(val){
	var Tis  = document.getElementById("familysite");
	if(val == "" || val == null){
		return;
	} else {
		document.location.href = Tis.options[Tis.selectedIndex].value;
	}
}

///////////////////////////////////////////////////////////////////////////////////////////
function imageholderclass(){
	this.over=new Array();
	this.src=new Array();
	this.store=store;

	function store(src, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
	}
}

var ih = new imageholderclass();

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')){

			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';

			if(checker) mouseover(t[i]);mouseout(t[i]);

			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		//t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		//t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	preloader(it);
}

if(window.addEventListener) { window.addEventListener("load", preloadimgsrc, false); }
else { if(window.attachEvent) { window.attachEvent("onload", preloadimgsrc); } else { if(document.getElementById){ window.onload=preloadimgsrc; } } }
