function setDiv() {
  var wh = "426" // Window <strong class="highlight">Height</strong>
  var d = document.getElementById('content2') // Get <strong class="highlight">div</strong> element
  var dh = d.offsetHeight // <strong class="highlight">div</strong> <strong class="highlight">height</strong>
  if (dh < wh)
  d.style.height = wh + 'px'; // Set minimum div height to window height 
}

function setDiv1() {
  var wh = "235" // Window <strong class="highlight">Height</strong>
  var d = document.getElementById('content') // Get <strong class="highlight">div</strong> element
  var dh = d.offsetHeight // <strong class="highlight">div</strong> <strong class="highlight">height</strong>
  if (dh < wh)
  d.style.height = wh + 'px'; // Set minimum div height to window height 
}

function setDiv2() {
  var wh = "520" // Window <strong class="highlight">Height</strong>
  var d = document.getElementById('content2') // Get <strong class="highlight">div</strong> element
  var dh = d.offsetHeight // <strong class="highlight">div</strong> <strong class="highlight">height</strong>
  if (dh < wh)
  d.style.height = wh + 'px'; // Set minimum div height to window height 
}


function getWindowHeight() {
  var windowHeight = 0;
	
  if (typeof(window.innerHeight) == 'number')
	windowHeight = window.innerHeight;
	
  else {
		
	if (document.documentElement && document.documentElement.clientHeight)
	  windowHeight = document.documentElement.clientHeight;
		
	else {
	  if (document.body && document.body.clientHeight)
		windowHeight = document.body.clientHeight; }; };
				
  return windowHeight;
};

function showdiv(id) {
  var div = document.getElementById(id);
  div.style.display = "block";
}

function hidediv(id) {
  var div = document.getElementById(id);
  div.style.display = "none";
}

function kH(e) {
var pK = e ? e.which : window.event.keyCode;
return pK != 13;
}

function blockenter(id) {
  var textarea = document.getElementById(id);
  textarea.onkeypress = kH;
  if (textarea.layers) textarea.captureEvents(Event.KEYPRESS);
}

      function incyear() {
        var startid = document.getElementById('start');
        var endid   = document.getElementById('end'); 
        var show_start_value = startid.value; 
        var show_end_value   = endid.value; 
        var hide_start_value = parseInt(startid.value) - 10; 
        var hide_end_value   = parseInt(endid.value) - 10; 
 
        if (show_end_value <= 32) {  

        for(i=hide_start_value; i<hide_end_value; i++) {
          var span = document.getElementById(i);
          if (span != null) {
            span.style.display="none";
          }
        }
       
        for(i=show_start_value; i<show_end_value; i++) {
          var span = document.getElementById(i);
          if (span != null) {
            span.style.display="inline";
          } 
        }

        startid.value = parseInt(show_start_value) + 10;
        endid.value = parseInt(show_end_value) + 10;
        
        }
      }

      function decyear() {
        var startid = document.getElementById('start');
        var endid   = document.getElementById('end'); 
        var hide_start_value = parseInt(startid.value) - 10; 
        var hide_end_value   = parseInt(endid.value) - 10; 
        var show_start_value = parseInt(startid.value) - 20; 
        var show_end_value   = parseInt(endid.value) - 20; 

        if (hide_start_value >= 11) {  

          for(i=hide_start_value; i<hide_end_value; i++) {
            var span = document.getElementById(i);
            if (span != null) {
             span.style.display="none";
            } 
          }
       
          for(i=show_start_value; i<show_end_value; i++) {
            var span = document.getElementById(i);
            if (span != null) {
              span.style.display="inline";
            }
          }

          startid.value = parseInt(show_start_value) + 10;
          endid.value = parseInt(show_end_value) + 10;

        }
      }  

function loadIframe(iframeName, url) {
    if ( window.frames[iframeName] ) {
        window.frames[iframeName].location = url;   
        return false;
    }
    return true;
}    

function Delete(id) {
   if (confirm("Are you sure you want to delete?")) {
      button=document.getElementById(id);
      button.click();
   }
}

//idle time
function timeout_trigger() {
    window.alert('You have been logged out.');
	parent.location = 'logout';
}

function timeout_init() {
    setTimeout('timeout_trigger()', 300000);
}
