// 2003-11-21 \u00E4ndrade Our Customers till Customers


function layerWrite(id,txt) {
        if (ns4) {
            var lyr = document.layers[id].document
		lyr.open();
            lyr.write("<table width='155' border='0' cellpadding='0' cellspacing='0'><tr><td class='Link'>"+txt+"</td></tr></table>");
            lyr.close();
        } 
		else if (ie4) {
		document.all[id].innerHTML = txt
	  } 
		else if (ns6) {
		over = document.getElementById(id);
		range = document.createRange();
		range.setStartBefore(over);
		domfrag = range.createContextualFragment(txt);
		while (over.hasChildNodes()) {
			over.removeChild(over.lastChild);
		}
		over.appendChild(domfrag);
	}
}



function OpenPrint() {
  window.open('/wcw.nsf/print/'+document.forms[2].docURL.value);
}
//
function TipAFriend() {
  window.open('/wcw.nsf/MemoTipsWeb?OpenForm&url='+document.forms[2].docURL.value,"","height=400,width=600,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=noscrollbars=no,resizable=yes,copyhistory=no");
}
//
function OpenHugin() {
  window.open("http://phx.corporate-ir.net/phoenix.zhtml?c=129966&p=irol-alerts","","height=500,width=800,left=0,top=0,toolbar=no,location=no,directories=no,status=yes,menubar=noscrollbars=no,resizable=yes,copyhistory=no");
}
//
function OpenProfile() {
  //window.open("http://212.209.194.145/www/profiles.nsf/profiles/"+document.forms[2].userID.value+"?EditDocument","","height=400,width=600,left=0,top=0,toolbar=no,location=no,directories=no,status=yes,menubar=noscrollbars=no,resizable=yes,copyhistory=no");
    location.href='/wcw.nsf/MyProfile?Openform&referer='+document.forms[2].docURL.value;
}
//
function OpenProfile1() {
  //window.open("http://212.209.194.145/www/profiles.nsf/profiles/"+document.forms[0].userID.value+"?EditDocument","","height=400,width=600,left=0,top=0,toolbar=no,location=no,directories=no,status=yes,menubar=noscrollbars=no,resizable=yes,copyhistory=no");
  location.href='/wcw.nsf/MyProfile?Openform';
}
//
function SubscribeDoc() {
//  var c1=document.forms[2].Categoryweb1.value;
//  var c2=document.forms[2].Categoryweb2.value;
//  var c3=document.forms[2].Categoryweb3.value;
//  var c4=document.forms[2].Categoryweb4.value;
//  if (c4!='') {c4=':'+c4}//else{c4=':'}
//  if (c3!='') {c3=':'+c3}//else{c3=':'}
//  if (c2!='') {c2=':'+c2}//else{c2=':'}
 // location.href='/wcw.nsf/subscribe?Openform&categoriesWeb='+c1+c2+c3+c4;

 if(document.forms[2].docURL=="[object]"){
  location.href='/wcw.nsf/subscribe?Openform&categoriesWeb=&referer='+document.forms[2].docURL.value;
  }else{
  //alert("Sub");
  }
   if(document.forms[1].docURL=="[object]"){
  location.href='/wcw.nsf/subscribe?Openform&categoriesWeb=&referer='+document.forms[1].docURL.value;
  }else{
  //alert("Sub1");
  }
   if(document.forms[0].docURL=="[object]"){
  location.href='/wcw.nsf/subscribe?Openform&categoriesWeb=&referer='+document.forms[0].docURL.value;
  }else{
  //alert("Sub0");
  }
}
//
function SubscribeDoc1() {
  location.href='/wcw.nsf/subscribe?Openform&categoriesWeb=';
}
//
function SubscribeDoc2() {
   window.open('http://phx.corporate-ir.net/phoenix.zhtml?c=129966&p=irol-alerts');
}
function SubscribeDoc22() {
   window.open('/wcw.nsf/subscribe?Openform&categoriesWeb=&referer=GlobalStartPage');
}
function SubscribeDoc3() {
   window.open('http://www.lawson.com/wwwjsp/submit_rfp.jsp');
}
function openGuideMe() {
//
window.open("http://www.intentia.com/www/profiles.nsf/CookieInfo?OpenForm","","height=400,width=600,left=0,top=0,toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no");
}
//
function openContactMe() {
  location.href='/wcw.nsf/Contact?OpenForm';
}
function openDisclaimer() {
  location.href='/wcw.nsf/Disclaimer?OpenForm';
}
function openStory(loc) {
var win;
win=window.open(loc,null,"height=400,width=600,left=0,top=0,directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=yes,toolbar=no,copyhistory=no",false);
    if(loc.indexOf('pdf')>0 ) {
        trackEvent(loc);
        //alert (loc);
       }
}
function trackEvent (URL) {
 dcsMultiTrack('DCS.dcsuri',URL);
}


