/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
window.XMLHttpRequest = function() { return new ActiveXObject('Microsoft.XMLHTTP') }
@end @*/

function gel(elid){
	return document.getElementById(elid);
}

function removeimage(imgname){
	if (confirm('Rimuovere l\'immagine?')){
		gel('img_preview').innerHTML = '<!-- // -->';
		touch_url('include/img_tools.php?rmid=' + imgname);
	}
}

function touch_url(x_url) {
	this.req = new XMLHttpRequest();
	req.open('GET', x_url, true);
	req.send(null);
}

function getget(varname){
	var qs = location.search;

	qs = location.search.substring(1);
	var pairs = qs.split("&");

	var tmpAry;
	for(var i=0; i<pairs.length; i++){
		tmpAry = pairs(i).split("=");
		if (tmpAry(0) = varname) // name
			return tmpAry(1); // value
	}
	return false;
}

function checkContactForm(){
	if (gel('cf_name').value != '' && gel('cf_message').value != ''){
		gel('cf_source').value = 'human';
		return true;
	} else {
		return false;
	}
}