function showTopMenu (item, xOffset, yOffset) {
  if (navigator.appName == "Netscape") {
//    item.style.visibility="show";
//    item.style.posLeft=front.offsetWidth+flexible.offsetWidth+curve.offsetWidth+xOffset;
//    item.style.posTop=yOffset+3;
  } else {
    item.style.visibility="visible";
    item.style.posLeft=front.offsetWidth+flexible.offsetWidth+curve.offsetWidth+xOffset;
    item.style.posTop=yOffset+3;
  }
  return;
}

function DeleteIncidentChart(chartID)
{

var deleteIt = confirm("Are you sure you want to delete this Chart?")
if( deleteIt == true)
{
	 window.location='/mykeal/en/employee/gm/chart/deleteChart.asp?chartID=' + chartID 
}
}

function showLocalMenu (item, xOffset, yOffset) {
  if (navigator.appName == "Netscape") {
//    item.style.visibility="show";
//    item.style.posLeft=front.offsetWidth+flexible.offsetWidth+curve.offsetWidth+xOffset;
//    item.style.posTop=yOffset+3;
  } else {
    item.style.visibility="visible";
    item.style.posLeft=xOffset;
    item.style.posTop=front.offsetHeight+yOffset+5;
  }
  return;
}

function hideMenu (item) {
  if (navigator.appName == "Netscape") {
//    item.style.visibility="hide";
  } else {
	
    item.style.visibility="hidden";
  }
  return;
}

function MM_findObj(n, d) { //v3.0
  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);

  return x;
}

function tmt_findObj(n){
  var x,t; 

  if((n.indexOf("?"))>0&&parent.frames.length) {
    t=n.split("?");
    x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
  }
  else {
    x=document.getElementById(n)
  }
  return x;
}

function MM_showHideTopLayers() {
  //v3.0B => Modified v3.0A by Steven Choi (www.keal.com) for position capability
  //         Specifically modified for this website
  //v3.0A was Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  //taken from www.teamphotoshop.com
  
  //the modified version can be used as follows
  //MM_showHideTopLayers('object name', 'this id name', 'show or hide')
  var i,p,v,obj1,obj2,args=MM_showHideTopLayers.arguments;
  var objFront, objFlex, objCurve;

  if(document.getElementById){
    objFront=tmt_findObj('front');
    objFlex=tmt_findObj('flexible');
    objCurve=tmt_findObj('curve');

    for (i=0; i<(args.length-2); i+=3) { 
      obj1=tmt_findObj(args[i]);
      obj2=tmt_findObj(args[i+1]);
      v=args[i+2];
      if (v=='show') 
        v="visible";
      else if (v=='hide')
        v="hidden";
      if(obj1!=null) {
        obj1.style.visibility=v;
        if (navigator.appName=="Microsoft Internet Explorer") {
          obj1.style.left=objFront.offsetWidth+objFlex.offsetWidth+objCurve.offsetWidth+obj2.offsetLeft;
        }
        else if (navigator.appName=="Netscape") {
          obj1.style.left=obj2.offsetLeft;
        }
        obj1.style.top=obj2.offsetHeight+3;
      }
    }
  } 
  else {
    objFront=MM_findObj('front');
    objFlex=MM_findObj('flexible');
    objCurve=MM_findObj('curve');

    for (i=0; i<(args.length-2); i+=3) {
      obj1=MM_findObj(args[i]);
      obj2=MM_findObj(args[i+1]);

      if (obj1!=null) {
        v=args[i+2];
        v=(v=='show')?'visible':(v=='hide')?'hidden':v;
        obj1.visibility=v;
        obj1.left=objFront.offsetWidth+objFlex.offsetWidth+objCurve.offsetWidth+obj2.offsetLeft;
        obj1.top=obj2.offsetHeight+3;
      }
    }
  }
}