// functions for CSM
//formName="PortalPage";
function allowFactSheet () {
  if (formName=="PortalPage") {
      return false;
  } else {
    if (area=="Services" || area=="Products") {
      return true;
    } else {
      return false;
    }
  }
}
//
function allowNetChangeReport () {
  if (formName=="PortalPage") {
      return false;
  } else {
    if (area=="Services" || area=="Products" || area=="Industry") {
      return true;
    } else {
      return false;
    }
  }
}
//
function allowAdditionalInfoP1 () {
	if (formName=="PortalPage") {
		if (area=="About Us" || area=="Investor Relations") {return false;} else {return true;}
	} else {
		if (formName=="") {	
			return false;
		} else {
			if (area=="Services" || area=="Customers" || area=="About Us" || area=="Investor Relations") {
				return false;
			} else {
				return true;
			}
		}
	}
}
//
function allowAdditionalInfoP2 () {
  if (formName=="PortalPage") {
    if (area=="Products" || area=="Industry" || area=="Services" || area=="News & Events" || area=="Customers") {
      return true;
    } else {
      return false;
    }
  } else { //form==Document
    if (area=="Industry" || area=="Investor Relations" || area=="News & Events") {
      return true;
    } else {
      return false;
    }
  }
}

//
function allowNews() {
//  if (area=="News & Events" || area=="") {
  if (area=="") {
    return false;
  } else {
    return true;
  }
}
//
function allowEvents() {
  if (formName=="Document") {
    return true;
  } else {
    if (area=="Event" || area=="About Us" || area=="Products" || area=="Industry" || area=="Investor Relations"  || area=="Services" || area=="Customers") {
      return true;
    } else {
      return false;
    }
  }
}
//
function allowSuccessStories() {
  return true;
}
//
function allowService() {
  if (area=="Products") {
    if (formName=="Document") {
      return true;
    } else {
      return false;    
    }
  } else {
    return false;
  }
}
//
function getLevel(l1, l2, l3, l4) {
var level;
  level=0;
  if (l4!="") {level=4;}
  if (l3!="" && level==0) {level=3;}
  if (l2!="" && level==0) {level=2;}
  if (l1!="" && level==0) {level=1;}
  return level;
}

DOM = (document.getElementById) ? true : false;
IE = (document.all) ? true : false;
IE4 = IE && !DOM;
NS4=(document.layers) ? true : false;
var frm;
  
function jsHideSummary() {
	if (DOM) {
		divColl = document.getElementsByTagName("DIV");
		for (i=0; i<divColl.length; i++) {
			if (divColl.item(i).className == "tool") {
				divColl.item(i).style.display="none";
				divColl.item(i).style.visibility="hidden";
			}
		}
	}

	if (IE4) {
		divColl = document.all.tags("DIV");
		for (i=0; i<divColl.length; i++) {
			if (divColl(i).className == "tool") {
				divColl(i).style.display="none";
			}
		}
	}
	//frm.ShowSummary[1].checked=true
	//frm.ShowSummary[1].click();
}



function jsShowSummary() {
		if (DOM) {
			divColl = document.getElementsByTagName("DIV");
			for (i=0; i<divColl.length; i++) {
				if (divColl.item(i).className == "tool") {
					divColl.item(i).style.display="block";
					divColl.item(i).style.visibility="visible";
				}
			}
		}

	if (IE4) {
		divColl = document.all.tags("DIV");
		for (i=0; i<divColl.length; i++) {
			if (divColl(i).className == "tool") {
				divColl(i).style.display="block";
			}
		}
	}
	//frm.ShowSummary[0].checked=true
	//frm.ShowSummary[0].click();
}

