//generic MM stuff
var menu_array = new Array('company','company1','products','product1','product2','product3','product4','product5','product6','product7','product8','product9','product10','product11','product12','product13','product14','product15','product16','services','solutions','solutions1','solutions2','solutions3','solutions4','solutions5','solutions6','solutions7','press','investor','contact','investor1','hide')

function hideAllLayers(k) {
	for (i=0; i<menu_array.length; i++)
	{
		if (menu_array[i]!=k)
			MM_showHideLayers(menu_array[i],'','hide');
	}
	//resetTopMenu('all');
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//Nav related functions
function fncMenu(objTR, objHREF,strStyle){
	//alert(objTR);
	//alert(objHREF);
	objTR.className=strStyle;
	objHREF.className=strStyle;

}

function CB_Show(){
  var i,p,v,obj,args=CB_Show.arguments;
  
  hideAllLayers(args[0]);

  for (i=0; i<(args.length); i++){ 
	 if ((obj=MM_findObj(args[i]))!=null) { 
		if (obj.style) { 
			obj=obj.style; 
		}
		obj.visibility='visible'; 
	}
  }
}

var Mac=(navigator.appVersion.indexOf("Mac")!=-1)? true:false;
var	Win=(navigator.appVersion.indexOf("Win")!=-1)? true:false;
var Opera=(navigator.userAgent.indexOf("Opera")!=-1)? true:false;
var IE = (document.all && window.print && !Opera) ? true : false;

NS4 = (document.layers) ? true : false;
function checkenter(event)
{
   var code = 0;

   if (NS4)
      code = event.which;
   else
      code = event.keyCode;
   if (code==13)
      document.eLogInForm.submit();
}

function checkenter2(event)
{
   var code = 0;

   if (NS4)
      code = event.which;
   else
      code = event.keyCode;
   if (code==13)
      document.login.submit();
}







function addbookmark(){
if (document.all)
window.external.AddFavorite(location.href, document.title)
}
function open_window(url, w, h) {
email = window.open(url,"Preview",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=YES,width='+w+',height='+h);
}

function land(ref, target)
{
if (target=="_self") {window.location=loc;
}
else {if (target=="_top") {top.location=loc;
}

else {if (target=="_blank") {window.open(loc);
}
else {if (target=="_parent") {parent.location=loc;
}
else {parent.frames[target].location=loc;
};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function jump2(menu)
{
ref=menu.choice2.options[menu.choice2.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function jump3(menu)
{
ref=menu.choice3.options[menu.choice3.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function jump4(menu)
{
ref=menu.choice4.options[menu.choice4.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function jump5(menu)
{
ref=menu.choice5.options[menu.choice5.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
function jump6(menu)
{
ref=menu.choice6.options[menu.choice6.selectedIndex].value;
splitc=ref.lastIndexOf("&");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000).toLowerCase();}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}


function mm_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.mm_p) d.mm_p=new Array();
var i,j=d.mm_p.length,a=mm_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.mm_p[j]=new Image; d.mm_p[j++].src=a[i];}}
}

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;
}

function mm_swapimgrestore() { //v3.0
  var i,x,a=document.mm_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;
}

function mm_swapimage() { //v3.0
//alert(mm_swapimage.arguments[2]);
  var i,j=0,x,a=mm_swapimage.arguments; document.mm_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=mm_findObj(a[i]))!=null){document.mm_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function doPopupVideoHigh(fileRef){
    var streamWin = window.open('/includes/popup/popup.jsp?fileRef='+fileRef+'&streamtype=1','StreamPlayer','width=418,height=413');
        streamWin.focus();
}

function doPopupVideoLow(fileRef){
    var streamWin = window.open('/includes/popup/popup.jsp?fileRef='+fileRef+'&streamtype=2','StreamPlayer','width=418,height=413');
        streamWin.focus();
}

function doPopupAudioLow(fileRef, audioItemN){
    var streamWin = window.open('/includes/popup/popup.jsp?fileRef='+fileRef+'&streamtype=3&n='+audioItemN,'StreamPlayer','width=418,height=413');
        streamWin.focus();
}

function popup(theURL,winName,features) {
     window.open(theURL,winName,features);
}


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}



function popup(theURL,winName,features) {
     window.open(theURL,winName,features);
}

	var bWrittenFunctions;

	function IEFlashTest()
	{
		var objFlash;
		var bHasFlash;

		if (navigator.appVersion.indexOf('MSIE 5')!=-1)
			bHasFlash=eval('try { var objFlash; objFlash=new ActiveXObject(\'ShockwaveFlash.ShockwaveFlash\'); delete objFlash; bHasFlash=true; } catch(e) { bHasFlash=false; }');
		else
		{
			{
				bWrittenFunctions=true;
				document.writeln('<SCR'+'IPT LANGUAGE="vbscript">');
				document.writeln('Function VBIETest');
				document.writeln('Dim objFlash');
				document.writeln('VBIETest=false');
				document.writeln('On Error Resume Next');
				document.writeln('Set objFlash=CreateObject("ShockwaveFlash.ShockwaveFlash")');
				document.writeln('If Err.Number=0 Then VBIETest=True');
				document.writeln('Set blnFlash=Nothing');
				document.writeln('End Function');
				document.writeln('</SCR'+'IPT>');
			}
			bHasFlash=VBIETest();
		}

		return(bHasFlash);
	}

	function HasFlash()
	{
		var bHasFlash=false;

		if ( (navigator.userAgent.indexOf("MSIE") == -1) || ( navigator.userAgent.indexOf("Mac")!=-1 ) )
		{
			// Netscape
			if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
			{
				bHasFlash=true;
			}
			else
			{
				bHasFlash=false;
			}
		}
		else
		{
			bHasFlash=IEFlashTest();
		}

		return(bHasFlash);
	}

	function InsertFlash( sFilename, iWidth, iHeight, sBackground )
	{
		var sOut;

		sOut='';
		sOut+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		sOut+='  width='+iWidth+' height='+iHeight+'>';
		sOut+='              <param name=movie value="'+sFilename+'">';
		sOut+='              <param name=quality value=high>';
		sOut+='              <param name=scale value=exactfit>';
		sOut+='              <param name=bgcolor value='+sBackground+'>';
		sOut+='<embed src="' + sFilename +'" quality=high bgcolor=' + sBackground;
		sOut+=' swLiveConnect=FALSE WIDTH=' + iWidth +' HEIGHT=' + iHeight + ' scale=exactfit';
		sOut+=' TYPE="application/x-shockwave-flash">';
		sOut+='</object>';
	
		document.write(sOut);
	}

	function InsertTag( sTag )
	{
		document.write(sTag);
	}


function open_window(url, w, h) {
email = window.open(url,"Preview",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=YES,width='+w+',height='+h);
}


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}


function StrIsEmail(value) {
	var ret = false;
	var emailRe=/\w+(.\w+)*@\w+(.\w+)*\.\w{2,3}/;
	var emailResult = emailRe.exec(value);
	if (emailResult) {
		if (emailResult[0].length ==  emailResult.input.length)
			ret = true;
	}
	return ret;
}

if(document.getElementById('meetingminutes')){
	document.getElementById('meetingminutes').style.display='none';
}

/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

// Only used in IE6
var isIE6 = true;

for(var i=0; i<document.images.length; i++)
 {
    var img = document.images[i]
    var imgName = img.src.toUpperCase()
    if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
    {
       var imgID = (img.id) ? "id='" + img.id + "' " : ""
       var imgClass = (img.className) ? "class='" + img.className + "' " : ""
       var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
       var imgStyle = "display:inline-block;" + img.style.cssText 
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
       if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
       var strNewHTML = "<span " + imgID + imgClass + imgTitle
       + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
       + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
       img.outerHTML = strNewHTML
       i = i-1
    }
 }
 
 sfHover = function() {
 	// this line was changed to remove the error
 	// var sfEls = document.getElementById("nav").getElementsByTagName("LI") ;
 
 	var sfEls = document.getElementsByTagName("li") ;
 	for (var i=0; i<sfEls.length; i++) {
 		sfEls[i].onmouseover=function() {
 			this.className+=" sfhover";
 		}
 		sfEls[i].onmouseout=function() {
 			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
 		}
 	}
 }
 if (window.attachEvent) window.attachEvent("onload", sfHover); 
 
 
 function toggle(objBodyEle){
 			if (document.getElementById(objBodyEle).className=='bodyClose'){
 				document.getElementById(objBodyEle).className='bodyOpen';
 			}else{
 				document.getElementById(objBodyEle).className='bodyClose';
 			}
 		}
 
 
 function addSinglePartTag(tagName, prompt, defaultText)
 {
   // If something is selected then just encase it in the tags
   var selection = document.selection.createRange().text;
   if(selection != "")
   {
     self.editform.message.focus();
     var newSelection = document.selection.createRange();
 	  newSelection.text 
 = '<'+tagName+'>'+selection+'</'+tagName+'>';
 	  return;
   }
 
   // Nothing's selected so prompt for something to put between the tags
   alert("Highlight the required text") ;
}


function deleteconf() {
	// alert("pmode is " + document.getElementById("pmode").value) ;
	var answer = confirm("Delete this file, are you sure?")
	if (answer){
		// change the form mode and submit the form
		document.getElementById("pmode").value = 'delete' ;
		document.imageupload.submit() ;
	}

}


function gosearch()
	{

	var region = document.getElementById("sregion").value
	var level = document.getElementById("slevel").value ;
	document.editform.xregion.value = region ;
	document.editform.xlevel.value = level ;
	document.editform.submit() ;

	}
function clickblank()
{
	document.editform.searchcrit.value = '' ;
}



function submitFunction(theForm, theValue, theAction) 
{
		
	if (theForm == 'eLoginForm') {

		// action number comes either from the drop-down or via a paramenter
		
		if (theValue == null) {
			var theDrop = document.getElementById('eLogIntoInput').value ;
			
		} else {
			var theDrop = theValue;
			
		}
		
		
		
		// logout code
		if (theDrop == 'Logout') {	
			document.getElementById('process').value  = 'logout' ;
			document.eLogInForm.submit();
			return true ;
		}
		
		
		// override action
		
		if (theAction != null) {
			document.eLogInForm.action = theAction;
		}
		
		var username =  document.getElementById('eUserIdInput').value ;
		var password =  document.getElementById('ePassWordInput').value ;
	
		var eMsgStr = "";

		if(theDrop == 0){
		   eMsgStr = "Please select the extranet site name...";
		   alert(eMsgStr);
		}

		else if(username == ""){
		   eMsgStr = "You must provide the user id...";
		   alert(eMsgStr);

		}
		// only check password if it isn't a forgot password 
		else if(password == "" && theValue != 4) {
		   eMsgStr = "You must provide the password..."   ;
		
		   alert(eMsgStr);

		}
		if (eMsgStr=="") {
			// alert("form ok: " + theDrop) ;
			document.eLogInForm.submit();
		}
		
	}	
}
