﻿
var hasClick2Close = false;


function LN_close(dividc) 
{ 
	document.getElementById(dividc).style.display='none';
}
function LN_open(divido) 
{ 
	if(hasClick2Close==false)
	{
	document.getElementById(divido).style.display='block';
	}
}

function goNext()
{
    if(document.getElementById("ctl00_nextButton"))
    {
        __doPostBack('ctl00$nextButton','');
    }
}

function jumpPage(pageNumber)
{
    if(document.getElementById("ctl00_jumpButton"))
    {
       (document.getElementById("ctl00_jumpPage")).value=pageNumber;
        __doPostBack('ctl00$jumpButton','');
    }
}

function goPrev()
{
    if(document.getElementById("ctl00_prevButton"))
    {
         __doPostBack('ctl00$prevButton','');
    }
}

function showSave()
{

sDiv = document.getElementById("saverollover");

    if(sDiv.style.display=="none" || sDiv.style.display=="")
    {
        sDiv.style.display = "block";
    }else{
        sDiv.style.display = "none";
    }
}

function showTemplate()
{
window.open("../DLMat.aspx",'DLMat','');
}


//*** sets up Popups
function externalLinks()
{
if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function mp_onload()
{
  externalLinks();
  if(window.body_onload != null)
    window.body_onload();
}

function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

///*** gets the browser window size
function getViewPortSize()
{
 var width;
 var height;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      width = window.innerWidth,
      height = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       width = document.documentElement.clientWidth,
       height = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       width = document.getElementsByTagName('body')[0].clientWidth,
       height = document.getElementsByTagName('body')[0].clientHeight
 }

return {width:width,height:height};
}

function flipDiv(divId) {

    cDiv = document.getElementById(divId);
    if (cDiv.style.display == "none" || cDiv.style.display == "") {
        cDiv.style.display = "block";
    } else {
        cDiv.style.display = "none";
    }

}
