
// --------------------------------------------------------------
// open a window with a picture
// --------------------------------------------------------------
function showPic(myPic, myTitle) {


	myLastPos = top.document.URL.lastIndexOf("/")
	myInitPos = myLastPos - 2
	myLang = top.document.URL.substring(myInitPos, myLastPos)

	if (myLang == "en")
		myClose = "Close Window"
	else
		myClose = "Fechar Janela"

	tmp_html = ''
	tmp_html += '<html>\n'
	tmp_html += '<head>\n'
	tmp_html += '	<LINK REL=STYLESHEET TYPE="text/css" HREF="/arsopi.css">\n'
	tmp_html += '<title>\n'
	tmp_html += '	' + myTitle + '\n'
	tmp_html += '</title>\n'
	tmp_html += '</head>\n'
	tmp_html += '<body class="body_window_img">\n'
	tmp_html += '<table width="100%" border=0><tr><td width="100%" valign=middle align=center>\n'
	tmp_html += '	<img src="' + myPic + '" border=0><br><br>\n'
	tmp_html += '<a href="Javascript: window.close()">' + myClose + '</a>\n'
	tmp_html += '</td></tr></table>\n'
	tmp_html += '</body>\n'
	tmp_html += '</html>\n'

	posY = (screen.height / 2) - (216 / 2)
	posX = (screen.width / 2) - (660 / 2)

	new_window = window.open("","","toolbar=no,location=no,directories=no,status=no,center=yes,width=660,height=216,top=" + posY + ",left=" + posX)
	if (new_window != null) {

		new_window.document.open()

		new_window.document.write(tmp_html)

		new_window.document.close()
	}

	new_window = null
	
	return

}

// --------------------------------------------------------------
// open a window with a picture
// --------------------------------------------------------------
function showMap(myPic, myTitle) {


	myLastPos = top.document.URL.lastIndexOf("/")
	myInitPos = myLastPos - 2
	myLang = top.document.URL.substring(myInitPos, myLastPos)

	if (myLang == "en")
		myClose = "Close Window"
	else
		myClose = "Fechar Janela"

	tmp_html = ''
	tmp_html += '<html>\n'
	tmp_html += '<head>\n'
	tmp_html += '	<LINK REL=STYLESHEET TYPE="text/css" HREF="/arsopi.css">\n'
	tmp_html += '<title>\n'
	tmp_html += '	' + myTitle + '\n'
	tmp_html += '</title>\n'
	tmp_html += '</head>\n'
	tmp_html += '<body class="body_window_img">\n'
	tmp_html += '<table width="100%" border=0><tr><td width="100%" valign=middle align=center>\n'
	tmp_html += '	<img src="' + myPic + '" border=0><br><br>\n'
	tmp_html += '<a href="Javascript: window.close()">' + myClose + '</a>\n'
	tmp_html += '</td></tr></table>\n'
	tmp_html += '</body>\n'
	tmp_html += '</html>\n'

	posY = (screen.height / 2) - (730 / 2)
	posX = (screen.width / 2) - (900 / 2)

	new_window = window.open("","","toolbar=no,location=no,directories=no,status=no,center=yes,width=900,height=730,top=" + posY + ",left=" + posX)
	if (new_window != null) {

		new_window.document.open()
		new_window.document.write(tmp_html)
		new_window.document.close()
	}

	new_window = null
	
	return

}

// --------------------------------------------------------------
// close the image window
// --------------------------------------------------------------
function closeWindow() {
	if (imgWindow != null) {
		
		imgWindow.close()
		imgWindow = null
	}

	return
}

// --------------------------------------------------------------
// close the "send email" status window
// --------------------------------------------------------------
function closeStatusWindow() {

	if (statusWindow != null) {
		
		statusWindow.close()
		statusWindow = null
	}

	return
}

// --------------------------------------------------------------
// error Trap
// --------------------------------------------------------------
function errortrap() {

	return
}

// --------------------------------------------------------------
// test if the url is valid
// if not, replace it
// --------------------------------------------------------------
function testSite(lang) {

	if (parent.main == null) {

		top.location.replace("/" + lang + "/") // -> no history
	}

	return
}

