
/*
***** Usage example *****
*** When specifying the window parameters (width,height and name) ***
   <a href="http://www.abc.com/xyz.htm" 
      onClick="return Wndw_720_540_0('http://www.abc.com/xyz.htm','775','500','')"
      target="_blank"
   >
      LINK TEXT HERE
   </a>

*** When using the default window parameters (width,height and name) ***
   <a href="http://www.abc.com/xyz.htm" 
      onClick="return Wndw_720_540_0('http://www.abc.com/xyz.htm')"
      target="_blank"
   >
      LINK TEXT HERE
   </a>
*/


function LDPWndw(trgtURL,width,height,params,wndwName) 
   {
   var DFLT_WDTH = "720";
   var DFLT_HGHT = "540";
   var DFLT_PARAMS = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes"
   var name = "";
   var wdth = "";
   var hght = "";
   var parms = "";
   
   var is_ie = ("undefined" != typeof document.all)&&("undefined" != document.getElementById );
   
   wdth = ( undefined == width ) ? DFLT_WDTH:width;
   wdth = ( 0 == wdth.length ) ? DFLT_WDTH:wdth;

   hght = ( undefined == height ) ? DFLT_HGHT:height;
   hght = ( 0 == hght.length ) ? DFLT_HGHT:hght;

   name = ( undefined == wndwName ) ? "":wndwName;

   parms = (( undefined == params )||( 0 == params.length )) ? DFLT_PARAMS:params;
   
   if ( true == is_ie)
      {
      hght *= 1.3;
      wdth *= 1.1;
      }
   
   parms += (",width="+wdth+",height="+hght);
   window.open( trgtURL
              , name
              , parms
              );

   return false; // important in order to prevent opening normal 
                 // window also (when scripting enabled)
                 // use target = "_blank" incase scripting is disabled
   }


function Create_LDPWndw2_RefObj(obj)
   {
   function WinRefObj()
      {
      this.value = null;
      }
   
   var obj = new WinRefObj();   
   
   return obj;
   }

function Destroy_LDPWndw2_RefObj(obj)
   {
   obj.value.close();   
   }


function LDPWndw2(trgtURL,winRefObj,width,height,params,wndwName) 
   {

   var DFLT_WDTH = "720";
   var DFLT_HGHT = "540";
   var DFLT_PARAMS = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes"
   var name = "";
   var wdth = "";
   var hght = "";
   var parms = "";
   var win_ref = null;
   
   var is_ie = ("undefined" != typeof document.all)&&("undefined" != document.getElementById );
   
   wdth = ( undefined == width ) ? DFLT_WDTH:width;
   wdth = ( 0 == wdth.length ) ? DFLT_WDTH:wdth;

   hght = ( undefined == height ) ? DFLT_HGHT:height;
   hght = ( 0 == hght.length ) ? DFLT_HGHT:hght;

   name = ( undefined == wndwName ) ? "":wndwName;

   parms = ( undefined == params ) ? DFLT_PARAMS:params;
   parms = ( 0 == params.length ) ? DFLT_PARAMS:params;
   
   if ( true == is_ie)
      {
      hght *= 1.3;
      wdth *= 1.1;
      }
   
   parms += (",width="+wdth+",height="+hght);
   winRefObj.value = window.open( trgtURL
                                , name
                                , parms
                                );
                        
   return false; // important in order to prevent opening normal 
                 // window also (when scripting enabled)
                 // use target = "_blank" incase scripting is disabled
   }



function bnnrTtlMOvr( elemID )
   {
   //var elem = document.getElementById(elemID);
   //elem.style.cursor = "pointer";
   document.getElementById(elemID).style.cursor="pointer";
   }

function bnnrTtlMOut( elemID )
   {
   //var elem = document.getElementById(elemID);
   //elem.style.cursor = "default";
   document.getElementById(elemID).style.cursor="auto";
   }

   //    *  Browser name: BrowserDetect.browser
   //    * Browser version: BrowserDetect.version
   //    * OS name: BrowserDetect.OS


