function openExtLink(URL) {
	day = new Date();
	var id = "page" + day.getTime();
	eval(id + " = window.open(URL, '" + id + "', 'resizable=1,scrollbars=yes,width=800,height=600,left = 5,top = 5');");
	//id.focus();
}
function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
}
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=1,width=300,height=200,left = 357.5,top = 464.5');");
}
	
function popUp2(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=1,width=300,height=200,left = 357.5,top = 464.5');");
}
function popUpAgent(URL) {
	day = new Date();
	id = day.getTime();
	path = 'http://www.nex-tech.com/applicationdata/1/pix/Agents/';
	URL = path + URL;
	eval("page" + id + " = window.open(URL, '" + id + "', 'resizable=1,width=300,height=200,left = 357.5,top = 464.5');");
}
function ShowImage(imgName){
	//syntax <img id=\"pictures\" width=\"250\" src=\"" + ipath + images[0] + "\" onClick=\"ShowImage(pictures.src);\" alt=\"Click to view\">
	var ar = new Image;
	ar.src = imgName;
	var myWinWidth=ar.width;
	var myWinHeight=ar.height;
	if (myWinWidth>500)
		{
			var ratio = myWinWidth/myWinHeight;
			myWinWidth = 640;
			myWinHeight = 640/ratio;
		}
	var theUrl="Nex-techPics.html";
	var myWin = window.open(theUrl,'myWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + myWinWidth + ',height=' + myWinHeight + ',top=0,left=0');
	myWin.document.write("<img src=\"" + imgName + "\" width=\"100%\">");
}
function ShowImageScroll(imgName){
	//syntax <img id=\"pictures\" width=\"250\" src=\"" + ipath + images[0] + "\" onClick=\"ShowImage(pictures.src);\" alt=\"Click to view\">
	var ar = new Image;
	ar.src = imgName;
	var myWinWidth= 1.1 * ar.width;
	var myWinHeight= 1.1 * ar.height;
	if (myWinWidth>500)
		{
			var ratio = myWinWidth/myWinHeight;
			myWinWidth = 640;
			myWinHeight = 640/ratio;
		}
	var theUrl="Nex-TechPics.html";
	var myWin = window.open(theUrl,'myWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + myWinWidth + ',height=' + myWinHeight + ',top=0,left=0');
	myWin.document.write("<img src=\"" + imgName + "\" width=\"100%\">");
	myWin.focus();
}
function ShowImageAd(imgId){
	//syntax <img id=\"pictures\" width=\"250\" src=\"" + ipath + images[0] + "\" onClick=\"ShowImageAd('pictures');\" alt=\"Click to view\">
	var ar = document.getElementById(imgId); 
	var myWinWidth=ar.width;
	var myWinHeight=ar.height;
	var theUrl="Nex-techPics.html";
	var myWin = window.open(theUrl,'myWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + myWinWidth + ',height=' + myWinHeight + ',top=0,left=0');
	myWin.document.write("<img src=\"" + imgName + "\" width=\"100%\">");
}
function bookmarkpage(bookmark, url){
// example <a href="javascript:bookmarkpage('Nex-Tech Ad','http://www.nex-tech.com/FreeClassifieds.aspx')">Bookmark this ad!</a>
if (document.all)
window.external.AddFavorite(url, bookmark);
else if (window.sidebar)
window.sidebar.addPanel(bookmark, url, "");
}
/* code to use XMLHttp  */
var xmlHttp; 
var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0; 
var is_ie5 = (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0; 
var is_opera = ((navigator.userAgent.indexOf("Opera 6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0; 
//netscape, safari, mozilla behave the same??? 
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0; 
//stateChangeHandler will fire when the state has changed, i.e. data is received back 
// This is non-blocking (asynchronous) 
function stateChangeHandler() 
{ 
	//readyState of 4 or 'complete' represents that data has been returned 
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete'){ 
		//Gather the results from the callback 
		var str = xmlHttp.responseText; 
		//Populate the innerHTML of the div with the results 
		document.getElementById('nameList').innerHTML = str;
	} 
} 
// XMLHttp send GET request 
function xmlHttp_Get(xmlhttp, url) { 
	xmlhttp.open('GET', url, true); 
	xmlhttp.send(null); 
	} 
function GetXmlHttpObject(handler) { 
	var objXmlHttp = null;    //Holds the local xmlHTTP object instance 
	//Depending on the browser, try to create the xmlHttp object 
	if (is_ie){ 
		//The object to create depends on version of IE 
		//If it isn't ie5, then default to the Msxml2.XMLHTTP object 
		var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP'; 
	        
		//Attempt to create the object 
		try{ 
			objXmlHttp = new ActiveXObject(strObjName); 
			objXmlHttp.onreadystatechange = handler; 
		} 
		catch(e){ 
		//Object creation errored 
			alert('IE detected, but object could not be created. Verify that active scripting and activeX controls are enabled'); 
			return; 
		} 
	} 
	else if (is_opera){ 
		//Opera has some issues with xmlHttp object functionality 
		alert('Opera detected. The page may not behave as expected.'); 
		return; 
	} 
	else{ 
		// Mozilla | Netscape | Safari 
		objXmlHttp = new XMLHttpRequest(); 
		objXmlHttp.onload = handler; 
		objXmlHttp.onerror = handler; 
	} 
	    
	//Return the instantiated object 
	return objXmlHttp; 
} 

function sm(id)
{
    //window.status = "sm";
   	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';		
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function hm(id)
{
    //window.status = "hm";
  	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}