
///////////////////////////////////////
//                                   //
//        Updated: 01-02-2007        //
//           Graffiti Wall           //
//         FileName: tag.js          //
//    Written by midnightfun.co.uk   //
//       www.midnightfun.co.uk       //
//            Version 2.0            //
//     License: See license.html     //
//              © 2007               //
//                                   //
///////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
//                                                                         //
//             Editing is NOT allowed to any of the code below!            //
//                                                                         //
//   If you edit any of the code below this part the script may not work   //
//              and you will be in violation of the licence!               //
//                                                                         //
/////////////////////////////////////////////////////////////////////////////

var xmlHttp

function addtag(str)
{ 
var painttext=document.getElementById("graffiti").painttext.value
var url="./includes/graffiti.php?painttext=" + painttext
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true);
xmlHttp.send("");
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
refreshgraffitiwall()
document.getElementById('bttnsubmit').disabled=true
document.getElementById("graffiti").painttext.value=""
} 
} 

function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null

	if(window.ActiveXObject){

		try{
			objXmlHttp=new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch(er){
			try{
				objXmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch(er2){
				alert("Error. Scripting for ActiveX might be disabled") 
			}			
		}
		if(objXmlHttp){
			objXmlHttp.onreadystatechange=handler 
		}
	}
	else{ 
		try{
			objXmlHttp=new XMLHttpRequest()
			objXmlHttp.onload=handler
			objXmlHttp.onerror=handler 
		}
		catch(er3){
			alert("Error. Failed to init XMLHttpRequest")
		}
	}
	return objXmlHttp
}