window.onload=initAll;

var xhr = false;

var xPos, yPos;
//----------------------------------------

function initAll(){

	/*
	var allLinks=document.getElementsByTagName("a");
	for(var i=0; i<allLinks.length; i++){
		allLinks[i].onmouseover=showPreview;
	}
	*/

	document.getElementById("pkgDealLink").onmouseover=showPreview;

}
//----------------------------------------
function showPreview(evt){

	makeRequest(evt);
	return false;

}
//----------------------------------------
function hidePreview(){
	document.getElementById("popOut").style.visibility="hidden";

}

//----------------------------------------

function makeRequest(evt){

	if(evt){
		//var url=evt.target;
		var url="sr_rates_packages.txt";
	}else{
		evt=window.event;
		//var url=evt.srcElement;
		var url="sr_rates_packages.txt";//ie is displaying default target
	}
	xPos=evt.clientX;
	yPos=evt.clientY;

	if(window.XMLHttpRequest){
		xhr=new XMLHttpRequest();	
	}else{
		//be sure using latest ActiveX object for IE
		if(window.ActiveXObject){
			try{
				xhr=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(xhr){
		xhr.onreadystatechange=showContents;
		xhr.open("GET", url, true);
		xhr.send(null);
	}else{
		//display error note.
		//may not wish to display for esthetics
		//alert("ERROR! XMLHttpRequest could not be created./n Browser may not support this type of request.");
	}

}//END makeRequest(url)
//----------------------------------------

function showContents(){

	var prevWin=document.getElementById("popOut");

	if(xhr.readyState==4){

		prevWin.innerHTML=(xhr.status==200)?xhr.responseText:"There was a problem with the request "+xhr.status;

		prevWin.style.top=parseInt(yPos)-180+"px";
		prevWin.style.left=parseInt(xPos)-100+"px";

		prevWin.style.visibility="visible";
		prevWin.onmouseout=hidePreview;

	}

}//END showContents