function preloadImages(){ //  Example: preloadImages('file.gif', 'http://www.x.com/y.gif');
	if(document.images){
		if(!document.imageArray) document.imageArray = new Array();
			var i,j = document.imageArray.length, args = preloadImages.arguments;
    
			for(i=0; i<args.length; i++){
				if (args[i].indexOf("#")!=0){
					document.imageArray[j] = new Image;
					document.imageArray[j++].src = args[i];
			}
		}
	}
}

function switchImage(imgName, imgSrc){
	if (document.images){
		if (imgSrc != "none"){
			document.images[imgName].src = imgSrc;
	    }
	}
}

function getPage(mypage,myname,w,h,scroll,winPos,location,dirs,status,menubar,toolbar,resize){
	
	if(winPos == "random") {
		LeftPosition = (screen.width)?Math.floor(Math.random() * (screen.width - w)):100;
		TopPosition = (screen.height)?Math.floor(Math.random() * ((screen.height - h) - 75)):100;
	
	}
	
	else if(winPos == "center") {
		LeftPosition = (screen.width)?(screen.width - w) / 2:100;
		TopPosition = (screen.height)?(screen.height - h) / 2:100;
	
	}
	
	else if ((winPos != "center" && winPos != "random") || winPos==null) {
		LeftPosition = (screen.width)?(screen.width - w) - 10:100;
		TopPosition = 5;
	
	}
	
	settings = 'width='+ w +',height='+ h +',top='+ TopPosition +',left='+ LeftPosition +',scrollbars='+ scroll +',location=' + location + ',directories=' + dirs + ',status=' + status + ',menubar=' + menubar + ',toolbar=' + toolbar + ',resizable=' + resize;
	popWin = window.open(mypage,myname,settings);

}