<!--
/*
DESCRIPTION: These functions find the position of an <A> tag in a document,
so other elements can be positioned relative to it.
 
COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.
 
FUNCTIONS:
getAnchorPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor. Position is relative to the PAGE.
 
getAnchorWindowPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor, relative to the WHOLE SCREEN.
 
NOTES:
 
1) For popping up separate browser windows, use getAnchorWindowPosition. 
   Otherwise, use getAnchorPosition
 
2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>
 
3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
*/ 
// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
 // This function will return an Object with x and y properties
 var coordinates = new Object();
 var x=0;
 var y=0;
 // Browser capability sniffing
 var use_gebi = false;
 var use_css = false;
 var use_layers = false;
 if (document.getElementById) { use_gebi = true; }
 else if (document.all) { use_css = true; }
 else if (document.layers) { use_layers = true; }
 // Logic to find position
  if (use_gebi && document.all) {
  x = AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
  y = AnchorPosition_getPageOffsetTop(document.all[anchorname]);
  }
 else if (use_gebi) {
  var o = document.getElementById(anchorname);
  x = AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
  y = AnchorPosition_getPageOffsetTop(document.all[anchorname]);
  //x = o.offsetLeft;
  //y = o.offsetTop;
  }
  else if (use_css) {
  x = AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
  y = AnchorPosition_getPageOffsetTop(document.all[anchorname]);
  }
 else if (use_layers) {
  var found=0;
  for (var i=0; i<document.anchors.length; i++) {
   if (document.anchors[i].name == anchorname) {
    found=1;
    break;
    }
   }
  if (found == 0) {
   coordinates.x=0; coordinates.y=0; return coordinates;
   }
  x = document.anchors[i].x;
  y = document.anchors[i].y;
  }
 else {
  coordinates.x=0; coordinates.y=0; return coordinates;
  }
 coordinates.x = x;
 coordinates.y = y;
 return coordinates;
 }
 
// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
 var coordinates = getAnchorPosition(anchorname);
 var x=0;
 var y=0;
 if (document.getElementById) {
  if (isNaN(window.screenX)) {
   x = coordinates.x + window.screenLeft;
   y = coordinates.y + window.screenTop;
   }
  else {
   x = coordinates.x + window.screenX + (window.outerWidth-window.innerWidth) - window.pageXOffset;
   y = coordinates.y + window.screenY + (window.outerHeight-24-window.innerHeight) - window.pageYOffset;
   }
  }
 else if (document.all) {
  x = coordinates.x + window.screenLeft;
  y = coordinates.y + window.screenTop;
  }
 else if (document.layers) {
  x = coordinates.x + window.screenX + (window.outerWidth-window.innerWidth) - window.pageXOffset;
  y = coordinates.y + window.screenY + (window.outerHeight-24-window.innerHeight) - window.pageYOffset;
  }
 coordinates.x = x;
 coordinates.y = y;
 return coordinates;
 }
 
// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
 var ol = el.offsetLeft;
 while ((el = el.offsetParent) != null) { 
  ol += el.offsetLeft; 
  }
 return ol;
 }
function AnchorPosition_getWindowOffsetLeft (el) {
 var scrollamount = document.body.scrollLeft;
 return AnchorPosition_getPageOffsetLeft(el)-scrollamount;
 } 
function AnchorPosition_getPageOffsetTop (el) {
 var ot = el.offsetTop;
 while((el = el.offsetParent) != null) { 
  ot += el.offsetTop; 
  }
 return ot;
 }
function AnchorPosition_getWindowOffsetTop (el) {
 var scrollamount = document.body.scrollTop;
 return AnchorPosition_getPageOffsetTop(el)-scrollamount;
 }
 
 /* This Is Frame Breaking Code */
 if (top != self)  {top.location = self.location}
 
 /* Preloader code */
 function newImage(arg) {
  if (document.images) {
   rslt = new Image();
   rslt.src = arg;
   return rslt;
  }
 }
 
 
 

//var IE = document.all?true:false
 
//if (!IE) document.captureEvents(Event.MOUSEMOVE)
 
//document.onmousemove = getMouseXY;
 
//var tempX = 0
//var tempY = 0
 
  
//function getMouseXY(z) {
//  if (IE) { // grab the x-y pos.s if browser is IE
//    tempX = event.clientX// + document.body.scrollLeft
//    tempY = event.clientY// + document.body.scrollTop
//  } else {  // grab the x-y pos.s if browser is NS
//    tempX = z.pageX
//    tempY = z.pageY
//  }  
  // catch possible negative values in NS4
//  if (tempX < 0){tempX = 0}
//  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
//obj_info = document.getElementById("info")
//obj_info.style.top = tempY + 10;
//obj_info.style.left = tempX + 10;
//  return true
//}
 
