/* --------------------------------
   WebsiteGear Modal Dialog JavaScript Code
   Copyright © WebsiteGear Inc. All rights reserved. 

   For more informaiton visit websitegear.com
   ---------------------------------
*/
/* <![CDATA[ */

   function display(target, title)
   {
      createDivs();	  

      //if (title != "") {document.getElementById('titlepane').innerHTML = title; }
      //document.getElementById('toppane').innerHTML = '<div class="close_button"><img src="../images/button/close_button.gif" border="0" alt="Click to close" onclick="overlayclose();"></div>';
      document.getElementById('bottompane').innerHTML = '<iframe src="' + target + '" width="100%" height="95%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes"><a href="' + target + '" target="_blank">Survey</a></iframe>';
      document.getElementById('contentDiv').style.display='block';
      document.getElementById('fadeDiv').style.display='block';
        
      window.repositionContentDiv('contentDiv');
      window.repositionTransparentDiv('fadeDiv');
        
      addEvent(window,'scroll',function(e){ window.repositionContentDiv('contentDiv');window.repositionTransparentDiv('fadeDiv'); });
      addEvent(window,'resize',function(e){ window.repositionContentDiv('contentDiv');window.repositionTransparentDiv('fadeDiv'); });
   }

   function displayImg(target, title)
   {
      createDivs();	  

      //if (title != "") {document.getElementById('titlepane').innerHTML = title; }
      //document.getElementById('toppane').innerHTML = '<div class="close_button"><img src="../images/button/close_button.gif" border="0" alt="Click to close" onclick="overlayclose();"></div>';
      document.getElementById('bottompane').innerHTML = '<img src="' + target + '" width="100%" height="95%" frameborder="no" border="0" marginwidth="0" marginheight="0"border="0" alt="Click to close" onclick="overlayclose();" />';
      document.getElementById('contentDiv').style.display='block';
      document.getElementById('fadeDiv').style.display='block';
        
      window.repositionContentDiv('contentDiv');
      window.repositionTransparentDiv('fadeDiv');
        
      addEvent(window,'scroll',function(e){ window.repositionContentDiv('contentDiv');window.repositionTransparentDiv('fadeDiv'); });
      addEvent(window,'resize',function(e){ window.repositionContentDiv('contentDiv');window.repositionTransparentDiv('fadeDiv'); });
   }
   
   function overlayclose()
    {
        document.getElementById('contentDiv').style.display='none';
        document.getElementById('fadeDiv').style.display='none';
    }

    function createDivs()
    {
        // Creating transparent div
        div_transparentDiv = document.createElement('DIV');
        div_transparentDiv.className='black_overlay';
        div_transparentDiv.id = 'fadeDiv';
        div_transparentDiv.style.left = '0px';
        div_transparentDiv.style.top = '0px';	
        document.body.appendChild(div_transparentDiv);
        
        // Creating content div
        div_content = document.createElement('DIV');
        div_content.className = 'white_content';
        div_content.id = 'contentDiv';
        //div_content.style.zIndex = 100000;			
        document.body.appendChild(div_content);	
        
        // Creating the top div
        div_top = document.createElement('DIV');
        div_top.id = 'toppane';
        div_content.appendChild(div_top);
        
        //div_title = document.createElement('SPAN');
        //div_title.id = 'titlepane';
        //div_title.className = 'title_pane';
        //div_top.appendChild(div_title);

        div_close = document.createElement('DIV');
        div_close.id = 'closepane';
        div_close.className = 'close_button';
        div_close.innerHTML = '<img src="../images/button/close_button.gif" border="0" alt="Click to close" onclick="overlayclose();"></div>';
        div_top.appendChild(div_close);

        // Creating the bottom div iFrame
        div_bottom = document.createElement('DIV');
        div_bottom.id = 'bottompane';
        //div_top.className = 'close_button';
        //iframe = document.createElement('<iframe src="' + target + '" width="100%" height="95%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes"><a href="' + target + '" target="_blank">Survey</a></iframe>');
        div_content.appendChild(div_bottom);
    }
   
   function repositionContentDiv(divObj)
    {
      transDiv = document.getElementById(divObj)         
      transDiv.style.top = Math.max(document.body.scrollTop,document.documentElement.scrollTop) + 10 + 'px';
      //transDiv.style.left = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft) + 10 + 'px';
      //var brSize = this.getBrowserSize();
      //var bodyWidth = brSize[0];
      //var bodyHeight = brSize[1];
      //transDiv.style.width = bodyWidth*0.9 + 'px';
      //transDiv.style.height = bodyHeight*0.9 + 'px';
    }
   
   function repositionTransparentDiv(divObj)
    {
      transDiv = document.getElementById(divObj)
      transDiv.style.top = Math.max(document.body.scrollTop,document.documentElement.scrollTop) + 'px';
      transDiv.style.left = Math.max(document.body.scrollLeft,document.documentElement.scrollLeft) + 'px';
      var brSize = this.getBrowserSize();
      var bodyWidth = brSize[0];
      var bodyHeight = brSize[1];
      transDiv.style.width = bodyWidth + 'px';
      transDiv.style.height = bodyHeight + 'px';
    }

   function getBrowserSize()
   {
      var bodyWidth = document.documentElement.clientWidth;
      var bodyHeight = document.documentElement.clientHeight;
      
      var bodyWidth, bodyHeight; 
      if (self.innerHeight)
      { // all except Explorer
         bodyWidth = self.innerWidth;
         bodyHeight = self.innerHeight; 
      }  
        else if (document.documentElement && document.documentElement.clientHeight) 
      {
         // Explorer 6 Strict Mode      
         bodyWidth = document.documentElement.clientWidth; 
         bodyHeight = document.documentElement.clientHeight; 
      } else if (document.body) {// other Explorers       
         bodyWidth = document.body.clientWidth; 
         bodyHeight = document.body.clientHeight; 
      } 
      return [bodyWidth,bodyHeight];      
   }
   
   function addEvent(whichObject,eventType,functionName,suffix)
   { 
     if(!suffix)suffix = '';
     if(whichObject.attachEvent){ 
       whichObject['e'+eventType+functionName+suffix] = functionName; 
       whichObject[eventType+functionName+suffix] = function(){whichObject['e'+eventType+functionName+suffix]( window.event );} 
       whichObject.attachEvent( 'on'+eventType, whichObject[eventType+functionName+suffix] ); 
     } else 
       whichObject.addEventListener(eventType,functionName,false);       
   }

// *** END JS FOR WEBSITEGEAR ***

/* ]]> */

