/* Autodisk javascript 
 *
 *
 */


function open_windowfoto(url) {
email = window.open(url,"kazaap","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,left=1,top=1,x=1,y=1,width=820,height=620");
}

function open_windowemail(url) {
email = window.open(url,"kazaap","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,left=1,top=1,x=1,y=1,width=700,height=320");
}
function open_windowemailFF(url) {
email = window.open(url,"kazaap","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,left=1,top=1,x=1,y=1,width=700,height=350");
}
function open_windowofferte(url) {
email = window.open(url,"kazaap","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,left=1,top=1,x=1,y=1,width=800,height=600");
}

    
        function checkNumeric(textValue)

        
        {
        
        var lenStr;
        
        entry = textValue.value;
        pattern = /[^0-9]/g;
        if (entry.match(pattern))
        {
        lenStr = textValue.value.length;
        textValue.value = Left(textValue.value, Number(lenStr) - 1);
        }
        }
        
        function Left(str, n){
            if (n <= 0)
                return "";
            else if (n > String(str).length)
                return str;
            else
                return String(str).substring(0,n);
        }
        function Right(str, n){
            if (n <= 0)
               return "";
            else if (n > String(str).length)
               return str;
            else {
               var iLen = String(str).length;
               return String(str).substring(iLen, iLen - n);
            }
        }        
    
        function checkString(textValue)

        {
        
        var lenStr;
        
        entry = textValue.value;
        pattern = /[^a-z;A-Z; +.]/g;
        if (entry.match(pattern))
        {
        lenStr = textValue.value.length;
        textValue.value = Left(textValue.value, Number(lenStr) - 1);
        }
        }
        
        function Left(str, n){
            if (n <= 0)
                return "";
            else if (n > String(str).length)
                return str;
            else
                return String(str).substring(0,n);
        }
        function Right(str, n){
            if (n <= 0)
               return "";
            else if (n > String(str).length)
               return str;
            else {
               var iLen = String(str).length;
               return String(str).substring(iLen, iLen - n);
            }
        }        
	
/*
Find In Page Script- 
*/

var NS4 = (document.layers);    // Which browser?
var IE4 = (document.all);

var win = window;    // window to search.
var n   = 0;

function findInPage(str) {

  var txt, i, found;

  if (str == "")
    return false;

  // Find next occurance of the given string on the page, wrap around to the
  // start of the page if necessary.

  if (NS4) {

    // Look for match starting at the current point. If not found, rewind
    // back to the first match.

    if (!win.find(str))
      while(win.find(str, false, true))
        n++;
    else
      n++;

    // If not found in either direction, give message.

    if (n == 0)
      alert("Kon uw zoekterm niet vinden!");
  }

  if (IE4) {
    txt = win.document.body.createTextRange();

    // Find the nth match from the top of the page.

    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }

    // If found, mark it and scroll it into view.

    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    }

    // Otherwise, start over at the top of the page and find first match.

    else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      }

      // Not found anywhere, give message.

      else
        alert("Kon uw zoekterm niet vinden!");
    }
  }

  return false;
}

// quick browser tests
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;

function show(sw,obj) {
  // show/hide the divisions
  if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible';
  if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden';
  if (sw && ns4) document.layers[obj].visibility = 'visible';
  if (!sw && ns4) document.layers[obj].visibility = 'hidden';
}

function calculate(checky) {

    if(checky.checked){ 
        document.getElementById('txtCOA').value = Number(document.getElementById('txtCOA').value)+1;
    }else{ 
        document.getElementById('txtCOA').value = Number(document.getElementById('txtCOA').value)-1;
    } 
    
    //check
    if (Number(document.getElementById('txtCOA').value) == Number(document.getElementById('txtV').value)) {
        show(false,'divopnieuw');
    } else {
        show(true,'divopnieuw');
    }

    
}

function ShowHiddenDiv() {

     //document.getElementById('hiddendiv').visibility = 'visible';
     show(true,'hiddendiv');
    
}