// JavaScript Document
function ChangeOption() {
	//document.getElementById('selectOption').focus();
	var Option = document.getElementById('selectOption').value;
	document.getElementById("LoadingDiv").style.display = "block";
	
	
	if(Option != "A") {
		document.getElementById("optionBtn").style.display = "none";
		document.getElementById("contOption").style.display = "block";
		document.getElementById("go_div").style.display = "none";
		
		http.open("get","locatorajaxPages.php?r="+Math.random()+"&code="+Option+"&type=option");
		http.onreadystatechange = handleHttpSelLocator;
		http.send(null);
		return true;
	}
	else {
		document.getElementById("optionBtn").style.display = "block";
		document.getElementById("contOption").style.display = "none";
		document.getElementById("LoadingDiv").style.display = "none";
		
		document.getElementById("go_div").style.display = "block";
		//document.getElementById('optionBtn').focus();
	}
	
}


function handleHttpSelLocator() {
	if(http.readyState==4) {
	//alert(http.responseText)
	response = http.responseText;
	//setTimeout("document.getElementById('LoadingDiv').style.display = 'none'", 200);
	document.getElementById("LoadingDiv").style.display = "none";
	//response = http.responseText.split('|');
		if(response[0] != 0) {
		 document.getElementById('contOption').innerHTML = response;
		 
		 
		 $(document).ready(function(){
		 $("ul.dropdown li").hover(function(){
											
		   $(this).addClass("hover");
		   $('> .dir',this).addClass("open");
		   $('ul:first',this).css('visibility', 'visible');
		 },function(){
			 //alert("jj");
		   $(this).removeClass("hover");
		   $('.open',this).removeClass("open");
		   $('ul:first',this).css('visibility', 'hidden');
		 });
		});
		 
		 
		 document.getElementById('address1').focus();
		 
		}
	}
}

function OptionAllClick() {
	window.location.href='studioListing.php';
}
