// GLOBAL VARIABLES
var ns4 = document.layers
var ns6 = document.getElementById&&!document.all
var ie4 = document.all
var child;
var child2;

// SUBMIT FORM
function submitForm() 
{
    document.form.submit();
}

function ClosePopup() 
{
	window.opener.document.form.submit();
	window.close();
}

// GET DOCUMENT ELEMENT
function GetObject(id)
{
	// This function checks for DOM strategy, then 
	// returns an object reference.
	if (document.all)
	{
		return document.all[id];
	}
	else if(document.layers)
	{
		return document.layers[id];
	}
	else
	{
		return document.getElementById(id);
	}
}

// SET HIDDEN FIELD VALUE
function SetField(field, val)
{
	GetObject(field).value = val;
}


// SHOW/HIDE DIV & SPAN TAGS
function showHideContent(id)
{
	var daObj = GetObject(id);
	var flfnm = id + "IsShown";
	var hidfld = GetObject(flfnm);
//	alert (hidfld.value);
	if (daObj)
	{
		if (daObj.style.display == "none")
		{
			// display the object
			daObj.style.display = "";
			daObj.style.visibility = "visible";
			if (!(null == hidfld))
			{
				hidfld.value = "true";
			}
		}
		else
		{
			// disable display
			daObj.style.display = "none";
			//daObj.style.visibility = "hidden";
			if (!(null == hidfld))
			{
				hidfld.value = "false";
			}
			if (ns6)
			{
				daObj.style.visibility = "collapse";
			}
		}
	}
}

// This script is not optimised at all ...
// It was split into netscape and ie to test some functions, it can be put all in one section

var imgWindow;           
function popupWindow(largeimage, text, imgwidth, imgheight, heading)
{               

    theimage = "images/" + largeimage;        
    imgheight1 = imgheight + 80;       
	imgwidth1 = imgwidth + 15;
    var resizewidth = imgwidth1 + 5;
    var resizeheight = imgheight1 + 30;

    textString = "";        
    if (navigator.appName == "Netscape")
    {        
        imgWindow = window.open("", "imgWindow", "width="+imgwidth1+",height="+imgheight1+"");        
        textString += "<html><head><title>Enlarged Image</title><link rel=stylesheet type=text/css href=styles/navstyle.css></head>"
        textString += "<body topmargin=0 leftmargin=10 marginheight=0 marginwidth=0 onBlur=self.focus() class=popup>"        
        textString += "<div class=heading align=left>"
        textString += heading + ": "
        textString += "</div>"        
        textString += "<div class=popup align=center>"
        textString += text
        textString += "</div>"
        textString += "<img src=navigation/trans.gif width=10 height=1><img src=" +theimage+"  border=0>"
        textString += "<div class=popup align=center>"
        textString += "<a class=level1 href=javascript:close()>Close</a>"
        textString += "</div>"
        textString += "</body></html>"
        imgWindow.document.write(textString);
        imgWindow.document.close();            
    }        
    else    
    {
        imgWindow = window.open("", "imgWindow", "width="+imgwidth1+", height="+imgheight1+"");        		
        textString += "<html><head><title>Enlarged Image</title><link rel=stylesheet type=text/css href=styles/navstyle.css></head>"
        textString += "<body topmargin=0 leftmargin=10 marginheight=0 marginwidth=0 scroll=no onBlur=self.focus() "
        textString += "onResize=this.resizeTo("
        textString += resizewidth
        textString += ","+resizeheight+") class=popup>"        
        textString += "<div class=heading align=left>"
        textString += heading + ": "
        textString += "</div>"
        textString += "<div class=popup align=center>"
        textString += text
        textString += "</div>"
        textString += "<img src=" +theimage+" width="+imgwidth+" height="+imgheight+" border=0>"
        textString += "<div class=popup align=center>"
        textString += "<a class=level1 href=javascript:close()>Close</a>"
        textString += "</div>"
        textString += "</body></html>"
        imgWindow.document.write(textString);
        imgWindow.document.close();    
    }        
            
    imgWindow.focus();
    imgWindow=null;    
    }


