function getcities(state, type, town){
	if (typeof town == 'undefined') town=0;
	//document.getElementById('venues').innerHTML = "";
	//if (state=='all') { document.hide.submit(); }
	//else {
	var xmlhttp=false; //Clear our fetching variable
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object�
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	if (type==2 & state=='all') location.href="/venues_page.php" ;
	else {
	var file = 'gettowns'+type+'.php?town='+town+'&state='; //This is the path to the file we just finished making *
	xmlhttp.open('GET', file + state, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText; //The content data which has been retrieved ***
			if( content ){ //Make sure there is something in the content variable
				document.getElementById('towns').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
			}
		}
		else {
			
			document.getElementById('towns').innerHTML = '<div class="loader"><img src="/images/loader'+type+'.gif"></div>';
		}
	}
	xmlhttp.send(null) //Nullify the XMLHttpRequest
	return;
	}
}



function getVenues(city, state){

	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	xmlhttp.open('GET', 'getvenues.php?state=' + state + '&city=' + city, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText;
			if( content ){
				document.getElementById('venues').innerHTML = content;
			}
		}
		else {
			document.getElementById('venues').innerHTML = '<div class="loader"><img src="/images/loader1.gif"></div>';
		}
	}
	xmlhttp.send(null)
	return;
}


function getVenuesBut(city, state, venue){

	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	xmlhttp.open('GET', 'getvenues_but.php?state=' + state + '&city=' + city + '&venue=' + venue, true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText;
			if( content ){
				document.getElementById('venues_but').innerHTML = content;
			}
		}
		else {
			document.getElementById('venues_but').innerHTML = '<div class="loader"><img src="/images/loader1.gif"></div>';
		}
	}
	xmlhttp.send(null)
	return;
}


function getArtists(letter){

	//document.getElementById('buttons').innerHTML = "";

	var xmlhttp=false; //Clear our fetching variable
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object�
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	var file = 'getartists.php?letter='; //This is the path to the file we just finished making *
	xmlhttp.open('GET', file + letter, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText; //The content data which has been retrieved ***
			if( content ){ //Make sure there is something in the content variable
				document.getElementById('artistsSelect').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
			}
		}
		else {
			document.getElementById('artistsSelect').innerHTML = '<div class="loader"><img src="/images/loader.gif"></div>';
		}
	}
	xmlhttp.send(null) //Nullify the XMLHttpRequest
	return;
}


function getTours(artist){

	var xmlhttp=false; //Clear our fetching variable
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object�
	} catch (e) {
		try {
			xmlhttp = new
			ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	var file = 'gettours.php?artist='; //This is the path to the file we just finished making *
	xmlhttp.open('GET', file + artist, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)) { //Check if it is ready to recieve data
			var content = xmlhttp.responseText; //The content data which has been retrieved ***
			if( content ){ //Make sure there is something in the content variable
				document.getElementById('view_art').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
			}
		}
		else {
			document.getElementById('view_art').innerHTML = '<div class="loader"><img src="/images/loader.gif"></div>';
		}
	}
	xmlhttp.send(null) //Nullify the XMLHttpRequest
	return;
}

function DisplayVenueReviews()
{
	document.venuesForm.action = "ven_reviews.php"    // First target
	document.venuesForm.target = "_self";    // Open in a iframe
	document.venuesForm.submit();        // Submit the page
	return true;
}

function validateNum(e, trg)
{
var keynum
var keychar
var numcheck

var tekvalue=trg.value;
//alert (tekvalue)

if(window.event) // IE
{
keynum = e.keyCode
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.which
}
keychar = String.fromCharCode(keynum)
numcheck = /\d/

// izkluchvam <,>, delete, backspace
if ((keynum!= 37)&(keynum!= 39)&(keynum!= 46)&(keynum!= 8)&(keynum!=undefined)) {
if (!numcheck.test(keychar)) {
//window.alert("Digits only");
return false;}
}

}