//function alert_msg(titletext,bodytext){
//obj_info = document.getElementById("info")
//obj_info.style.display = '';
//obj_imagetitle = document.getElementById("imagetitle");
//obj_imagetitle.innerHTML = titletext;
//obj_imagebody = document.getElementById("imagebody");
//obj_imagebody.innerHTML = bodytext;
//}
 
//function away()
//{
//obj_info = document.getElementById("info")
//obj_info.style.display = 'none';
//}
 
/******************************************
* Find In Page Script -- Submitted/revised by Alan Koontz (alankoontz@REMOVETHISyahoo.com)
* Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
* This notice must stay intact for use
******************************************/
var TRange = null;
var dupeRange = null;
var TestRange = null;
var win = null;
 
var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major   = parseInt(navigator.appVersion);
var is_minor   = parseFloat(navigator.appVersion);
var is_ie      = (agt.indexOf("msie") != -1);
var is_ie4up   = (is_ie && (is_major >= 4));
var is_not_moz = (agt.indexOf('netscape')!=-1)
var is_nav     = (nom.indexOf('netscape')!=-1);
var is_nav4    = (is_nav && (is_major == 4));
var is_mac     = (agt.indexOf("mac")!=-1);
var is_gecko   = (agt.indexOf('gecko') != -1);
var is_opera   = (agt.indexOf("opera") != -1);
 
var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}
 
var frametosearch = self;
 
function search(whichform, whichframe) {  
 
if (is_ie4up && is_mac) return;  //  TEST FOR IE5 FOR MAC (NO DOCUMENTATION)
 
if (is_gecko && (is_rev <1)) return;  //  TEST FOR NAV 6 (NO DOCUMENTATION)
 
if (is_opera) return;  //  TEST FOR Opera (NO DOCUMENTATION)
 
if(whichform.findthis.value!=null && whichform.findthis.value!='') {   //  INITIALIZATIONS FOR FIND-IN-PAGE SEARCHES
 
       str = whichform.findthis.value;
       win = whichframe;
       var frameval=false;
       if(win!=self)
  {
       frameval=true;  // this will enable Nav7 to search child frame
       win = parent.frames[whichframe];
  }
}
else return;  //  i.e., no search string was entered
 
var strFound;  //  NAVIGATOR 4 SPECIFIC CODE
 
if(is_nav4 && (is_minor < 5)) {
  strFound=win.find(str); // case insensitive, forward search by default
        }
 
if (is_gecko && (is_rev >= 1)) {  //  NAVIGATOR 7 and Mozilla rev 1+ SPECIFIC CODE (WILL NOT WORK WITH NAVIGATOR 6)
   
    if(frameval!=false) win.focus(); // force search in specified child frame
    strFound=win.find(str, false, false, true, false, frameval, false);
 
    if (is_not_moz)  whichform.findthis.focus();
 
}
 
 if (is_ie4up) {
 
  if (TRange!=null) {
   
   TestRange=win.document.body.createTextRange();
 
   if (dupeRange.inRange(TestRange)) {
 
   TRange.collapse(false);
   strFound=TRange.findText(str);
    if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = win.document.body.scrollTop + TRange.offsetTop;
        TRange.select();
        }
   }
   else {
     TRange=win.document.body.createTextRange();
     TRange.collapse(false);
     strFound=TRange.findText(str);
     if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }
   }
  }
   if (TRange==null || strFound==0) {
   TRange=win.document.body.createTextRange();
   dupeRange = TRange.duplicate();
   strFound=TRange.findText(str);
  if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }
   }
 }
 
  if (!strFound) alert ("\'"+str+"\' not found!") // string not found
}
 

function showmainmenu(name,menu) {
 var c = getAnchorPosition(name);
 //alert("X = "+c.x+" , Y = "+c.y);
 if (document.getElementById) {
  if (document.getElementById(menu).style.visibility != 'visible') {
   var o = document.getElementById(menu);
   if (o.style) {

var agt=navigator.userAgent.toLowerCase();
	var is_fx = ((navigator.vendor=="Firefox")||(agt.indexOf('firefox')!=-1));
	if (is_fx) {
		o.style.left = c.x+1;
    o.style.top = c.y;
	}else{
		o.style.left = c.x+1;
    o.style.top = c.y+27;
	}
 
    }
   }
  }
 }
 
function showsubmenu(name,menu) {
 var c2 = getAnchorPosition(name);
 //alert("X = "+c2.x+" , Y = "+c2.y);
 if (document.getElementById) {
  if (document.getElementById(menu).style.visibility != 'visible') {
   var o2 = document.getElementById(menu);
   if (o2.style) {
    o2.style.left = c2.x;
    o2.style.top = c2.y-9;
   }
  }
 }
}
 
function show(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='visible';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    else if (document.all)
        document.all[object].style.visibility = 'visible';
}
 
function hide(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='hidden';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
}