function openPopup(windowname) {
	if (windowname == "policy") window.open("http://www.flycrc.com/popup_policy.asp?type=infants",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "printable") window.open("http://www.flycrc.com/search_print.asp",'_blank',"width=497,height=400,left=100,top=100,status=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=no");			
	else if (windowname == "fare") window.open("http://www.flycrc.com/popup_fare.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=no");			
	else if (windowname == "terms") window.open("http://www.flycrc.com/popup_terms.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=no");			
	else if (windowname == "copyright") window.open("http://www.flycrc.com/popup_copyright.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=no");			
	else if (windowname == "booking") window.open("http://www.flycrc.com/popup_bc.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=no");			
	else if (windowname == "abta") window.open("http://www.flycrc.com/popup_abta.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "atol") window.open("http://www.flycrc.com/popup_atol.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "emailpage") window.open("http://www.flycrc.com/popup_emailpage.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "enquiryform") window.open("http://www.flycrc.com/popup_enquiry.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "newsletter") window.open("http://www.flycrc.com/popup_newsletter.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	else if (windowname == "competition") window.open("http://www.flycrc.com/popup_competition.asp",'_blank',"width=368,height=400,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no");			
	return false;
}

function openDestinations(formElementName){
	var WinType;
	WinType="width=368,height=400,left=150,top=50,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=no";
	window.open('popup_destinations.aspx?formElementName=' + formElementName,'destinations',WinType);
}

function openPopupChildren(windowname,Num) {
	if (windowname == "children") window.open("popup_children.aspx?type=children&num=" + Num,'_blank',"width=275,height=200,left=200,top=200,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");				
	else if (windowname == "infants") window.open("popup_children.aspx?type=infants&num=" + Num,'_blank',"width=275,height=250,left=200,top=200,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");			
	return false;
}

function getLayerObj(lyr,parent){
	if (document.getElementById) {
		lyrObj = document.getElementById(lyr)
	}
	else if (document.all) {
		lyrObj = document.all[lyr]
	}
	else if (document.layers) {
		lyrObj = document.layers[lyr]
	}
	else {
		lyrObj = null;
	}
	return lyrObj
}

function getStyle(obj) {
	if (document.getElementById) {
		lyrObj = obj.style
	}
	else if (document.all) {
		lyrObj = obj.style
	}
	else if (document.layers) {
		lyrObj = obj
	}
	else {
		lyrObj = null;
	}
	return lyrObj
}

function layerMoveTo(obj,x,y) { 
	obj.xpos = x
	obj.ypos = y
	obj.left = obj.xpos
	obj.top = obj.ypos
}

function openMap() { 
	w = 0; 
	h = 0; 

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var topPos = (h-515)/2, leftPos = (w-720)/2;
	
	if (!window.mapwin) { 
		mapwin = window.open("destinations.asp","mapwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=500,top="+topPos+",left="+leftPos);
	}
	else {
        	if (!mapwin.closed) {
        		// mapwin window is still open; give it focus & reload
        	    	mapwin.focus();
			mapwin.location.href = "/flycrc/destinations.asp";
        	}
        	else {
			// mapwin window has been defined but must have been closed; open it
			mapwin = window.open("/flycrc/destinations.asp","mapwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=500,top="+topPos+",left="+leftPos);
        	}
        }
}

function openWindow(windowname,width,height,url,top,left,toolbar,location,directories,status,menubar,scrollbars,resizable) {
	var w,h,leftPos,topPos
	w = 0;
	h = 0;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}

	if(typeof(top) != "number") {
		if (top == "vm") {
			topPos = (h-height)/2
		}
		else if (top == "vb") {
			topPos = h-height
		}
	}
	else topPos = top

	if(typeof(left) != "number") {
		if (left == "hc") {
			leftPos = (w-width)/2
		}
		else if (left == "hr") {
			leftPos = w-width
		}
	}
	else leftPos = left

	eval(windowname + '= window.open("'+url+'","'+windowname+'","toolbar='+toolbar+',location='+location+',directories='+directories+',status='+status+',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',width='+width+',height='+height+',top='+topPos+',left='+leftPos+'")')
	eval(windowname + '.focus()')
}

function addBookmark(){
	if(window.external){
		window.external.AddFavorite(document.location.href,document.title)
	} else {
		alert('Sorry.  This only works in Internet Explorer')
	}
}