//browser sniffing (old is vold netscape)
var iex=(document.all)
var nav,old
if(navigator.appName=="Netscape"){(document.layers)?nav=true:old=true;}

Xoffset= 80;
Yoffset= -60;
var defaultEmptyOK = false;
var whitespace = " \t\n\r";
function popUp(URL,width,height,left,top) {
	if (width == null || width == '') width = 500;
	if (height == null || height == '') height = 500;
	if (left == null || left == '') left = 400;
	if (top == null || top == '') top = 200;
window.open(URL, 'newwin', 'toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width='+width+',height='+height+',left='+left+',top='+top);
}

function checkEmail (theField)
{
    if (!isEmail(theField.value)){
       alert("The email address is not valid");
       return false;
      }
    else return true;
}

function isEmail (s)
{
	   if (isEmpty(s))
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
    // is s whitespace?
    if (isWhitespace(s)) return false;

    // there must be >= 1 character before @, so we
    // start looking at character position 1
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")){
    	return false;
    	}
    else return true;
}
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}


function popupToolTip(role,text,x1,y1){

if (x1 != null || x1 != '') Xoffset=x1;    // modify these values to ...
if (y1 != null || y1 != '') Yoffset=y1;    // change the popup position.



//var content="<TABLE WIDTH=380 BORDER=1 BORDERCOLOR=#003366 CELLPADDING=2 CELLSPACING=0 "+
//"BGCOLOR=#ffff99><TR><TD ALIGN=left><div class=textSmall><b>"+text+"</b></div></TD></TR></TABLE>";

var content= getToolTipStyle(text);

if(old){alert(msg);return;}
else
 {
 yyy=Yoffset;

if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}
 if(iex){
  //document.all.tooltext.style.width = 380;
  //document.all.tooltext.style.backgroundColor = "#ffff99";
  //document.all.tooltext.style.border = "solid #003333 1px";
  //document.all.tooltext.style.padding = "1";
  //document.all.tooltext.style.backgroundImage="url(http://dev.icl.co.uk:8083/web/icl_uk/localData/img/whitepapers/getacro.gif)";
  //document.all.tooltext.innerHTML="<TABLE WIDTH=380 BORDER=0 BORDERCOLOR=#003366 CELLPADDING=2 CELLSPACING=0 BGCOLOR=#ffff99><TR><TD align=center><IMG SRC='http://dev.icl.co.uk:8083/web/icl_uk/localData/img/whitepapers/getacro.gif'></TD><TD><div class='textSmall'>"+text+"</div></TD><TR></TABLE>";
  //document.all.tooltext.innerHTML="<TABLE WIDTH=380 BORDER=0 BORDERCOLOR=#003366 CELLPADDING=2 CELLSPACING=0 BGCOLOR=#ffff99><TR><TD align=center><IMG SRC='http://dev.icl.co.uk:8083/web/icl_uk/localData/img/whitepapers/getacro.gif' ></TD><TD><div class='textSmall'>"+text+"</div></TD><TR></TABLE>";
  {
   document.all.tooltext.innerHTML=content;
  }

   document.all.tooltext.style.visibility = "visible";

 }

  //skn.visibility="visible";

 }
}


function get_mouse(e){
var x=(nav)?e.pageX:event.x+document.body.scrollLeft;skn.left=x+Xoffset;
var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
}


function killToolTip(){
if(!old){yyy=-1000;skn.visibility="hidden";}
}