var BrowserDetect = 
   {
   init: function () 
      {
      this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
      this.version = this.searchVersion(navigator.userAgent)
                   || this.searchVersion(navigator.appVersion)
                   || "an unknown version";
      this.OS = this.searchString(this.dataOS) || "an unknown OS";
      },
   searchString: function (data) 
      {
      for (var i=0;i<data.length;i++)  
         {
         var dataString = data[i].string;
         var dataProp = data[i].prop;
         this.versionSearchString = data[i].versionSearch || data[i].identity;
         if (dataString) 
            {
            if (dataString.indexOf(data[i].subString) != -1)
               return data[i].identity;
            }
         else if (dataProp)
            return data[i].identity;
         }
      },
      
   searchVersion: function (dataString) 
      {
      var index = dataString.indexOf(this.versionSearchString);
      if (index == -1) return;
      return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
      },
      
   dataBrowser: [ {
                  string: navigator.userAgent,
                  subString: "Chrome",
                  identity: "Chrome"
                  },
                  {  
                  string: navigator.userAgent,
                  subString: "OmniWeb",
                  versionSearch: "OmniWeb/",
                  identity: "OmniWeb"
                  },
                  {
                  string: navigator.vendor,
                  subString: "Apple",
                  identity: "Safari",
                  versionSearch: "Version"
                  },
                  {
                  prop: window.opera,
                  identity: "Opera"
                  },
                  {
                  string: navigator.vendor,
                  subString: "iCab",
                  identity: "iCab"
                  },
                  {
                  string: navigator.vendor,
                  subString: "KDE",
                  identity: "Konqueror"
                  },
                  {
                  string: navigator.userAgent,
                  subString: "Firefox",
                  identity: "Firefox"
                  },
                  {
                  string: navigator.vendor,
                  subString: "Camino",
                  identity: "Camino"
                  },
                  {     // for newer Netscapes (6+)
                  string: navigator.userAgent,
                  subString: "Netscape",
                  identity: "Netscape"
                  },
                  {
                  string: navigator.userAgent,
                  subString: "MSIE",
                  identity: "Explorer",
                  versionSearch: "MSIE"
                  },
                  {
                  string: navigator.userAgent,
                  subString: "Gecko",
                  identity: "Mozilla",
                  versionSearch: "rv"
                  },
                  {     // for older Netscapes (4-)
                  string: navigator.userAgent,
                  subString: "Mozilla",
                  identity: "Netscape",
                  versionSearch: "Mozilla"
                  }
                ],
      
      dataOS : [ {
                 string: navigator.platform,
                 subString: "Win",
                 identity: "Windows"
                 },
                 {
                 string: navigator.platform,
                 subString: "Mac",
                 identity: "Mac"
                 },
                 {
                 string: navigator.userAgent,
                 subString: "iPhone",
                 identity: "iPhone/iPod"
                 },
                 {
                 string: navigator.platform,
                 subString: "Linux",
                 identity: "Linux"
                 }
               ]

   };


BrowserDetect.init();
var brwsr = BrowserDetect.browser;
var swf_wdth_delta = 0;
var swf_hght_delta = 0;

var movies_params = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes';

if ( 0 <= brwsr.indexOf("Explorer") )
   {
   swf_wdth_delta = -40;
   swf_hght_delta = -45
   }

var pp_ref = null;

function commentPopUpBox( linkCls, trgt, ppRef, wdth, hght, linkTxt )
   {
   document.write('<a class ="'+linkCls+'" href="'+trgt+'" onclick="return LDPWndw2('+trgt+','+ppRef+','+wdth+','+hght+',movies_params,\"\");">Click &#38; send Bigfoot comments</a>');
   }

Image.prototype.Test = function(txt)
   {
   alert(txt);   
   }

Image.prototype.asPPWin = function( winRefObj, docTitle,params,wndwName )
   {
   var DFLT_PARAMS = "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
   var parms = (( undefined == params )||( 0 == params.length )) ? DFLT_PARAMS:params;   
   win_name = ( undefined == wndwName ) ? "":wndwName;
   var new_win = null;

   var win_wdth = this.width;
   var win_hght = this.height;
   win_wdth += 20;
   win_hght += 50;

   var newContent = "<html><head><title>"+docTitle+" - "+this.alt+"</title>";
   newContent += "<script type=\"text/javascript\" src=\"scripts/navUtls.js\" ></script>";
   newContent += "<script type=\"text/javascript\" src=\"scripts/genUtls.js\" ></script>";
   newContent += "</head>";
   newContent += "<body onblur=\"window.self.close();\">";
   newContent += "<button type=\"button\" style=\"width:"+this.width+"px; padding:0px;\" onblur=\"window.self.close();\" onclick=\"window.self.close();\">";   
   newContent += "<img style=\"width:"+this.width+"px; height:"+this.height+"px:\" src = \""+ this.src+"\" alt = \""+this.alt+"\" longdesc = \"\"/>";
   newContent += "</button>";   
   newContent += "<div style=\"margin-top:10px;text-align:center; font-weight:700\"> Click image to close</div>";
   newContent += "</body></html>";
   
   var is_ie = ("undefined" != typeof document.all)&&("undefined" != document.getElementById );   
   if ( true == is_ie)
      {
      win_hght += 40;
      }
      
   parms += (",width="+win_wdth+",height="+win_hght);
                                
   winRefObj.value = window.open( this.src
                                , win_name
                                , parms
                                );                                                        
                                
   winRefObj.value.document.write(newContent);
   
   return false; // important in order to prevent opening normal 
                 // window also (when scripting enabled)
                 // use target = "_blank" incase scripting is disabled
      
   }