function jsHideLogin() {
	if (DOM) {
		divColl = document.getElementsByTagName("DIV");
		for (i=0; i<divColl.length; i++) {
			if (divColl.item(i).className == "TopMenu1") {
				divColl.item(i).style.display="none";
				divColl.item(i).style.visibility="hidden";
			}
		}
	}

	if (IE4) {
		divColl = document.all.tags("DIV");
		for (i=0; i<divColl.length; i++) {
			if (divColl(i).className == "TopMenu1") {
				divColl(i).style.display="none";
			}
		}
	}
	//frm.ShowSummary[1].checked=true
	//frm.ShowSummary[1].click();
}
// Poll
function vote(qid, vid) {
	var s=0;
	if (vid != '') {
		//alert(document.forms[0].pollNumber.value);
		msgWindow = window.open ('/PollData.nsf/Result?OpenForm&qid=' + qid+'&vid='+vid, 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		for(i=0;i<1000;i++) {
			for(j=0;j<1000;j++) {
				S=1;	
			}
		}
		msgWindow = window.open ('/PollData.nsf/Delay?OpenForm', 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		location.href='/WCW.nsf/pub/Mag_Index';
	}
}
// Poll
function checkVote(qid, vid) {
	var s=0; 
	var j=0;
	var allRadioSelected = true;
	var radParArr = vid.split('#');
	var checkedList='';
	for (i=0; i<radParArr.length; i++) {
	     radPar=radParArr[i].split('-');
		if (document.all(radPar[0]).checked || document.all(radPar[1]).checked) {
			if (allRadioSelected==true) {
				allRadioSelected=true;
				if (document.all(radPar[0]).checked) {
					checkedList+=radPar[0]+"-";
				} else {
					checkedList+=radPar[1]+"-";
				}
			}
		} else {
			allRadioSelected=false
		}
	}
	if (allRadioSelected==true)  {
		msgWindow = window.open ('/PollData.nsf/ResultMulti?OpenForm&qid=' + qid+'&vid='+checkedList, 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		for(i=0;i<1000;i++) {
			for(j=0;j<1000;j++) {
				S=1;	
			}
		}
		msgWindow = window.open ('/PollData.nsf/Delay?OpenForm', 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		location.href='/WCW.nsf/pub/Mag_Index';
	}
}
// Poll
function voteMulti(qid, vid) {
	var s=0;
	if (vid != '') {
		msgWindow = window.open ('/PollData.nsf/Result?OpenForm&qid=' + qid+'&vid='+vid, 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		for(i=0;i<1000;i++) {
			for(j=0;j<1000;j++) {
				S=1;	
			}
		}
		msgWindow = window.open ('/PollData.nsf/Delay?OpenForm', 'qWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,width=1,height=1');
		location.href='/WCW.nsf/pub/Mag_Index';
	}
}

function doCheckbd() {
	//Not possible to select both weekly and dayly
	var targetId, srcElement, targetElement,letters,outlineId, outlineElement, gifElement, clickedElement;
	var flag;
	var hitPos=-1;
	srcElement = window.event.srcElement;
	clickedElement=srcElement;
	 srcElement = srcElement.id;
	//srcElement = srcElement.substr(0, srcElement.length-2);
	outlineId=srcElement + "s";
	gifElement=srcElement + "i";
	//srcElement = srcElement + "bd";
	targetElement = document.all(targetId);
	outlineElement = document.all(outlineId);
	gifElement = document.all(gifElement);
	// if clicked element exists in dailyClicked then remove it, othewise add it
	flag=false;
	for (var m=0;  m < dailyClicked.length; m++) {
		if (dailyClicked[m]==srcElement) {
			flag=true;
			hitPos=m;
		}		
	}
	if (flag==true) {
		removeIdDaily(srcElement ,hitPos);
	} else {
		addIdDaily(srcElement);		
	}
	if (outlineElement != null) {
	         	if (outlineElement.style.display != "none") {
               		        outlineElement.style.display = "none"
		        gifElement.src = "/www/Resource.nsf/pub/expand.gif/$FILE/expand.gif";
               		}
	}
}



