var newwindow;
function open_window_check(myURL){
		//alert(myURL);
		//if (newwindow.opener == null) newwindow.opener = self;
		//alert(opener.window);
		if (window.opener && !window.opener.closed){
			window.opener.location.href  = myURL;
			window.opener.focus();
			window.close();
		}
		else
		{
			window.location = myURL;
		}
		
		return true ;
}

function poptastic(bizID,editBizPage)
{
	if (editBizPage == null){
   		editBizPage = 0;
 	}
	
	if (bizID == ''){
		bizID=1;
	}
	newwindow=window.open('guide.php?directPass=1&action=search&business_id='+bizID+'&editBizPage='+editBizPage+'','name','height=700,width=700,resizable=yes,scrollbars=yes,toolbar=no,status=yes');
	if (window.focus) {newwindow.focus()}
	if (newwindow.opener == null) newwindow.opener = self;
}

function LoadWin(filename, windowname, width, height)
{       
	
	newwindow=window.open(filename,windowname,'height='+height+',width='+width+',resizable=yes,scrollbars=yes,toolbar=no,status=yes');
	if (window.focus) {newwindow.focus()}
	if (newwindow.opener == null) newwindow.opener = self;

}


function cForm() {
window.open('treasurehuntform.jsp','mywin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=600,width=670');
document.treasurehuntsubmit.submit();
}

function loadMusic(URL) {
musicPlayer = window.open(URL,'musicPlayer','width=284,height=200,top=30,left=20');
}

function closeWindow() {
		if (musicPlayer && musicPlayer.open && !musicPlayer.closed) {
			musicPlayer.close()
		}
	}
	
function loadbizpage(url) {
window.location = url;
}


function menu_goto( menuform )
{
    // see http://www.thesitewizard.com/archive/navigation.shtml
    // for an explanation of this script and how to use it on your
    // own site

    var baseurl = "" ;
    
	selecteditem = menuform.city.selectedIndex ;
    newurl = menuform.city.options[ selecteditem ].value ;
    alert(baseurl + newurl);
	if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
	
}

function swapImage(image) {
	document.getElementById('IMG1').src = image;
}

function go()
{
	
	box = document.forms[1].city;
	destination = box.options[box.selectedIndex].value;
	//alert(destination);
	if (destination) location.href = destination;
}

function printpage() {window.print();}

function openpanoset(id,action){
		if (window.opener && !window.opener.closed){
			opener.location.href  = 'guide.php?setpanorama='+id+'&action='+action;
			opener.focus();
			window.close();
		}
		else
		{
			window.location = 'guide.php?setpanorama='+id+'&action='+action;
		}
		
		return true ;
	//action=biz_panoset for business internal
	//action=[blank] for external
	/*opener.location.href  = 'guide.php?setpanorama='+id+'&action='+action;
	opener.focus();
	window.close();
	return true ;*/
}
x = 20;
y = 70;
function setVisible(obj,image,status)
{
	obj = document.getElementById(obj);
	obj.style.background ='#FFFFFF url('+image+') center top no-repeat';
	//alert(image);
	if (status == 1){
		obj.style.visibility = 'visible';
	}else{
		obj.style.visibility = 'hidden';	
	}
//obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}	
// function reloadMusicWin() {
//	if (musicPlayer && musicPlayer.open && !musicPlayer.closed) {
//			musicPlayer.location = "http://www.apple.com";
//		}
//	}


