
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/********************
NAVIGATION ROLLOVERS
********************/
var swapIm = new Array();
var old = "";
var oldSrc = "";

var Im = new Array(
   "/images/phase1/header_menu_our_business_on.gif",
   "/images/phase1/header_menu_products_on.gif",
   "/images/phase1/header_menu_global_on.gif",
   "/images/phase1/header_menu_sustain_on.gif",
   "/images/phase1/header_menu_careers_on.gif",
   "http://www.valeinco.com/images/decrease_on.gif",
   "http://www.valeinco.com/images/increase_on.gif",
    "/images/phase1/header_menu_comminvest_on.gif"
 );

	for(i in Im) {
	   swapIm[i] = new Image();
	   swapIm[i].src = Im[i];
    }

function swapImage(n,index) { //v3.0
        n = arguments[0].toString();
		index = parseInt(arguments[1]);
		eval("oldSrc = document." + n + ".src");
		old = n;
		eval("document." + n + " .src=swapIm[" + index + "].src");
}
function swapImgRestore() { //v3.0
    eval("document." + old + ".src=oldSrc");
}

/*INCO REPORT POP-UP JS */
function open_window(url){
		window.open(url,"presentation",'toolbar,location,directories,status,menubar,scrollbars,resizable,left=0,top=0,width=780,height=550')
}

function launch_csr_report(url){
		window.open(url,"report",'toolbar,location,directories,status,menubar,scrollbars,resizable,left=0,top=0,width=800,height=600')
}
function launch_Q1_03() {
	window.open("/investorinfo/presentations/quarterly/2003/2003_q1/frames.htm", "presentation", "scrollbars,width=760,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function launch_Q2_03() {
	window.open("/investorinfo/presentations/quarterly/2003/2003_q2/frames.htm", "presentation", "scrollbars,width=760,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function launch_Q3_03() {
	window.open("/investorinfo/presentations/quarterly/2003/2003_q3/frames.htm", "presentation", "scrollbars,width=760,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function launch_Q1_04() {
	window.open("/investorinfo/presentations/quarterly/2004/2004_q1/frames.htm", "presentation", "scrollbars,width=760,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function launch_Q2_04() {
	window.open("/investorinfo/presentations/quarterly/2004/2004_q2/frames.htm", "presentation", "scrollbars,width=760,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function goSpec(prod,lang,id){
    var download;
    var url = "/products/_includes/register_productspec.asp?product=" + escape(prod) + "&lang=" + lang + "&id=" + id;
    download = window.open(url, "presentation", "scrollbars,width=500,height=430,left=10,top=10,toolbar,menubar,status,resizable");
    download.focus();
}
function open_ExternalLinksDisclaimer(url){
var disc;
	url = escape(url);
	disc = window.open('/ext_links_disclaimer.aspx?url=' + url, 'Inco','width=400,height=300,left=200,top=50,resizable,scrollbars=no');
	disc.focus();
}

function open_External_ForwardLooking(url){
var disc;
	url = escape(url);
	disc = window.open('/ext_fls_links_disclaimer.aspx?url=' + url, 'Inco','width=520,height=300,left=200,top=50,resizable,scrollbars=yes');
	disc.focus();
}
function open_External_Merger(url){
var disc;
	url = escape(url);
	disc = window.open('/ext_merg_links_disclaimer.aspx?url=' + url, 'Inco','width=520,height=300,left=200,top=50,resizable,scrollbars=yes');
	disc.focus();
} 
function open_Window(url) {

	popupaWin = window.open(url, "INCO", "scrollbars,width=640,height=395,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function launch_slides(url){
		window.open(url,"presentation", "scrollbars,width=780,height=430,left=10,top=10,toolbar,menubar,status,location,resizable");
}

function open_SmallWindow(url) {
	popupWin = window.open(url, 'INCO2', 'width=400,height=400,left=10,top=10,resizable');
}
        function Trim(str)
        /***
                PURPOSE: Remove trailing and leading blanks from our string.
                IN: str - the string we want to Trim

                RETVAL: A Trimmed string!
        ***/
        {
                return RTrim(LTrim(str));
        }



        function LTrim(str)
        /***
                PURPOSE: Remove leading blanks from our string.
                IN: str - the string we want to LTrim

                RETVAL: An LTrimmed string!
        ***/
        {
                var whitespace = new String(" \t\n\r");

                var s = new String(str);

                if (whitespace.indexOf(s.charAt(0)) != -1) {
                    // We have a string with leading blank(s)...

                    var j=0, i = s.length;

                    // Iterate from the far left of string until we
                    // don't have any more whitespace...
                    while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
                        j++;
                     // Get the substring from the first non-whitespace
                    // character to the end of the string...
                    s = s.substring(j, i);
                }

                return s;
        }



        function RTrim(str)
        /***
                PURPOSE: Remove trailing blanks from our string.
                IN: str - the string we want to RTrim

                RETVAL: An RTrimmed string!
        ***/
        {
                // We don't want to trip JUST spaces, but also tabs,
                // line feeds, etc.  Add anything else you want to
                // "trim" here in Whitespace
                var whitespace = new String(" \t\n\r");

                var s = new String(str);

                if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
                    // We have a string with trailing blank(s)...

                    var i = s.length - 1;       // Get length of string

                    // Iterate from the far right of string until we
                    // don't have any more whitespace...
                    while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
                        i--;


                    // Get the substring from the front of the string to
                    // where the last non-whitespace character is...
                    s = s.substring(0, i+1);
                }

                return s;
        }
function showDivs(){
    var theDiv;
    doAll = (document.all!=null)  // Test if All support exists
    if (document.getElementById)  {
        theDiv= document.getElementById("divToHide");
        if(theDiv){theDiv.style.visibility='visible';}
        }else{
        if(theDiv){theDiv = document.layers["divToHide"];
        theDiv.visibility='visible';}
        }
}
function hideDivs(){
    var theDiv;
    //doAll = (document.all!=null)  // Test if All support exists
    if (document.getElementById)  {
        theDiv= document.getElementById("divToHide");

        if(theDiv){theDiv.style.visibility='hidden';}
        }else{
        if(theDiv){theDiv= document.layers["divToHide"];
        theDiv.visibility='hidden';}
        }
}		

window.onload = CheckPrintVersion;

function CheckPrintVersion() {
	var currLocation = window.location.href;
	if(currLocation.indexOf("pf=1") > -1) {
		document.body.style.backgroundImage = "none";
	}
}
//-->
