/*
    Contains main js functions
*/

DOM = (document.getElementById) ? true : false;
NS4 = (document.layers) ? true : false;
IE = (document.all) ? true : false;
IE4 = IE && !DOM;

function Confirmation(message, action)
{
	if (confirm(message))
		FormSubmit(action) ;
	else
		return (false) ;
}

function SetDialog(imageSrc, imageText)
{
	hwnd = window.open("", "", "width=200,height=150,resizable=yes,scrollbars=yes") ;
	hwnd.document.open() ;
	hwnd.document.write('<html><head><title>Bild-Dialog<\/title><script type="text\/javascript">function CheckLoading(){') ;
	hwnd.document.write('if(document.theimage.complete){') ;
	if (IE4)
	{
		hwnd.document.write('document.all["IDLOAD"].style.visibility="hidden";') ;
		hwnd.document.write('document.all["IDIMAGE"].style.visibility="visible";') ;
	}
	else
	{
	    hwnd.document.write('document.getElementById("IDLOAD").style.visibility="hidden";') ;
		hwnd.document.write('document.getElementById("IDIMAGE").style.visibility="visible";') ;
	}
	hwnd.document.write('var newWidth = self.document.theimage.width > screen.availWidth ? screen.availWidth : self.document.theimage.width + 40;') ;
	hwnd.document.write('var newHeight = self.document.theimage.height > screen.availHeight ? screen.availHeight - 60 : self.document.theimage.height+ 60;') ;
	hwnd.document.write('self.resizeTo(newWidth, newHeight);') ;
	hwnd.document.write('self.moveTo((screen.availWidth - newWidth) / 2, (screen.availHeight - newHeight) / 2)}') ;
    hwnd.document.write('else{setTimeout("CheckLoading()",300);}}') ;
	hwnd.document.write('<\/script></head><body topmargin="0" leftmargin="0">') ;
	hwnd.document.write('<div id="IDLOAD" style="position:absolute;top:0px;left:0px;width:200px;height:200px;visibility:visible;background-color:#EFEFEF;font-family: Arial;font-size:14pt;">Loading...</div>') ;
	hwnd.document.write('<div id="IDIMAGE" style="visibility:hidden;font-family: Tahoma;font-size:8pt;padding:5px;" align="justify">') ;
	hwnd.document.write('<a href="javascript:self.close();"><img src="' + imageSrc + '" border="0" name="theimage"></a>') ;
	if (imageText)
		hwnd.document.write('<br>' + imageText) ;
	hwnd.document.write('</div>') ;
	hwnd.document.write('<script type="text\/javascript">CheckLoading();<\/script><\/body><\/html>') ;
	hwnd.document.close() ;
	hwnd.focus() ;
} // SetDiablog