function select_faq(search) {
   top.faq_lookup.document.faq.search.value=search;
   top.faq_lookup.document.faq.submit();
}
function change_portal(portal) {
   document.navigate.portal.value = portal; 
   document.navigate.new_page.value = ""; 
   document.navigate.type.value = "0";  
   // document.navigate.submit();
   // if(portal == 50) {portal = "security";}
   document.location.href="http://www.netonecom.net/index.php?portal=" + portal + "&type=0&new_page=";
}   
function show_border(id) {
   if(id == 1) { id = "googlejpg";}
   if(id == 0) { id = "yahoojpg";}
   if(document.getElementById(id).border==1) {
      document.getElementById(id).border=2;
   } else  {
      document.getElementById(id).border=1;
   }   
}   
function navigate_to(type,new_page) {
   document.navigate.new_page.value=new_page;
   document.navigate.type.value=type;
   // document.navigate.submit();
   document.location.href="http://www.netonecom.net/index.php?portal=" + document.navigate.portal.value + "&type=" + type + "&new_page=" + new_page;
   return false;
}   
function navigate_out(new_page) {
   document.location.href=new_page;
   return false;
}   
function javascript_link(js) {
   eval(js);
   return false;
}   
var hl_color = "#E6E8FA"
function submit_form() {
   var new_url = document.address.address.value;
   if(new_url != "" && document.address.category.value=="" && document.address.title.value=="") {
      if(new_url.indexOf("://") < 0) {new_url = "http://"+new_url;}
      parent.document.location=''+new_url+'';
      return;
   } else if(new_url == "") {
      document.address.address.select(); 
      return;
   } else if(document.address.category.value == "") {
      document.address.category.select(); 
      return;
   } else if(document.address.title.value == "") {
      document.address.title.select(); 
      return;
   } else {
      window.location="index.php?func=save&address="+escape(document.address.address.value)+"&category="+escape(document.address.category.value)+"&title="+escape(document.address.title.value)+"&ID="+escape(document.address.ID.value)+"";
   }
}
function submit_url(url_address) {
   if(document.parameters.last_category.value != "") {
      var last_category = document.parameters.last_category.value;
      var last_id = document.parameters.last_id.value;
      var last_header = "header"+last_category;
      document.getElementById(last_category).style.visibility='hidden'; 
      document.getElementById(last_category).style.top='1px'; 
      document.getElementById(last_category).style.height='1px'; 
      document.getElementById(last_header).style.backgroundColor='';
      document.getElementById(last_header).style.color='black';
   }   
   document.parameters.last_category.value = "";
   document.parameters.last_id.value = "";
   var prefix_js = url_address.substring(0,12);
   if(prefix_js == "javascript: ") {
      eval(url_address.substring(12));
   } else {   
      if(url_address.indexOf("://") < 0) {
         url_address = "http://"+url_address;
      }		
      parent.document.location=url_address;
   }   
   return false;
}
function expand(category,id) {
   if(document.getElementById(category).style.visibility=='hidden') {
      if(document.parameters.last_category.value != "") {
         var last_category = document.parameters.last_category.value;
         var last_id = document.parameters.last_id.value;
         var last_header = "header"+last_category;
         document.getElementById(last_category).style.visibility='hidden'; 
         document.getElementById(last_category).style.top='1px'; 
         document.getElementById(last_category).style.height='1px'; 
         document.getElementById(last_header).style.backgroundColor='#DCDCDC';
         clearInterval(hider);
      }
      document.parameters.last_category.value = category;
      document.parameters.last_id.value = id;
      var header = "header"+category;
      bh = get_browser_height();
      st = document.body.scrollTop;
      sh = document.body.scrollHeight;
      aw = document.body.scrollHeight - sh
      document.getElementById(category).style.height=''; 
      document.getElementById(category).style.top= ypos; 
      ch = document.getElementById(category).clientHeight;
      if(ypos + ch > bh + st)  {
         // alert(' b:'+bh +' y:' + ypos + ' s:' + st +' sum:'+ (ypos+st+ch));
         oh = (ypos+ch) - bh + 5 -st;  
         document.getElementById(category).style.top = parseInt(document.getElementById(category).style.top) - oh;
      } 
      document.getElementById(category).style.visibility='visible'; 
      document.getElementById(category).style.overflow='visible'; 
      document.getElementById(header).style.backgroundColor=hl_color;
      new_category=category;
      clearInterval(hider);
      hider = setInterval('hide_menu();',close_delay);
   } else {
      document.parameters.last_category.value = "";
      document.parameters.last_id.value = "";
      var header = "header"+category;
      document.getElementById(category).style.visibility='hidden'; 
      document.getElementById(category).style.top='1px'; 
      document.getElementById(category).style.height='1px'; 
      document.getElementById(category).style.overflow='hidden'; 
      document.getElementById(header).style.backgroundColor='#DCDCDC';
   }
}
var x_left=0;
var x_right=0;
var y_top=0;
var y_bottom=0;
var bh;
var ch;
var oh;
var sh;
var st;
function hide_menu() {
   if(document.parameters.last_category.value == "") {return;}
   var last_category = document.parameters.last_category.value;
   var last_id = document.parameters.last_id.value;
   x_left = document.getElementById(last_category).offsetLeft; 
   x_right = x_left + document.getElementById(last_category).offsetWidth; 
   y_top = document.getElementById(last_category).offsetTop;
   y_bottom = y_top + document.getElementById(last_category).offsetHeight; 
   if((xpos >= x_left && xpos <= x_right) && (ypos >= y_top && ypos <= y_bottom)) {
      return;
   }
   expand(last_category,last_id);
	 clearInterval(hider);
}
var new_category,browser_height;
function get_browser_height() {
  browser_height = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    browser_height = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    browser_height = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    browser_height = document.body.clientHeight;
  }
  return browser_height;
}
function live_support() {
   window.open('http://www.netonecom.net/phplive/request.php?l=tlyon&x=1&deptid=1','support','scrollbars=yes,resizable=yes,width=470,height=370');
}
var IE = document.all?true:false;
if (!IE) { 
   document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = getMouseXY;
var xpos = 0;
var ypos = 0;
function getMouseXY(e) {
   if (IE) {
      xpos = event.clientX + document.body.scrollLeft;
      ypos = event.clientY + document.body.scrollTop;
   } else { 
      xpos = e.pageX;
      ypos = e.pageY;
   }  
   if (xpos < 0) {xpos = 0;}
   if (ypos < 0) {ypos = 0;}  
   return true;
}
var close_delay = 5000;
var hider;
var setsupport;
function change_category() {
	 document.getElementById('news_content').src="/menu/bookmarks_news.php?category="+document.news_category.category.value;
}	 
function show_news() {
   var news_content = "<iframe id='news_selector' name='news_selector' frameborder=0 scrolling=no class='external_content_iframe_selector' src='/menu/bookmarks_news_selector.php?startup=1'></iframe>";
   news_content += "<br><iframe id='content' name='news_content' frameborder=0 scrolling=yes class='external_content_iframe' src='/menu/bookmarks_news.php'></iframe>";
   document.getElementById('external_content_iframe').innerHTML=news_content;
}   
function show_weather() {
   var weather_content = "<center><table class='weather_header' cellpadding=0 cellspacing=0><tr><td width='100%' align='right'><img src='/menu/close_frame.gif' alt='' title='Close weather' width='20' height='20' onClick=\"close_frame();\"></td></tr></table></center><iframe id='content' frameborder=0 scrolling=no class='external_weather_content_iframe' src='/menu/bookmarks_weather.php'></iframe>";
   document.getElementById('progress').innerHTML="<img width='220' height='18' src='/menu/progress.gif' alt=''><br><div align='center' style='position: relative; background-color: white; border: 1px solid black; top: -33px; left: 15px; width: 80%; text-align: center;'>Accessing weather...</div>";
   document.getElementById('external_content_iframe').innerHTML=weather_content;
}   
function close_frame() {
   document.body.scrollLeft=0;
   document.body.scrollTop=0;
   document.getElementById('content').src="http://www.netonecom.net/menu/dummy.html";
   document.getElementById('external_content_iframe').innerHTML="&nbsp;";
   document.getElementById('focus_control').focus();
}
function show_support() {
	 set_support = setTimeout("clear_support();",10000);
   var support = "<iframe id='support_dkdkd' name='ffkekkeke' frameborder=0 scrolling=no class='support_frame' src='/menu/bookmarks_support.html'></iframe>";
   return support;
 }   
function clear_support() {
	 clearTimeout(set_support);
   document.getElementById('support_cell').innerHTML = "<img src=\"/menu/live_support.gif\"><br><span class=\"support\">Support</span>";
 }   
function web_search(type) {
	 if(type == 1) {
			if(document.google_search.search_google.value == "") {
				 window.location="http://www.google.com";
			} else {		
				 window.location='http://www.google.com/search?q='+escape(document.google_search.search_google.value)+'&amp;start=0&amp;ie=utf-8&amp;oe=utf-8';
			}	 
	 } else if(type == 2) {
			if(document.netone_search.search.value != "") {
				 window.location='http://www.google.com/search?as_q='+escape(document.netone_search.search.value)+'&amp;start=0&amp;ie=utf-8&amp;oe=utf-8&as_sitesearch=www.netonecom.net';
			}	 
	 } else if(type == 0) {
			if(document.yahoo.search.value == "") {
				 window.location="http://www.yahoo.com";
			} else {		
				 window.location='http://search.yahoo.com/search?p='+escape(document.yahoo.search.value)+'&Smylers=Yahoo%21+Search&fr=FP-tab-web-t-298&toggle=1&cop=&ei=UTF-8';
			}	 
   }	 
}	 
