function imagewindow(imagename,x,y){
	var width 
	width = (x + 70)
	var height
	height = (y + 150)
	//alert(width + '  ' + height)
	if (!window.window2) {
        // has not yet been defined
        window2 = window.open('image.asp?name='+imagename+'&w='+x+'&h='+y,'windowRef','width='+width+',height='+height+',resizable=yes');
		window2.focus();
    }
    else {
        // has been defined
        if (!window2.closed) {
            // still open
			window2.resizeTo(width,height)
			//window2.outerWidth = width
			//window2.outerHeight = height
			window2.location.href = ('image.asp?name=' + imagename + '&w=' + x + '&h=' + y)
            window2.focus();
            window2.focus();
        }
        else {
            window2 = window.open('image.asp?name='+imagename+'&w='+x+'&h='+y,'windowRef','width='+width+',height='+height+',resizable=yes');
			window2.focus();
        }
    }

}

function EditText(filename){
	if (!window.EditWindow) {
        // has not yet been defined
       //window.open('admin_text.asp?file='+filename,'windowRef','width=650,height=700,resizable=yes');
        EditWindow = window.open('admin_text.asp?file='+filename,'windowRef','width=650,height=400,resizable=yes,scrollbars=yes');
		EditWindow.focus();
    }
    else {
        // has been defined
        if (!EditWindow.closed) {
            // still open
			EditWindow.location.href = ('admin_text.asp?file='+filename)
            EditWindow.focus();
            EditWindow.focus();
        }
        else {
            EditWindow = window.open('admin_text.asp?file='+filename,'windowRef','width=650,height=400,resizable=yes,scrollbars=yes');
			EditWindow.focus();
        }
    }
}

function LoadPage(url){
	window.location.reload(url);
}

function checkImageForm(){
	var objForm = eval("document.adminImageForm");
	/*if (objForm.newImage.value == "") {
		alert("Please enter an image to upload.")
		return false;
	}
	else*/ if (objForm.replaceimage.options[objForm.replaceimage.selectedIndex].value == ""){
		alert("The image you wish to upload needs a home. \n\nPlease select an image to replace. \n\nIf you do not want to replace an image, select the next name on the list.")
		return false;
	}
	else {
		//return true;
		objForm.submit();
	}
	
}

function loadCaptions(txt){
		var arr = txt.split("|");
		var frm = eval("document.adminImageForm");
		frm.smallCaption.value = arr[1];
		frm.largeCaption.value = arr[2];
		frm.altText.value = arr[3];
		
}
	
function CompareImages(){
	var objForm = eval("document.adminImageForm");
	var OImage = objForm.newImage.value;
	alert(OImage);
	
	objForm.submit();
	
}


var WinName;
function LaunchMusic(){
	if (!WinName || WinName.closed){
		WinName = window.open("/music.asp","MusicWindow","width=400,height=400");
	}
	else
		WinName.focus();
}

function CheckBooking(){
	var frm = eval(document.bookingForm);
	if (frm.name.value == ''){
		alert("Please enter your name.");
		return false;
	}
	else if (frm.phone.value == ''){
		alert("Please enter your phone number.");
		return false;
	}
	else if (frm.email.value == ''){
		alert("Please enter your email address.");
		return false;
	}
	return true;
}
