
// status bar
// ==============================

window.status= ":: Genext, LLC - Technology Made Simple ::"


// Redirect Disclaimer
// =================================

function openDisclaimer(URL){
	win = window.open('http://portal.genext.us/disclaimer/index.html?http://'+URL, 'intermediate', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=370,height=210');
}


// Douglas County Fiber Search
// =================================

function submitsearchrequest(URL)
	{
		//Builds URL to DCPUD search form(public)
		url="http://www.dccn.net/ServiceAddressResults.aspx?Number="
		url+=escape(parseInt(document.Searchform.Address.value));
		url+="&City="
		url+=escape(document.Searchform.City.value);
		//Opens URL
		window.open(url,target="_blank");
	}


// Window functions
// =================================

function stopError() {
	return true;
	}
window.onerror = stopError;

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);

function P7_OpResizeFix(a) { //v1.1 by Project VII reloads Opera
if(!window.opera){return;}if(!document.p7oprX){
 document.p7oprY=window.innerWidth;document.p7oprX=window.innerHeight;
 document.onmousemove=P7_OpResizeFix;
 }else{if(document.p7oprX){
  var k=document.p7oprX-window.innerHeight;
  var j=document.p7oprY - window.innerWidth;
  if(k>1 || j>1 || k<-1 || j<-1){
  document.p7oprY=window.innerWidth;document.p7oprX=window.innerHeight;
  location.reload();}}}
}
P7_OpResizeFix();

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function close_window() {
    window.close();
}

function window_LOA(){
      pop_up = window.open('http://portal.genext.us/library/legal/LoA.pdf','LOA','scrollbars=yes,top=0,left=0,screenX=0,screenY=0');
      pop_up.focus();
}


// Date functions
// ==============================

function getDate() {
	var d=new Date()
	var dayname=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	var year=d.getFullYear()
	year=year.toString()
	year=year.substring(2,4)

	document.write(dayname[d.getDay()] + ", ")
	document.write(monthname[d.getMonth()] + ". ")
	document.write("<b>"+d.getDate() + "</b> .")
	document.write(year)
}

function letter_date()
{
var today = new Date();
var numerical_month=today.getMonth();
var date=today.getDate();
var year=today.getFullYear();
var month_array = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');
var month_name = month_array[numerical_month];
var date_string=month_name+' '+date+', '+year;
document.write(date_string);
}


// Image functions
// ==============================

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


// Jump Menu functions
// =================================

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}


// Form functions
// ==============================

function firstFocus()
{
   if (document.forms.length > 0)
   {
      var TForm = document.forms[0];
      for (i=0;i<TForm.length;i++)
      {
         if ((TForm.elements[i].type=="text")||
           (TForm.elements[i].type=="textarea")||
           (TForm.elements[i].type.toString().charAt(0)=="s"))
         {
            document.forms[0].elements[i].focus();
            break;
         }
      }
   }
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


// Add to favorites
// =================================

/* Add to Favorites / Bookmarks or Sidebar Script. v1.0
Copyright (c) 2003 dazdezines.com. All rights reserved.*/

function dd_uniBookmark() { //v1.0 www.dazdezines.com/mme
	if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) {
    window.sidebar.addPanel ( document.title,'http://'+linkSidebar,'');
    /* Gecko (Netscape 6 etc.) - add to Sidebar */
	} else if( window.external && navigator.platform == 'Win32' ) {
    window.external.AddFavorite( location.href, titleText );
	} else if( window.opera && window.print ) {
    /* Opera 6+ - add as sidebar panel to Hotlist */
	return true;
	} else if( document.layers ) {
    /* NS4 & Escape - tell them how to add a bookmark quickly */
    window.alert( 'Please click OK then press Ctrl+D to create a bookmark.' );
	} else {
    /* other browsers - tell them to add a bookmark (adds current page, not target page) */
    window.alert( 'Please use your browser\'s bookmarking facility to create a bookmark\r\rPlease email dwsupport@dazdezines.com telling us your\rbrowser type and version so that we can update this script\rto add support for your browser.\r\rThankyou for your support and help.' );
	}
  return false;
}

var ns6LnkText = "Add our Sidebar"; //ns6+
var ie4LnkText = "Add to Favorites"; //ie4+
var op6LnkText = "Bookmark & Add to Hotlist"; //op6+
var ns4LnkText = "Bookmark this page"; //ns4+
var LinkURL = "javascript:;";
var linkSidebar = "portal.genext.us/sidebar.html" //ns6+
var titleText = "Genext | Security, Communications, Entertainment"; //ie4+ & op6+

if (typeof window.sidebar == "object" /* NS6+ */ ) { linkText = ns6LnkText; }
else if (window.external /* IE4+ */ ) { linkText = ie4LnkText; }
else if (window.opera /* OP6+ */ ) { linkText = op6LnkText; }
else { linkText = ns4LnkText ; /* NS4+ & Unknown */ }
if (window.opera) { lnkURL = document.location.href;
} else { lnkURL = LinkURL; }

function mOver() {
self.status='Click here now to visit this site'; return true;
}
function mOut() {
self.status=''; return true;
}

/* automatically set all links to use link frameset */
d = document.links; f = "file:"; j = "javascript:"; m = "mailto:"; t = "extLinks";
for (i = 0; i < (d.length); i++)
if (d[i].protocol != f && d[i].protocol != j && d[i].protocol != m && d[i].hostname != document.domain) {
	d[i].title = "External link to " + d[i].href;
	d[i].onmouseover = mOver
	d[i].onmouseout = mOut
	d[i].href = fileLoc + 'lnkframe.htm?' + escape(d[i].href);
	d[i].target = t;
}
