var opened = 0;
var openSpecials = 0;

function resize(w,h)
{
	top.moveTo(0,0); 
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
   }
   else top.resizeTo(w,h);
 }
}

function fullHeight(w)
{
	var h = screen.availHeight;	
	if (h > 600) h = 600;
	top.resizeTo(w,h);
}

function openFrame(popurl)
{
	var x = (screen.availWidth-790)/2;
	var y = (screen.availHeight-460)/2;
	

	var winoptions = "width=790, height=460, left="+x+", top="+y+", scrollbars=1,menubars=0,toolbars=0,location=0,resizable=1";
	if(openSpecials > 0) {
		specialsPop.close();
		openSpecials--;
	}
	specialsPop=window.open(popurl,"",winoptions)
	openSpecials++;
}


function fullScreen()
{
	top.moveTo(0,0); 
	top.resizeTo(screen.availWidth,screen.availHeight)
}

function openpopup(popurl, width, height,status){
	var winoptions = "width="+width+", height="+height+", left=1, top=1, scrollbars=1,menubars=0,toolbars=0,location=0,resizable=0,status=1";
	if(openSpecials > 0) {
		specialsPop.close();
		openSpecials--;
	}
	
	specialsPop=window.open(popurl,"",winoptions);	
	openSpecials++;
}
function openpopup2(popurl, width, height){
	var winoptions = "width="+width+", height="+height+", left=1, top=1, scrollbars=1,menubars=0,toolbars=0,location=0,resizable=1,status=1";
	if(openSpecials > 0) {
		specialsPop.close();
		openSpecials--;
	}
	specialsPop=window.open(popurl,"",winoptions)
	openSpecials++;
}
function imgpopup(popurl, width, height) 
{
	var winoptions = "width=" +width+ ",height=" +height+ ", left=20, top=20";
	if(opened > 0) {
		winpops.close();
		opened--;
	}
	winpops = window.open(popurl, "", winoptions);
	opened++;		
}

function viewImage(sel) 
{
	var index = sel.selectedIndex;
	if(index > -1) {
		imgpopup(sel.options[index].value, 1, 1);
	}
}

function viewSpecial(travel_type, sel) 
{
	index = sel.selectedIndex;
	if(travel_type == 1)
	travel_type = 6;

	if(index != -1) 
	{
		id = sel.options[index].value;
		popurl = "view.php?travel_type=" +travel_type+ "&id=" +id+ "&isPopup=1";
		openpopup(popurl);		
	}		
}
function show_agency()
{
	var agency = window.open("selectAgency.php", "Agency", "width=550,height=300,scrollbars,top=50,left=50");
}
function show_airports(code_type,form_type,variable)
{
	var airports = window.open("selectAirport.php?type="+code_type+"&form="+form_type+"&variable="+variable, "Airports", "width=450,height=300,scrollbars,top=50,left=50");
}

function get_prices(condo_id,week)
{
	open("getPrices.php?condo_id="+condo_id+"&week="+week, "Prices", "width=1,height=1,scrollbars=0,top=50,left=50");
}

function show_profiles(membership)
{
	var profiles = window.open("selectGuest.php?membership=" + membership, "Profile", "width=650,height=450,scrollbars,top=50,left=50");
}

function show_condos()
{
	var condos = window.open("selectCondo.php", "Condos", "width=650,height=450,scrollbars,top=50,left=50,toolbar=0,menubar=0,location=no");
}

function show_weeks()
{
	var weeks = window.open("selectWeek.php", "Units", "width=700,height=500,scrollbars,top=20,left=20");
}

function show_resorts(name,popupSubmit)
{ 
	var width = 650;
	if(popupSubmit == 1)
	   var width = 750;
	
	var resorts = window.open("selectResort.php?array_name=" + name + "&popupSubmit=" + popupSubmit, "Resorts", "width=" + width + ",height=450,scrollbars,top=50,left=50,location=no,status=1");
}

function show_tour()
{ 
	var resorts = window.open("selectTour.php", "Tour", "width=650,height=450,scrollbars,top=50,left=50");
}

function add_ship(prefix)
{
	var ships = window.open("addShip.php?prefix=" + prefix, "Ship", "width=450,height=250,scrollbars,top=50,left=50,resizable=1,status=1");
}

function show_travel(travel_type)
{
	var url = "selectTravel.php?travel_type="+travel_type+"";
	var travel_win = window.open("selectTravel.php", "Select a Travel Special", "width=650,height=450,scrollbars,top=50,left=50");
}

function show_img(travel_type,img_name,width,height)
{	
	var win_url = "viewImage.php?travel_type="+travel_type+"&img="+img_name+"";
	width -= 0; width += 8;
	height -= 0; height += 26;
	var win_options = "width="+width+",height="+height+",top=50,left=50";
	var img_win = window.open(win_url, "", win_options);
}





