//
// Load image not included in html-source
//
function loadImageURL(imageURL) {
	imageObj = new Image();
	imageObj.src = imageURL;
}

//
// Replace image according to naming convention
// (imageURL = ... + '_' + state + '.' + extension)
//
function toggleImageURL (imageName, state) {
	imageURL = document.images[imageName].src //[imageName]
	extension = imageURL.substring(imageURL.lastIndexOf ('.'), imageURL.length)
	if (imageURL.lastIndexOf ('_') == -1) 
		{imageURL = imageURL.substring(0, imageURL.lastIndexOf ('.'))}
	else 
		{imageURL = imageURL.substring(0, imageURL.lastIndexOf ('_') )}
	if (state != '') {state = '_' + state}
	document.images[imageName].src = imageURL + state + extension
}

//
// Get alternate framesource form searchstring in url
// (URL = protocol//host:port/pathname#hash?search)
// *1*: window.location.search.toString()  ... ends befor an included #hash-character
function frameSource (frameName, defaultSource) {
	searchString = window.location.toString(); searchString = searchString.substring(searchString.indexOf('?')) /*1*/
	if (searchString.substring (0,1) == '?') {
		searchString  = '&' + searchString.substring (1)
	}
	firstChar = searchString.indexOf('&' + frameName + '=')
	if (firstChar != -1) {
		firstChar += frameName.length + 2
		lastChar   = searchString.indexOf('&', firstChar)
		if (lastChar != -1) {
			result = searchString.substring (firstChar, lastChar)
		} else {
			result = searchString.substring (firstChar)
		}
	} else {
		result = defaultSource
	}
	return result
}

function setImageURL(imageName, imageURL) {
	if (document.images[imageName]) {
		document.images[imageName].src = imageURL;
		return true;
	}
}


function navigatorResizeFix () {
	if (navigator.appName == 'Netscape' &&
	parseInt(navigator.appVersion) >= 4) {
		window.location.reload()
	}
}

/********************************************************************************
NOTES: 

function loadImage:
	(1) call with onload-event (<body onload="...">) to load after page finished loading. 
	(2) might not work with IE according to [1]
	
function navigatorResizeFix
	(1) See also Adobe Golive Netscape CSS Fix-Action; [2a]
	
browser detection
NOTE: 
This script does not overcome Netscape's Win95 registry-dependent userAgent model. 
That is, if you've got 4.5 and 4.0x on the same computer, they will both report 4.5. [2]
	
	
	
------------------------
[1]	"... Internet Explorer doesn't support the Image object ..."
	How to pre-load images using JavaScript, plus... 
	Chuck Musciano, August 1997
	http://www.netscapeworld.com/netscapeworld/nw-08-1997/nw-08-html.html
	
[2]	Web Workshop
	Stephan Nedregård
	(a) http://www.micropop.com/workshop/css.html
	(b) http://www.micropop.com/workshop/detection.html
********************************************************************************/
