
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


// FIND OBJECT
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

// CHANGE AN OBJECT
function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function SubmitNow(item){
if(item.value="Processing... Please wait")return
else
item.value="Processing... Please wait"
item.form.submit
}

// SHOW N IF MSIE, SHOW O IF NOT
function OnlyMSIE(n,o){
		if ( -1 != navigator.userAgent.
      indexOf ("MSIE") ) {	
		document.write (n);
	} else if (o) {
		document.write (o);
	}
}

// FORUM JS
// DISPLAYS A MENU ON EACH TOPIC
function ForumMenuShow (n)
{
	if (SHOW_FORUM_MENU) {	
		document.write (n);
	}
}
// PROVIDE A TRUE checker VAR AND IT WILL DISPLAY
function CheckMenuShow (n,checker)
{
	if (checker) {	
		document.write (n);
	}
}


// DISPLAY WATCHLIST PULLDOWN
function WatchList(title)
{
	document.write("<iframe id='remote_callback_iframe' height='0' width='0'></iframe>");
	document.write("<div id='watchlist' style='position:absolute; z-index:1; width: 450; height: 75; visibility: hidden;' class=gray_box_full >  <form name='LayerForm' method='post' action=''>    <table width='100%'  border='0' cellspacing='0' cellpadding='3' class=txt_body_xsm>      <tr>        <td colspan='2'><div align='center'><strong>Watch "+title+"</div></td>      </tr>      <tr valign='top'>        <td>Notify me <select name='field1' class=txt_body_xsm>          <option value='nowait'>Immediately</option>          <option value='hour'>Hourly</option>          <option value='daily'>Daily</option>          <option value='weekly'>Weekly</option>          <option value='mothly'>Monthly</option>        </select> when updated</td><td>When updated, send me <select name='field2' class=txt_body_xsm><option value='1'>E-mail</option><option value='2'>Message</option>          <option value='0'>Nothing</option>        </select></td></tr> <td colspan='2'><center><input type='button' name='Submit' value='+ Add to my Watchlist' class=frmBtn  onclick='Layer_Submit(this,\"watchlist\",\""+WATCHLIST_URL+"\")'></td>      </tr>    </table>  </form></div>");
	
}

function Layer_Submit(item,layername,pushurl){
if(item.value=="Proccessing.. Please Wait") {
return(0);
}
else if(item.value=="Success, Click here to close window") {
MM_changeProp(layername,'','style.visibility','hidden','LAYER');
}
else
item.value="Success, Click here to close window";
Push_URL(pushurl+'&field1='+LayerForm.field1.value+"&field2="+LayerForm.field2.value);
}


// SENDS URL VIA JAVASCRIPT AND IFRAME
function Push_URL(sendHref)
{
    // Try to use an IFRAME.
    if (window.remote_callback_iframe) {
        window.remote_callback_iframe.location.href = sendHref+"&iframe=t";
        // Return special value to leave this window alone        
        return void(0);
    }
    // If that failed, try using a pop-up window.
    rateWindow =
        window.open("",
                    "nf_gauge_set",
                    "resizable=no,dependent=yes,width=1,height=1,screenX="
                    +window.screenX+",screenY="+window.screenY
                    +",top="+window.screenX+",left="+window.screenY);
    if (rateWindow && ! rateWindow.closed) {
        //rateWindow.blur();
        rateWindow.location.href = sendHref+"&js=t";	
        return void(0);
    }
}

// OPEN A CENTERED WINDOW
function openCenteredWindow(url, height, width, name, parms) {
   var left = Math.floor( (screen.width - width) / 2);
   var top = Math.floor( (screen.height - height) / 2);
   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
   if (parms) { winParms += "," + parms; }
   var win = window.open(url, name, winParms);
   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
   return win;
}