/* 
   // Copyright (C) 2006, 2007 - SYNTAXXX - Alex. HANNEL
   // info@syntaxxx.at

	// syn_func_page.js
*/

   var syn_inner_width;
   var syn_inner_height;
   var syn_page_width;
   var syn_page_height;
   var syn_window_width;
   var syn_window_height;

   function syn_page_init()
   {
   	if(window.innerHeight && window.scrollMaxY)
      {
   		syn_page_x = document.body.scrollWidth;
   		syn_page_y = window.innerHeight + window.scrollMaxY;
   	}
         else if(document.body.scrollHeight > document.body.offsetHeight)
      { // all but Explorer Mac
   		syn_page_x = document.body.scrollWidth;
   		syn_page_y = document.body.scrollHeight;
   	}
         else
      { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
   		syn_page_x = document.body.offsetWidth;
   		syn_page_y = document.body.offsetHeight;
   	}

   	if (self.innerHeight)
      {	// all except Explorer
   		syn_window_width = self.innerWidth;
   		syn_window_height = self.innerHeight;
   	}
         else if (document.documentElement && document.documentElement.clientHeight)
      { // Explorer 6 Strict Mode
   		syn_window_width = document.documentElement.clientWidth;
   		syn_window_height = document.documentElement.clientHeight;
   	}
         else if (document.body)
      { // other Explorers
   		syn_window_width = document.body.clientWidth;
   		syn_window_height = document.body.clientHeight;
   	}

   	// for small pages with total height less then height of the viewport
   	if(syn_page_y < syn_window_height)
      {
   		syn_page_height  = syn_window_height;
   		syn_inner_height = syn_page_y;
   	}
         else
      {
   		syn_page_height  = syn_page_y;
   		syn_inner_height = syn_window_height;
   	}

   	// for small pages with total width less then width of the viewport
   	if(syn_page_x < syn_window_width)
      {
   		syn_page_width  = syn_window_width;
   		syn_inner_width = syn_page_x;
   	}
         else
      {
   		syn_page_width  = syn_page_x;
   		syn_inner_width = syn_window_width;
   	}   	
   }
   
   // syn_page_init();   
   
   function syn_page_reload(set)
   {
      if(typeof(syn_js_support_page) == 'undefined' || !syn_js_support_page)
      {
         return false;
      }
      
      if(typeof(set) == 'undefined')
      {
         return false;
      }

      with(navigator)
      {
         if(set)
         {
            if((appName == 'Netscape') && (parseInt(appVersion) == 4))
            {
               document.syn_page_x    = innerWidth;
               document.syn_page_y   = innerHeight;

               onresize = syn_page_reload;
            }
         }
            else if(innerWidth != document.syn_page_x
               || innerHeight != document.syn_page_y)
         {
               location.reload();
         }
      }
   }

   function syn_page_session(sess)
   {
      if(typeof(sess) != "undefined" && sess)
      {
         syn_js_session = sess;
      }
         else if(typeof(syn_js_session) != "undefined" && syn_js_session)
      {
         return syn_js_session;
      }
         else
      {
         return false;
      }
   }
   

