var perform_acrobat_detection = function()
{ 
  //
  // The returned object
  // 
  var browser_info = {
    name: null,
    acrobat : null,
    acrobat_ver : null
  };
  
  if(navigator && (navigator.userAgent.toLowerCase()).indexOf("chrome") > -1) browser_info.name = "chrome";
  else if(navigator && (navigator.userAgent.toLowerCase()).indexOf("msie") > -1) browser_info.name = "ie";
  else if(navigator && (navigator.userAgent.toLowerCase()).indexOf("firefox") > -1) browser_info.name = "firefox";
  else if(navigator && (navigator.userAgent.toLowerCase()).indexOf("msie") > -1) browser_info.name = "other";
	
	
 try
 {
  if(browser_info.name == "ie")
  {          
   var control = null;
   
   //
   // load the activeX control
   //                
   try
   {
    // AcroPDF.PDF is used by version 7 and later
    control = new ActiveXObject('AcroPDF.PDF');
   }
   catch (e){}
   
   if (!control)
   {
    try
    {
     // PDF.PdfCtrl is used by version 6 and earlier
     control = new ActiveXObject('PDF.PdfCtrl');
    }
    catch (e) {}
   }
   
   if(!control)
   {     
    browser_info.acrobat == null;
    return browser_info;  
   }
   
   version = control.GetVersions().split(',');
   version = version[0].split('=');
   browser_info.acrobat = "installed";
   browser_info.acrobat_ver = parseFloat(version[1]);                
  }
  else if(browser_info.name == "chrome")
  {
   for(key in navigator.plugins)
   {
    if(navigator.plugins[key].name == "Chrome PDF Viewer" || navigator.plugins[key].name == "Adobe Acrobat")
    {
     browser_info.acrobat = "installed";
     browser_info.acrobat_ver = parseInt(navigator.plugins[key].version) || "Chome PDF Viewer";
    }
   } 
  }
  //
  // NS3+, Opera3+, IE5+ Mac, Safari (support plugin array):  check for Acrobat plugin in plugin array
  //    
  else if(navigator.plugins != null)
  {      
   var acrobat = navigator.plugins['Adobe Acrobat'];
   if(acrobat == null)
   {           
    browser_info.acrobat = null;
    return browser_info;
   }
   browser_info.acrobat = "installed";
   browser_info.acrobat_ver = parseInt(acrobat.version[0]);                   
  }
  
  
 }
 catch(e)
 {
  browser_info.acrobat_ver = null;
 }
   
  return browser_info;
}



function  getPageSize(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strict mode
		xScroll = document.documentElement.scrollWidth;
		yScroll = document.documentElement.scrollHeight;
	} else { // Explorer Mac...would also work in Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) { // all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	return [pageWidth,pageHeight,windowWidth,windowHeight];
}

