//<!--

function setupXmlHttp()
{
	var xmlHttp;
  
  	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;        
			}      
		}    
	}
	
	return xmlHttp;
}

//Open a popup window for the editor
function openPopup(url)
{
	width=820;
	height=550;
	x=parseInt(screen.width/ 2.0) - (width /2.0);
	y=parseInt(screen.height/ 2.0) - (height /2.0);
	
	var win=window.open(url,"editorPopup","top="+y+",left="+x+",scrollbars=no,dialog=yes,minimizable=no,modal=yes,width="+width+",height="+height+",resizable=no");
}

//Popup window for other popups
function openAPopup(url, x, y)
{
	width=x;
	height=y;
	x=parseInt(screen.width/ 2.0) - (width /2.0);
	y=parseInt(screen.height/ 2.0) - (height /2.0);
	
	var win=window.open(url,"popup","top="+y+",left="+x+",scrollbars=no,dialog=yes,minimizable=no,modal=yes,width="+width+",height="+height+",resizable=no");
}

function getContent(val1, val2)
{
	var xmlHttp = setupXmlHttp();
	
	try
    {
		xmlHttp.onreadystatechange=function()
		{	
			if(xmlHttp.readyState==4)
    		{
				//Get the ajax response
				var passedString = xmlHttp.responseText.substring(xmlHttp.responseText.indexOf('ajaxResults[')+12,xmlHttp.responseText.indexOf(']ajaxResults'));
			
				//Reload the page
				window.location.reload();
			
				//Apply it to the page
				document.getElementById(val2).innerHTML = passedString;
    		}
		}
	}
    catch (e)
    {        
		alert("Your browser does not support AJAX!");        
	}
	
	var url = "ajax/getContentBlockData.aspx?template=" + val1 + "&area=" + val2;
	
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function report(message,url,line) 
{
    //alert('Error : ' + message + ' at line ' + line + ' in ' + url);
    return true;
}

//-->