function closeWindow(){
	pae_window.window.close();
	}
	
function updateContentArea(divName, varsPassed, url, fName) {
	function handleHttpResponse() {
		if (http.readyState == 4) {
			if (http.responseText.indexOf('invalid') == -1) {
				if(divName.length>0){
					if(document.getElementById(divName)){
						document.getElementById(divName).innerHTML =  http.responseText; 
					}
				
					if(fName){
						eval(fName);
					}					
				}
			}
		}
	}	

	if (window.XMLHttpRequest){
		// If IE7, Mozilla, Safari, etc: Use native object
		var http = new XMLHttpRequest();
	}else{
		if (window.ActiveXObject){
			// ...otherwise, use the ActiveX control for IE5.x and IE6
			var http = new ActiveXObject("Microsoft.XMLHTTP"); 
		}
	}


	if (http) {	  
		http.open("GET", url + "?" + varsPassed, true);
		http.onreadystatechange = handleHttpResponse;
		http.send(null);
	}
}

function getHTTPObject() {
	var xmlhttp = '';
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
			} catch (e) {
			xmlhttp = false;
			}
		}
	return xmlhttp;
	xmlhttp = null;
}

//var http = getHTTPObject(); // We create the HTTP Object

function addBlock(ID, location){
	url = location+"tigeradmin/modules/edit_content.php";
	varsPassed = "action=add&Group_ID="+ID;
	divName = "pointAndEdit_"+ID;
	updateContentArea(divName, varsPassed, url);
	}
	
function deleteBlock(Group, ID, location){
	if(confirm('Are you sure you want to delete this block?')){
		url = location+"tigeradmin/modules/edit_content.php";
		varsPassed = "action=delete&Group_ID="+Group+"&ID="+ID;
		divName = "pointAndEdit_"+Group;
		updateContentArea(divName, varsPassed, url);
		}else{
		}
	}

function open_edit_window(ID, format, bgColor, location){
	pae_window = open(location+"tigeradmin/modules/edit_content.php?bgColor="+bgColor+"&location="+location+"&format="+format+"&ID="+ID,"pae_window","toolbar=no,scrollbars=no,resizable=no,width=600,height=400")
	}			