function MM_showHideLocalLayers() {
  //v3.0B => Modified v3.0A by Steven Choi (www.keal.com) for position capability
  //         Specifically designed for this website
  //v3.0A was Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  //taken from www.teamphotoshop.com
  
  //the modified version can be used as follows
  //MM_showHideTopLayers('object name', 'this id name', 'show or hide')
  var i,p,v,obj1,obj2,args=MM_showHideLocalLayers.arguments;
  var objFront, objFlex, objCurve;

  if(document.getElementById){
    objFront=tmt_findObj('front');
    objFlex=tmt_findObj('flexible');
    objCurve=tmt_findObj('curve');

    for (i=0; i<(args.length-2); i+=3) { 
      obj1=tmt_findObj(args[i]);
      obj2=tmt_findObj(args[i+1]);
      v=args[i+2];
      if (v=='show') 
        v="visible";
      else if (v=='hide')
        v="hidden";
      if(obj1!=null) {
        obj1.style.visibility=v;
        obj1.style.left=obj2.offsetLeft;
        if (navigator.appName=="Microsoft Internet Explorer") {
          obj1.style.top=objFront.offsetHeight+obj2.offsetHeight+5;
        }
        else if (navigator.appName=="Netscape") {
          obj1.style.top=objFront.offsetHeight+obj2.offsetHeight+1;
        }
      }
    }
  } 
  else {
    objFront=MM_findObj('front');
    objFlex=MM_findObj('flexible');
    objCurve=MM_findObj('curve');

    for (i=0; i<(args.length-2); i+=3) {
      obj1=MM_findObj(args[i]);
      obj2=MM_findObj(args[i+1]);

      if (obj1!=null) {
        v=args[i+2];
        v=(v=='show')?'visible':(v=='hide')?'hidden':v;
        obj1.visibility=v;
        obj1.left=objFront.offsetWidth+objFlex.offsetWidth+objCurve.offsetWidth+obj2.offsetLeft;
        obj1.top=obj2.offsetHeight+3;
      }
    }
  }
}

function dummy() {
  return;
}


function clearAllMenu(exception, topFolders, localFolders){
if (navigator.appName == "Netscape") {
  for (i=1; i<=topFolders; i+=1) {  
  if (exception!==i) 
    MM_showHideTopLayers('dropTopMenu'+i, 'top'+i, 'hide');
  }

  for (i=1; i<=localFolders; i+=1) {  
  if (exception!==(i+3)) 
    MM_showHideLocalLayers('dropLocalMenu'+i, 'local'+i, 'hide'); 
  }

} 
else {
  for (i=1; i<=topFolders; i+=1) {  
  if (exception!==i) 
    hideMenu(eval("document.all.dropTopMenu"+i));
  }

  for (i=1; i<=localFolders; i+=1) {  
  if (exception!==(i+3)) 
    hideMenu(eval("document.all.dropLocalMenu"+i));
  }

}

}

function resize() {
  location.reload();
}

function checkSubmit(form) {
  formComponent=form.elements['searchString']; //here the formComponent represents the text field
  st=formComponent.value;

    if(st==""){
      alert("Search string is empty!  Please resubmit");
      formComponent.focus();
      return false;
    }
      else { 
      return true;
    }
}

function checkCookie(login) {
  if (navigator.cookieEnabled==false) {
    alert("Your Cookies are DISABLED! Login REQUIRES cookies!");
    document.login.focus();
    return false;
  }
  else {
    return true;
  }
}

function productLoadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/productButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/productButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/productButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/productButtonDown2.gif";

  }
}

function supportLoadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/supportButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/supportButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/supportButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/supportButtonDown2.gif";

  }
  else if (noButton==3) {
    if (status==1)
      document.button3.src="/images/supportButtonUp3.gif";
    else if (status==0)
      document.button3.src="/images/supportButtonDown3.gif";
  }
}

function loadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/memberButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/memberButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/memberButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/memberButtonDown2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.button3.src="/images/memberButtonUp3.gif";
    else if (status==0)
      document.button3.src="/images/memberButtonDown3.gif";
  }
  else if (noButton==4) {
    if (status==1)
      document.button4.src="/images/memberButtonUp4.gif";
    else if (status==0)
      document.button4.src="/images/memberButtonDown4.gif";
  }
  else if (noButton==5) {
    if (status==1)
      document.button5.src="/images/memberButtonUp5.gif";
    else if (status==0)
      document.button5.src="/images/memberButtonDown5.gif";
  }
  else if (noButton==6) {
    if (status==1)
      document.button6.src="/images/memberButtonUp6.gif";
    else if (status==0)
      document.button6.src="/images/memberButtonDown6.gif";
  }

}

function employeeLoadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/memberButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/memberButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/employeeButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/employeeButtonDown2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.button3.src="/images/employeeButtonUp3.gif";
    else if (status==0)
      document.button3.src="/images/employeeButtonDown3.gif";
  }
  else if (noButton==4) {
    if (status==1)
      document.button4.src="/images/employeeButtonUp4.gif";
    else if (status==0)
      document.button4.src="/images/employeeButtonDown4.gif";
  }
  else if (noButton==5) {
    if (status==1)
      document.button5.src="/images/employeeButtonUp5.gif";
    else if (status==0)
      document.button5.src="/images/employeeButtonDown5.gif";
  }
  else if (noButton==6) {
    if (status==1)
      document.button6.src="/images/employeeButtonUp6.gif";
    else if (status==0)
      document.button6.src="/images/employeeButtonDown6.gif";
  }
  else if (noButton==7) {
    if (status==1)
      document.button7.src="/images/employeeButtonUp7.gif";
    else if (status==0)
      document.button7.src="/images/employeeButtonDown7.gif";
  }
  else if (noButton==8) {
    if (status==1)
      document.button8.src="/images/employeeButtonUp8.gif";
    else if (status==0)
      document.button8.src="/images/employeeButtonDown8.gif";
  }
}

function employeeLoadButtonfr(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.buttonfr1.src="/images/employeeButtonUpfr1.gif";
    else if (status==0)
      document.buttonfr1.src="/images/employeeButtonDownfr1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.buttonfr2.src="/images/employeeButtonUpfr2.gif";
    else if (status==0)
      document.buttonfr2.src="/images/employeeButtonDownfr2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.buttonfr3.src="/images/employeeButtonUpfr3.gif";
    else if (status==0)
      document.buttonfr3.src="/images/employeeButtonDownfr3.gif";
  }
}

function clientLoadButtonfr(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.buttonfr1.src="/images/clientButtonUpfr1.gif";
    else if (status==0)
      document.buttonfr1.src="/images/clientButtonDownfr1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.buttonfr2.src="/images/clientButtonUpfr2.gif";
    else if (status==0)
      document.buttonfr2.src="/images/clientButtonDownfr2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.buttonfr3.src="/images/clientButtonUpfr3.gif";
    else if (status==0)
      document.buttonfr3.src="/images/clientButtonDownfr3.gif";
  }
}

function userLoadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/userButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/userButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/userButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/userButtonDown2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.button3.src="/images/userButtonUp3.gif";
    else if (status==0)
      document.button3.src="/images/userButtonDown3.gif";
  }
  else if (noButton==4) {
    if (status==1)
      document.button4.src="/images/userButtonUp4.gif";
    else if (status==0)
      document.button4.src="/images/userButtonDown4.gif";
  }
}

