//Checks whether browser matches given characteristics
//params:
//	browser : string - browser name
//	version : float - browser version, can be ommited
//	same_or_lower : boolean - 
//			if param is false, function returns true only for same version
//			if param is true, function returns true to same version or lower
//			can be ommited
//returns:
//	true for same browser name, optionally version (see above)
//by K. Siek
function is_browser(browser,version, same_or_lower){
	var index = navigator.userAgent.indexOf(browser);
	if(index<0)
		return false;
	if(version==null)
		return true;
	var versionString = navigator.userAgent.substring(index+browser.length+1);	
	if(parseFloat(versionString) == version)
		return true;
	if(same_or_lower)
		return parseFloat(versionString) < version;
	return false;
}
//Hides or shows element
//params:
//	listID : string - DOM id of element to be hidden/shown
//	imageID : string - DOM id of image connected with the element
//effect:
//	if list is opened then closes it and changes icon to 'closed' icon,
//	if list is closed then opens it and changes icon to 'open' icon
//	gifs or pngs : browser dependant
//by K. Siek
function show(listID,imageID){
	//alert(navigator.userAgent);
	if(is_browser("MSIE",6,true))
		extension=".gif";
	else
		extension=".png"; 
	//alert(extension);

	if(is_browser("MSIE",4.1,true)){
		list = document.all[listID];
		image = document.all[imageID];
	}else{
		list = document.getElementById(listID);
		image = document.getElementById(imageID);
	}
	
	if (list.style.display == "block"){
		list.style.display = "none";
		image.src = "www.pila/resources/folder"+extension;
	}else{			
		list.style.display =  "block";
		image.src = "www.pila/resources/folder_open"+extension;
	}
}
