var enlarge_popup = '';
var addX = 0;
var addY = 0;
var test = "none"
 
browserDefaults();

function enlarge(title,image,x,y) {
	self.name="main"
	if (!enlarge_popup.closed && enlarge_popup.location) {
		enlarge_popup.close()
	}
	enlarge_popup = window.open( "/artwork.php?artworkTitle="+title+"&artworkPhotoName="+image+"&test="+test+"", "enlarge", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+x+",height="+y+"")
	enlarge_popup.resizeTo(x + addX, y + addY)
	enlarge_popup.focus()	
}

function paintings(x) {
	self.name="main"
	var drawings_popup = window.open( "paintings/"+x+".html", "paintings", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=500")
	paintings_popup.focus()	
}

function drawings(x) {
	self.name="main"
	var drawings_popup = window.open( "drawings/"+x+".html", "drawings", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=441,height=648")
	drawings_popup.focus()	
}

function map(x) {
	self.name="main"
	var map_popup = window.open( "maps/"+x+".html", "map", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=499,height=500")
	map_popup.focus()	
}



function hideshow(which,arrow){
	if (!document.getElementById)
	return
	if (which.style.display=="block") {
		which.style.display="none"
		arrow.src = "graphics/arrow_closed.gif"
	} else {
		which.style.display="block"
		arrow.src = "graphics/arrow_open.gif"
	}
}



function browserDefaults() {

	if(navigator.userAgent.indexOf("Mac")>-1) {
		if(navigator.userAgent.indexOf("Safari")>-1) {
			test = "m-s"
			addX = 0
			addY = 23
		} else if(navigator.userAgent.indexOf("Firefox")>-1) {
			test = "m-ff"
			addX = 0
			addY = 18
		} else if(navigator.userAgent.indexOf("Netscape")>-1) {
			test = "m-net"
			addX = 0
			addY = 23
		} else if(navigator.userAgent.indexOf("Opera")>-1){
			test = "m-o"
			addX = 0
			addY = 35
		} else if(navigator.userAgent.indexOf("MSIE")>-1){
			test = "m-msis"
			addX = 0
			addY = 0
		} else if(navigator.userAgent.indexOf("Camino")>-1){
			test = "m-cam"
			addX = 0
			addY = 41
		} else if(navigator.userAgent.indexOf("Mozilla")>-1){
			test = "m-moz"
			addX = 2
			addY = 25
		} else{
			test = "m-other"
			addX = 0
			addY = 0
		}
	} else {
		if(navigator.userAgent.indexOf("Firefox")>-1){
			test = "w-ff"
			addX = 8
			addY = 51
		} else if(navigator.userAgent.indexOf("Netscape")>-1) {
			test = "m-ff"
			addX = 0
			addY = 18
		} else if(navigator.userAgent.indexOf("MSIE")>-1){
			test = "w-msie"
			addX = 13
			addY = 32
		} else if(navigator.userAgent.indexOf("Opera")>-1){
			test = "w-opera"
			addX = 0
			addY = 0
		} else if(navigator.userAgent.indexOf("Mozilla")>-1){
			test = "w-moz"
			addX = 11
			addY = 53
		} else{
			test = "w-other"
			addX = 0
			addY = 0
		}
	
	}
}