function updateLoadButton(noButton, status) {
  if (noButton==1) {
    if (status==1)
      document.button1.src="/images/updateButtonUp1.gif";
    else if (status==0)
      document.button1.src="/images/updateButtonDown1.gif";
  }
  else if (noButton==2) {
    if (status==1)
      document.button2.src="/images/updateButtonUp2.gif";
    else if (status==0)
      document.button2.src="/images/updateButtonDown2.gif";
  }
  else if (noButton==3) {
    if (status==1)
      document.button3.src="/images/updateButtonUp3.gif";
    else if (status==0)
      document.button3.src="/images/updateButtonDown3.gif";
  }
  else if (noButton==4) {
    if (status==1)
      document.button4.src="/images/updateButtonUp4.gif";
    else if (status==0)
      document.button4.src="/images/updateButtonDown4.gif";
  }
  else if (noButton==5) {
    if (status==1)
      document.button5.src="/images/updateButtonUp5.gif";
    else if (status==0)
      document.button5.src="/images/updateButtonDown5.gif";
  }
}

function signUpComplete() {
  var congratWindow;

  congratWindow=window.open("","popUp1",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400');
  congratWindow.document.write("<html><title>Registration COMPLETE!</title>");
  congratWindow.document.write("<body>");
  congratWindow.document.write("<img src='/images/dot.gif' height=1 width=100><img src='/images/keallogo.gif' height=64 width=163><br>");
  congratWindow.document.write("<font face=verdana size=2>Welcome New Member!</font><br>");
  congratWindow.document.write("<p><font face=verdana size=2>By becoming a Keal member you now have access to ");
  congratWindow.document.write("Keal Support Staff ONLINE!! ");
  congratWindow.document.write("Look at some of these benefits");
  congratWindow.document.write("<LI>Post Questions</LI>");
  congratWindow.document.write("<LI>Request for Product Enhancements</LI>");
  congratWindow.document.write("<LI>Request for Personal Assistance</LI><br><br>");
  congratWindow.document.write("And the list just goes on!!</p><br><br>");
  congratWindow.document.write("<a href='javascript:window.close();'>Close this Window</a> and Continue with your Login!");
  congratWindow.document.write("</body></html>");
  return;
}

function empSignUpComplete() {
  var congratWindow;

  congratWindow=window.open("","popUp2",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400');
  congratWindow.document.write("<html><title>Registration COMPLETE!</title>");
  congratWindow.document.write("<body>");
  congratWindow.document.write("<img src='/images/dot.gif' height=1 width=100><img src='/images/keallogo.gif' height=64 width=163><br>");
  congratWindow.document.write("<font face=verdana size=2>Welcome Registered Employee!</font><br>");
  congratWindow.document.write("<p><font face=verdana size=2>BLAH BLAH BLAH");
  congratWindow.document.write("BLAH BLAH BLAH");
  congratWindow.document.write("BLAH BLAH BLAH");
  congratWindow.document.write("<LI>BLAH</LI>");
  congratWindow.document.write("<LI>BLAH BLAH</LI>");
  congratWindow.document.write("<LI>BLAH BLAH BLAH</LI><br><br>");
  congratWindow.document.write("BLAH BLAH BLAH !!!!!!</p><br><br>");
  congratWindow.document.write("<a href='javascript:window.close();'>Close this Window</a> and Continue with your Login!");
  congratWindow.document.write("</body></html>");
  return;
}

function expandStatus(choice, pid) {
  var statusWindow;

  statusWindow=window.open("/script/displayMsg.asp?id="+pid+"&type=2","popUp3",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400');

  return;
}

function expandSuggestion(choice, pid) {
  var suggestionWindow;

  statusWindow=window.open("/script/displayMsg.asp?id="+pid+"&type=1","popUp4",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400');
  return;
}

function confirmDelete(formAction) {
  var result=new Array(5);
  var checkMark=false;

  var count=formAction.elements['counter'].value;

  if (count>=1) {
    result[0]=formAction.elements['box1'].checked;
    if (result[0]==true) 
      checkMark=true;
  }

  if (count>=2) {
    result[1]=formAction.elements['box2'].checked;
    if (result[1]==true) 
      checkMark=true;
  }

  if (count>=3) {
    result[2]=formAction.elements['box3'].checked;
    if (result[2]==true) 
      checkMark=true;
  }

  if (count>=4) {
    result[3]=formAction.elements['box4'].checked;
    if (result[3]==true) 
      checkMark=true;
  }

  if (count>=5) {
    result[4]=formAction.elements['box5'].checked;
    if (result[4]==true) 
      checkMark=true;
  }


  if (checkMark==false) {
    if (confirm("No check marks! Continue modification??")==false)  
      return false;
    else
      return true;
  }
  else {
    if (confirm("Are you SURE to delete??")==false)
      return false;
    else
      return true;
  }
}

function checkThis() {
  if (update.show.checked==true) {
    update.reset();
    update.show.checked=true;
  }
  return;
}

function checkPoll(update) {
  var question=update.elements['question'].value;
  var choice1=update.elements['choice1'].value;
  var choice2=update.elements['choice2'].value;
  var choice3=update.elements['choice3'].value;
  var choice4=update.elements['choice4'].value;
  var valid=true;

  if (question.length==0) {
    valid=false;
  }
  else if (question.length>100) {
    valid=false;
  }

  if (choice1.length==0) {
    valid=false;
  }

  if (choice2.length==0) {
    valid=false;
  }

  if (valid==false) 
    alert ("INVALID Entry! Please Retry!");

  return valid;
}

function tallyPoll(choice) {
  var resultWindow;
  var pollChoice=choice.elements['survey'];
  var counter=choice.elements['counter'].value;
  var gotVote=new Array(4);
  var userChoice;
  var checked=0;
  var index=0;

  gotVote[0]=pollChoice[0].checked;
  gotVote[1]=pollChoice[1].checked;
  if (counter>=3)
    gotVote[2]=pollChoice[2].checked;
  if (counter>=4)
    gotVote[3]=pollChoice[3].checked;

  if (gotVote[0]==true) {
    checked++;
    userChoice=1;
  }
  else if (gotVote[1]==true) {
    checked++;
    userChoice=2;
  }
  else if (gotVote[2]==true) {
    checked++;
    userChoice=3;
  }
  else if (gotVote[3]==true) {
    checked++;
    userChoice=4;
  }
  if(document.cookie) 
    {index = document.cookie.indexOf("votes");
  }
  else { index = -1;}

  if (checked>0) {
  //cookie doesn't exist  
    if (index == -1)
       {setCookieForDays("votes","true", 1);
        resultWindow=window.open("surveyResult.asp?choice="+userChoice,"popUp5",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=250,height=300');
       }
    else {alert ("Thank you, Keal has already processed your vote");}       
  }
  else
    alert("Please Select One Option"); 

  return false;
}

function populateResult() {
  var resultWindow;

  resultWindow=window.open("surveyResult.asp?choice=result","popUp6",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=250,height=300');

  return;
}

function serviceCall() {
  var resultWindow;

  resultWindow=window.open("serviceCall.htm","popUp7",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400');

  return;
}

function buyHardware() {
  var resultWindow;

  resultWindow=window.open("buyHardware.htm","popUp8",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400');

  return;
}

function buyConsumable() {
  var resultWindow;

  resultWindow=window.open("buyConsumable.htm","popUp9",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400');

  return;
}

function OrderDemo() {
  var resultWindow;

  resultWindow=window.open("OrderDemo.htm","popUp10",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400');

  return;
}

function checkRNews(update) {
  var header=update.elements['header'].value;
  var summary=update.elements['summary'].value;
  var link=update.elements['link'].value
  var valid=true;

  if (summary.length>100) {
    valid=false;
  }

  if (header.length==0) {
    valid=false;
  }

  if (link.length==0)
    valid=false;

  if (valid==false) 
    alert ("INVALID Entry! Please Retry!");

  return valid;
}

function confirmRNewsDelete(formAction) {
  var result=new Array(10);
  var checkMark=false

  var count=formAction.elements['counter'].value;

  if (count>=1) {
    result[0]=formAction.elements['RNews10'].checked;
    if (result[0]==true)
      checkMark=true;
  }

  if (count>=2) {
    result[1]=formAction.elements['RNews9'].checked;
    if (result[1]==true)
      checkMark=true;
  }

  if (count>=3) {
    result[2]=formAction.elements['RNews8'].checked;
    if (result[2]==true)
      checkMark=true;
  }

  if (count>=4) {
    result[3]=formAction.elements['RNews7'].checked;
    if (result[3]==true)
      checkMark=true;
  }

  if (count>=5) {
    result[4]=formAction.elements['RNews6'].checked;
    if (result[4]==true)
      checkMark=true;
  }

  if (count>=6) {
    result[5]=formAction.elements['RNews5'].checked;
    if (result[5]==true)
      checkMark=true;
  }

  if (count>=7) {
    result[6]=formAction.elements['RNews4'].checked;
    if (result[6]==true)
      checkMark=true;
  }

  if (count>=8) {
    result[7]=formAction.elements['RNews3'].checked;
    if (result[7]==true)
      checkMark=true;
  }

  if (count>=9) {
    result[8]=formAction.elements['RNews2'].checked;
    if (result[8]==true)
      checkMark=true;
  }

  if (count>=10) {
    result[9]=formAction.elements['RNews1'].checked;
    if (result[9]==true)
      checkMark=true;
  }

  if (checkMark==false) {
    alert("No check marks!!");  
    return false;
  }
  else {
    if (confirm("Are you SURE??")==false)
      return false;
    else
      return true;
  }
}

function confirmSugDelete(formAction) {
  var result=new Array(10);
  var checkMark=false;

  var count=formAction.elements['count'].value;

  if (count>=1) {
    result[0]=formAction.elements['box1'].checked;
    if (result[0]==true)
      checkMark=true;
  }

  if (count>=2) {
    result[1]=formAction.elements['box2'].checked;
    if (result[1]==true)
      checkMark=true;
  }

  if (count>=3) {
    result[2]=formAction.elements['box3'].checked;
    if (result[2]==true)
      checkMark=true;
  }

  if (count>=4) {
    result[3]=formAction.elements['box4'].checked;
    if (result[3]==true)
      checkMark=true;
  }

  if (count>=5) {
    result[4]=formAction.elements['box5'].checked;
    if (result[4]==true)
      checkMark=true;
  }

  if (count>=6) {
    result[5]=formAction.elements['box6'].checked;
    if (result[5]==true)
      checkMark=true;
  }

  if (count>=7) {
    result[6]=formAction.elements['box7'].checked;
    if (result[6]==true)
      checkMark=true;
  }

  if (count>=8) {
    result[7]=formAction.elements['box8'].checked;
    if (result[7]==true)
      checkMark=true;
  }

  if (count>=9) {
    result[8]=formAction.elements['box9'].checked;
    if (result[8]==true)
      checkMark=true;
  }

  if (count>=10) {
    result[9]=formAction.elements['box10'].checked;
    if (result[9]==true)
      checkMark=true;
  }

  if (checkMark==false) {
    alert("No check marks!!");  
    return false;
  }
  else {
    if (confirm("Are you SURE??")==false)
      return false;
    else
      return true;
  }
}

function checkEditEnh(formAction) {
  var result=new Array(10);
  var checkMark=false;

  var count=formAction.elements['count'].value;

  if (count>=1) {
    result[0]=formAction.elements['box1'].checked;
    if (result[0]==true)
      checkMark=true;
  }

  if (count>=2) {
    result[1]=formAction.elements['box2'].checked;
    if (result[1]==true)
      checkMark=true;
  }

  if (count>=3) {
    result[2]=formAction.elements['box3'].checked;
    if (result[2]==true)
      checkMark=true;
  }

  if (count>=4) {
    result[3]=formAction.elements['box4'].checked;
    if (result[3]==true)
      checkMark=true;
  }

  if (count>=5) {
    result[4]=formAction.elements['box5'].checked;
    if (result[4]==true)
      checkMark=true;
  }

  if (count>=6) {
    result[5]=formAction.elements['box6'].checked;
    if (result[5]==true)
      checkMark=true;
  }

  if (count>=7) {
    result[6]=formAction.elements['box7'].checked;
    if (result[6]==true)
      checkMark=true;
  }

  if (count>=8) {
    result[7]=formAction.elements['box8'].checked;
    if (result[7]==true)
      checkMark=true;
  }

  if (count>=9) {
    result[8]=formAction.elements['box9'].checked;
    if (result[8]==true)
      checkMark=true;
  }

  if (count>=10) {
    result[9]=formAction.elements['box10'].checked;
    if (result[9]==true)
      checkMark=true;
  }

  if (checkMark==false) {
    alert("No check marks!!");  
    return false;
  }
  else {
    return true;
  }
}

function confirmNewsArchive(formAction){
  var checkMark=false
for(var k=0;k<document.choice.elements.length;k++)
{
   if (document.choice.elements[k].checked==true)
   {
      checkMark=true;
   }
}
  if (checkMark==false) {
    alert("Cannot submit request, unchecked items!! ");  
    return false;
  }
  else {
    if (confirm("Are you SURE??")==false)
      return false;
    else
      return true;
  }

}

function checkWNews(update) {
  var header=update.elements['header'].value;
  var summary=update.elements['summary'].value;
  var link=update.elements['link'].value
  var valid=true;

  if (summary.length >=200) {
    valid=false;
  }

  if (header.length==0) {
    valid=false;
  }

  if (link.length==0)
    valid=false;

  if (valid==false) 
    alert ("INVALID Entry! Please Retry!");

  return valid;
}


function turn(item, status) {
  if (status=="on") {
    item.style.border="1pt solid black";
  }
  else if (status=="off") {
    item.style.border="none";
  }
}

function getCookie(Name) {
  var search = Name + "="
   
  if (document.cookie.length > 0) { 
    // if there are any cookies      
    offset = document.cookie.indexOf(search)       
    if (offset != -1) { 
      // if cookie exists          
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset)
      // set index of end of cookie value
      if (end == -1)
        end = document.cookie.length
      return unescape(document.cookie.substring(offset, end))
    }
  }
}


function setCookie(name, value, expire) {
  document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
  return;
}

function setCookieForDays(name, value, noOfday) {
  var expires = new Date();
  var today = new Date();
  expires.setTime(today.getTime() + noOfday*24*1000*60*60);  //set for noOfday day
  setCookie(name, value, expires);

  return;
}

function setCookieForDay(value, noOfday) {
  var expires = new Date();
  var today = new Date()
  expires.setTime(today.getTime() + noOfday*24*1000*60*60);  //set for noOfday day
  setCookie("survey6", value, expires);

  return;
}

function DeleteCookie (name) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function surveyDone() {
  var siteOrigin="";

  siteOrigin=getCookie("survey6");

  if (siteOrigin=="Done") 
    return true;
  else
    return false;
}

function surveyAsk(lang) {
  var resultWindow;
  var blnQuestion
  

  var surveyCompleted=surveyDone();

  if (surveyCompleted==false) {
    if (lang==0) {
		blnQuestion=confirm("Complétez le sondage client de Keal à l'adresse www.keal.com et vous pourriez vous mériter une caméra digitale HP Photosmart démo !!");


		if (blnQuestion==true) {
		resultWindow=window.open("/fr/survey.htm","popUp6",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1, width=800');    
		}
		else {
		setCookieForDay("Done", 1);
		}

	}
	else {
		blnQuestion=confirm("Complete Keal's Client Survey at www.keal.com and you could win an HP Photosmart digital camera (demo model) !!");

		if (blnQuestion==true) {
		resultWindow=window.open("/en/survey.htm","popUp6",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1, width=800');    
		}
		else {
		setCookieForDay("Done", 1);
		}
	}
	
  }

  return;
}

function expandOrCollapse(list, heading) {
  if ((list.className=='tocList')&&(heading.className=='tocHeading')) {  
    list.className='tocListShow';
    heading.className='tocHeadingShow';
  }
  else if ((list.className=='tocListShow')&&(heading.className=='tocHeadingShow')) {
    list.className='tocList';
    heading.className='tocHeading';
  }
}

function expandALL(toc) {
  var count;
  var count2;

  for (count=0; count<toc.children.length; count++) {
    for (count2=0; count2<toc.children(count).children.length; count2++) {
      if ((toc.children(count).children(count2).className!='tocNoexpand')&&(toc.children(count).children(count2).className!='')) {
        toc.children(count).children(count2).className='tocListShow';
      }
    }
    if (toc.children(count).className!='tocNoexpand') {
      toc.children(count).className='tocHeadingShow';
    }
  }
}

function collapseALL(toc) {
  var count;
  var count2;

  for (count=0; count<toc.children.length; count++) {
    for (count2=0; count2<toc.children(count).children.length; count2++) {
      if ((toc.children(count).children(count2).className!='tocNoexpand')&&(toc.children(count).children(count2).className!='')) {
        toc.children(count).children(count2).className='tocList';
      }
    }
    if (toc.children(count).className!='tocNoexpand') {
      toc.children(count).className='tocHeading';
    }
  }
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}


function VerifyIsNum(value)
{
   //strip format characters($%-,) from input
   value = value.toString().replace(/\$,/g,'');

   //strip any spaces from input ex: " 50" still == 50 as well as "  50"
   value = value.substring(value.indexOf(" "));
   if ((isNaN(value)) || (value == "") )
      return (false);
   else{
      return (true);}
} 

function VerifyDecimalPlaces(value)
{
   dec = value.indexOf(".");
   // check if decimal place exists
   if (dec== -1)
      return true;
   else
      {
      //Check if more than two decimal places
      decString = value.substring(dec + 1)
      if (decString.length > 2)
      return false;
      else
      return true;
      }
}

//  Form to add or modify keal products (ChangeProductDatabase/ProcessProductDatabase) in both Fr & En

function fldEmpty(form)
{

   if ((form.elements[0].value == "") && (form.elements[1].value == "") && (form.elements[2].value == "") && (form.elements[3].value == "") && (form.elements[4].value == "") && (form.elements[5].value == "") && (form.elements[6].value == ""))
     {
     alert ("Please fill in at least one field!");
     return false;
     }
   else
     {
	if (VerifyIsNum(form.Unit_Price.value)) 

	   if (VerifyDecimalPlaces(form.Unit_Price.value))
              return true;
           else{
              alert ("Two decimal places please for the Unit Price field");
              return false;
	      }
        else
        {
        alert ("Please fill in the Unit Price field again!");
        return false;
        }
     }
}

function VerifyChkBoxTblSelected(form){
 
var total = 0;
var max = form.Tbl.length;

for (var idx = 0; idx < max; idx++) {
      if (form.Tbl[idx].checked)
        total += 1;
}

if (total == 0)
   {
   alert ("You haven't selected any boxes");
   return false;
   }
return true;


}


function registerBrokerTechnologySummit() {
  var resultWindow;

  resultWindow=window.open("registerBrokerSummit.htm","popUp8",'width=470,height=500,top=25, left=150, scrollbars=0, toolbar=0,location=0 directories=0,status=0,menubar=0,resizable=0');

  return;
}

function ApplyCSR_Concord() {
  var resultWindow;

  resultWindow=window.open("ApplyCSR_Concord.htm","popUp11",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');

  return;
}
function doLogin()
{
if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
	document.MyKealLogin.submit();return false;
}
else
{
return true;
}
}
        
