function ajax1(url,result)
{
	var xmlHttp;
	document.getElementById(result).innerHTML="";
	try	
	{  
		// Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}
	catch (e)
	{  
		// Internet Explorer  
		try
		{   
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
		}
		catch (e)
		{    
			try	
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
			}
			catch (e)
			{      
				alert("Your browser does not support AJAX!");      
				return false;      
			}    
		}  
	}


	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded;text/html;charset=utf-8");
	xmlHttp.setRequestHeader('If-Modified-Since', 'Wed, 15 Feb 2008 00:00:00 GMT');

	xmlHttp.send(null);



	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			document.getElementById(result).innerHTML=xmlHttp.responseText;
			frontSearch_ajax('popup_packages.php');
		}
	}
}



function show_popup1(url,w,h)
{
	var outer_box=document.createElement('div');
	outer_box.setAttribute('id','outer_box');
	document.body.appendChild(outer_box);

	var inner_box=document.createElement('div');
	inner_box.setAttribute('id','inner_box');
	document.getElementById('outer_box').appendChild(inner_box);
	document.getElementById('inner_box').style.width=w+"px";
	
	var availHeight;
    var availWidth;
 
    if(typeof(window.innerWidth) == 'number'){
        availHeight = window.innerHeight;
        availWidth = window.innerWidth;
    }else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
         availHeight = document.documentElement.clientHeight;
         availWidth = document.documentElement.clientWidth;
    }else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
         availHeight = document.body.clientHeight;
         availWidth = document.body.clientWidth;
    }

	 var indicatorWidth = w;
     var indicatorHeight = h;
     var left = (availWidth/2) - (indicatorWidth/2);
     var top = (availHeight/2) - (indicatorHeight/2);
     var indicator = document.getElementById('outer_box');
	 indicator.style.position="absolute";
     indicator.style.zIndex="999";
     indicator.style.top=top+"px";
     indicator.style.left=left+"px";
     indicator.style.display="block";

	ajax1(url,'inner_box');
}

function hide_context_menu()
{	
	if(document.getElementById("outer_box")!=null)
	{
		document.getElementById("outer_box").style.display="none";
	}
}
