All pastes #922082 Raw Edit

Stuff

public text v1 · immutable
#922082 ·published 2008-02-28 16:06 UTC
rendered paste body
// JavaScript Document
 
function postRequest(strURL){
	var xmlHttp;
	if(window.XMLHttpRequest){ // For Mozilla, Safari, ...
		var xmlHttp = new XMLHttpRequest();
	}
	else if(window.ActiveXObject){ // For Internet Explorer
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlHttp.open('POST', strURL, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.onreadystatechange = function(){
	if (xmlHttp.readyState == 4){
		updatepage(xmlHttp.responseText);
		}
	}
	xmlHttp.send(strURL);
}

function updatepage(str){
	if(str=="yes"){
		window.location = "/cfa/secure/index.php";
}
	

	else if(str=="loggedout") {
	
		alert("You have been logged out");
		loginElement = document.getElementById("loginPrompt");
 		loginElement.className = "loginHide";
		origMenu();
	}
	
	else if(str=="success") {
	
		alert("Saved");
		
	}
	
 	
	else {
	
		alert("Incorrect Username or Password");
		
	}

} 

function call_savedata(retVar,imgID){

	var name = window.document.getElementById("imgTitle" + retVar).value;
	var desc = window.document.getElementById("imgDesc" + retVar).value;
	var tags = window.document.getElementById("imgTags" + retVar).value;
	


	var url = "ajaxSave.php?ajaxAct=true&retVar=" + retVar + "&imgId=" + imgID + "&imgTitle=" + name + "&imgDesc=" + desc + "&imgTags=" + tags;

	postRequest(url);
} 




function call_logout(){
	var url = "logout.php?logout" ;

	postRequest(url);
}