/********************************************************************************************************/
/* Project:		PHPLinkDirectory: Link exchange directory @ http://www.phplinkdirectory.com/			*/
/* Mod:			[Get Meta] @ http://www.monster-submit.com/phpld/										*/
/* Version:		3.00																					*/
/* Notice:		Maintain this section																	*/
/* Author:		Virtual Solutions																		*/
/* License:		Copyright (c) 2006 - 2007 Virtual Solutions												*/
/*																										*/
/* Any redistribution of phpLD_Vault mods without the expressed written consent of Virtual Solutions is	*/
/* strictly prohibited. Copying any of the code contained within any phpLD_Vault mod and claiming it as	*/
/* your own is also prohibited. You may not remove any header notices from any mods. By using these		*/
/* phpLD_Vault mods, you agree to indemnify Virtual Solutions from any liability that might arise from	*/
/* their use.																							*/
/*																										*/
/* PHPLD_VAULT MODS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING	*/
/* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND			*/
/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES	*/
/* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN	*/
/* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.							*/
/********************************************************************************************************/

function getMeta(url) {
	var tags 			= new Array(new Array("title", "TITLE"), new Array("description", "DESCRIPTION"), new Array("keywords", "META_KEYWORDS"), new Array("description", "META_DESCRIPTION")); 
	outerArraylength	= tags.length;
	for(i=0; i < outerArraylength; i++) {

		try {
			req = new XMLHttpRequest();
		} catch(e) {
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (E) {
					req = false;
				} 
			} 
		}
		var tag					= tags[i][0];
		var field				= tags[i][1];
		req.onreadystatechange	= function() {getResponse(field);};
		furl					= url + "&tag=" + tag;
		req.open("GET", furl, true);
		req.send(null);
	}
}

function getResponse(pageElement) {
	if (req.readyState == 4) {
		if (req.status == 200) { document.forms['submission'][pageElement].value = req.responseText; }
		else { document.forms['submission'][pageElement].value = req.statusText; }
	}
}
