	function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}

	function updateState()
        {
		if (xmlHttp.readyState == 3 || xmlHttp.readyState == 2 || xmlHttp.readyState == 1 || xmlHttp.readyState == 0)
                {
                	document.getElementById("valmessage").innerHTML = "";
                	document.getElementById("valbutton").style.background = "url(../img/validator/check_multi.png) 0 -25px no-repeat";
                	document.getElementById("valbutton").style.cursor = "wait";
                }

                                if (xmlHttp.readyState==4)
                                {
                                        if(xmlHttp.responseText == "0")
                                        {
                                                document.getElementById("valinval").style.background = "url(../img/validator/invalid_button.png)";
                                                document.getElementById("validator").style.background = "url(../img/validator/modulebg.png) 0 316px";
                                                document.getElementById("valmessage").innerHTML = "<p>Your website has failed validation.  This means that the code used in your website (syntax) is incorrectly written.  This will cause problems with the major search engines as well as your website's overall usability.</p><p>To have us validate your website, and improve your search engine results, please <a href=\"http://www.purewebdevelopment.com/contact-us/\" target=\"_blank\">contact us</a>.</p>";
                                        }
                                        if(xmlHttp.responseText == "1")
                                        {
                                                document.getElementById("valinval").style.background = "url(../img/validator/valid_button.png)";
                                                document.getElementById("validator").style.background = "url(../img/validator/modulebg.png) 0 158px";
                                        }
                                        if(xmlHttp.responseText == "2")
                                        {
                                                document.getElementById("valinval").style.background = "url(../img/validator/checkurl_button.png)";
                                                document.getElementById("validator").style.background = "url(../img/validator/modulebg.png)";
                                                document.getElementById("valmessage").innerHTML = "<p>The URL you have entered is not properly formatted, and cannot be checked. Please make sure to enter the entire URL, including 'http://' and 'www', if present.</p>";
                                        }
					document.getElementById("valbutton").style.background = "url(../img/validator/check_multi.png) 0 0 no-repeat";
                                        document.getElementById("valbutton").style.cursor = "pointer";
                                        //document.getElementById("valinval").innerHTML = "<a href=\"http://validator.w3.org/check?uri="+page+"\">Something</a>";
                                }
                        }

                        function isValid(str)
                        {

                                if (str.length==0){return;}
                                xmlHttp=GetXmlHttpObject();
                                var page=""+str;
                                var url="http://www.purewebdevelopment.com/valid/validate.php";
                                url=url+"?u="+str;

                                xmlHttp.onreadystatechange=updateState;
                                xmlHttp.open("GET",url,true);
                                xmlHttp.send(null);
                        }
