var userName = new Array();  
userName[0]="247info"; 
userName[1]="247mcb"; 
userName[2]="247webmaster";

var userNameFull = new Array(); 
userNameFull[0]="E-Mail Us"; 
userNameFull[1]="General";
userNameFull[2]="WebMaster"; 

var userSubject= new Array()
userSubject[0]="Query from 247highway News Blog"; 
userSubject[1]="Here's a Query from the 247highway News Blog";
userSubject[2]="Query for 247highway  News Blog WebMaster"; 

var siteName = "247highway.com?subject=";
i=0;
do userName[i]='<a href=\"mailto:' + userName[i] + '@' + siteName + userSubject[i] +'\">' + userNameFull[i] + '</a>';
while(userName[++i]);
// end of email section



userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}


// OPEN NEW MYWINDOW
var abc;
function mywindow(myurl, myname, nwidth){
abc=window.open(myurl, myname, nwidth);
abc.focus();
return false;
}

//OPEN A WINDOW FOR TELEPHONE NUMBERS
var phonewindow;
function myphonewindow(phonepage)
{
         var windowFeatures="left=300,top=300,width=490,height=215";
         phonewindow = window.open(phonepage,"phonenumbers",windowFeatures);
         phonewindow.focus();
         return false;
}


//TO OPEN A NEW WINDOW WITH AN EMAIL ADDRESS TELLAFRIEND
var tellwindow;
function mytellwindow(tellpage)
{
         var windowFeatures="left=300,top=300,width=350,height=200";
         tellwindow = window.open(tellpage,"tellafriend",windowFeatures);
         tellwindow.focus();
         return false;
}


//TO FORCE A PAGE INTO THE FRAME LAYOUT
function frameMe(cURL){
    //name of the frameset page (be sure to add path info)
    var frameset = cURL;

    //name of the frame to load document into
    var frame = "mainframe";

    page = new String(self.document.location.pathname);
	//alert(page);
    if(window.name != frame){
      var contents = frameset + "?" + page + "&" + frame;
      top.location.replace(contents);
    }
    return;
  }
  
  //TO CLOSE AN OPEN WINDOW
function window_onunload(){
 		 if (typeof(farmpicswindow) != "undefined" && farmpicswindow.closed == false)	 {
		 farmpicswindow.close();
		 }
}
  
//USED FOR PRELOADING
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}




//used to force into a frame
  function loadDoc(){
    //an array containing the querystring portion of the URL
    // of the page being loaded into this frame
    var query = window.location.search.split('&');

    //the first member of that array (without the "?"): the page name
    var page = query[0].substr(1);

    //the second member of that array: the frame name
    var frame = query[1];

    if(page && frame){
      //only do the replacement if there was a querystring to parse
      var contents = "top." + frame + ".location.replace('" + page + "')";
      eval(contents);
    }
    return;
  }

  
  /****************TO PUT IN THE DATE*/
function myDate() {
today=new Date();
today.setDate(today.getDate()-3);
day=today.getDate();
year=today.getFullYear();
month=today.getMonth()+1;
if (day==1) end=("st");
else if (day==2) end=("nd");
else if (day==3) end=("rd");
else if (day==21) end=("st");
else if (day==22) end=("nd");
else if (day==23) end=("rd");
else if (day==31) end=("st");
else end=("th");
if (month==1) cname=("January");
else if (month==2) cname=("February");
else if (month==3) cname=("March");
else if (month==4) cname=("April");
else if (month==5) cname=("May");
else if (month==6) cname=("June");
else if (month==7) cname=("July");
else if (month==8) cname=("August");
else if (month==9) cname=("September");
else if (month==10) cname=("October");
else if (month==11) cname=("November");
else cname=("December");
/*if (year<100) year="19" + year;*/
document.write(cname + " " + day + end + ", " + year);
}

//SCROLLING NEW WINDOW
var myscrollwindow;
function myscrollwindow(myscrollpage)
{
         var windowFeatures="left=25,top=50,width=950,height=550,scrollbars,menubar=yes,toolbar=yes,resizable";
         myscrollwindow = window.open(myscrollpage,"myscrollnumbers",windowFeatures);
         myscrollwindow.focus();
         return false;
}

