<!--
var ie, ns, ns6, ie6;

ie6 = 0;

ie = (document.all)? 1 : 0;
ns = (document.layers)? 1: 0;
ns6 = (navigator.product == 'Gecko')? 1 : 0;

if ((ie) || (ie6) || (ns6))
{
	var width = document.body.clientWidth;
	var origWidth = document.body.clientWidth;
	var origHeight = document.body.clientHeight;
}
	
if ((ns))
{
	var width = self.innerWidth;
	var origWidth = self.innerWidth;
	var origHeight = self.innerHeight;
}

if (document.images)
 {
    imgProductson = new Image();
    imgProductson.src = "/images/masthead/countries/products_spacer.gif";
    imgAgronomyon = new Image();
    imgAgronomyon.src = "/south_africa/images/header/sa_agronomy_on.gif";
    imgContacton = new Image();
    imgContacton.src = "/images/masthead/countries/en_common/writeus_hi.gif";
    imgHomeon = new Image();
    imgHomeon.src = "/zimbabwe/images/masthead/zi_home_on.gif";
    imgPcomon = new Image();
    imgPcomon.src = "/indonesia/images/masthead/home_hi.gif";
    img4on = new Image();
    img4on.src = "/images/spacer136.gif";
    img5on = new Image();
    img5on.src = "/images/spacer150.gif";
    img6on = new Image();
    img6on.src = "/images/spacer110.gif";

    imgProductsoff = new Image();
    imgProductsoff.src = "/images/masthead/countries/products_spacer.gif";
    imgAgronomyoff = new Image();
    imgAgronomyoff.src = "/south_africa/images/header/sa_agronomy_off.gif";
    imgContactoff = new Image();
    imgContactoff.src = "/images/masthead/countries/en_common/writeus.gif";
    imgHomeoff = new Image();
    imgHomeoff.src = "/zimbabwe/images/masthead/zi_home_off.gif";
    imgPcomoff = new Image();
    imgPcomoff.src = "/indonesia/images/masthead/home.gif";
    img4off = new Image();
    img4off.src = "/images/spacer136.gif";
    img5off = new Image();
    img5off.src = "/images/spacer150.gif";
    img6off = new Image();
    img6off.src = "/images/spacer110.gif";
}
	
//Function to activate images.
function imgOn (imgName) {
	if (document.images) {
	  document[imgName].src = eval(imgName + "on.src");
	}
}

//Function to deactivate images.
function imgOff (imgName) {
	if (document.images) {
	  document[imgName].src = eval(imgName + "off.src");
	}
}

function fnChangeBG(obj)
{
	obj.style.backgroundcolor = "#ffffff";
}

function fnReturnBG(obj)
{
	obj.bgcolor = "#ffcc66";
}

//function use for dropdown in footer to take user to the specif url
function fnGetHTML(myHTML)
{
	var NS4 = (document.layers) ? true : false;

	if(NS4)
	{
		myHTML = myHTML[myHTML.selectedIndex].value;
		top.location.href = myHTML;
	}
	else
	{
		myHTML = myHTML[myHTML.selectedIndex].value;
		top.location.href = myHTML;
	}
}

/////////////////////////////////////////////////////////
//This function switch the page to its
//correspondant language selected by the user
//It takes one parameter
//strLanguage which holds the folder name of the language
/////////////////////////////////////////////////////////
function fnShowLanguage(strLanguage)
{
	//request the host name
	var strHost = window.location.hostname;
	//request the path without the host name
	var strPath = window.location.pathname; //use pathname;
	//take the first slash out of the string
	var strLocation = strPath.slice(1,strPath.length);
	//obtain the name of the folder after the host name EJ: dupont_biotech
	var strRootFolder = strLocation.slice(0,strLocation.indexOf("/"));
	//obtain the rest of the link after the root folder
	strLocation = strLocation.slice(strLocation.indexOf("/"),strLocation.length);
	//put the new string together
	strNewLocation = "http://" + strHost + "/" + strRootFolder + strLanguage + strLocation;
	//redirect user to new location
	window.location = strNewLocation;
}

//this function handles resizing by user: NN4, but not NS6 or NC4.78, was looping...
function reDo()
{
	if(ie)
	{
		if ((document.body.clientWidth != origWidth) || (document.body.clientHeight != origHeight))
		{
			window.location.reload();
		}
	}

	if((ns)||(ns6))
	{
		if ((self.innerWidth != origWidth) || (self.innerHeight != origHeight))
		{
			window.location.reload();
		}
	}
}
//-->
