
function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") 
		this.b = "ns";
	else if (b=="Microsoft Internet Explorer") 
		this.b = "ie";
	else 
		this.b = b;
	this.v = parseInt(navigator.appVersion);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	if (this.ie5) 
		this.v = 5;
	this.min = (this.ns||this.ie)
}

// automatically create the "is" object
var is = new BrowserCheck();

function oldNavbarPopup() {
	var nWin = window.open('./popups/oldNavBar.html','nw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=655,height=175');	
	nWin.focus();
}

function homerPopup() {
	var homerWin = window.open('../popups/homer.html','sw','resizable=no,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=450,height=250');	
	homerWin.focus();
}

function homerClooneyPopup() {
	var homerClooneyWin = window.open('../popups/homer_clooney.html','sw','resizable=no,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=400,height=270');	
	homerClooneyWin.focus();
}

function popupWindow( url, height, width ) {
	var someWin = window.open(url,'sw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width='+width+',height='+height);	
	someWin.focus();
}

function popupNoresize( url, height, width ) {
	var someWin = window.open(url,'sw','resizable=no,dependent=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width='+width+',height='+height);	
	someWin.focus();
}

function popupWindow2( url, height, width ) {
	var someWin = window.open(url,'sw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width='+width+',height='+height);	
	someWin.focus();
}

function superPopup( url, winname, height, width, scroll ) {
	var someWin = window.open(url,winname,'scrollbars='+scroll+',width='+width+',height='+height);	
	someWin.focus();
}

function dapperPopup() {
	var dapperWin = window.open('./popups/dapperdan.html','sw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=600,height=390');	
	dapperWin.focus();
}

function selectSiren( number ) {
	if ( number == 1 ) {
		document.location.href = 'sirens_result1.html';
	} else if ( number == 2 ) {
		document.location.href = 'sirens_result2.html';
	} else {
		document.location.href = 'sirens_result3.html';
	}
}

function sirenPopup() {
	var sirenWin = window.open('../popups/sirens_index.html','sw','resizable=no,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=680,height=420');	
	sirenWin.focus();
}

var photoWin;
var hasBeenOpened = false;

function popup( number ) {
	hasBeenOpened = true;
	document.photoForm.photoNumber.value = number;
	document.photoForm.shouldResize.value = 1;
	photoWin = window.open('photopopup.asp','pw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=400,height=350,Left=0,Top=0,');	
	photoWin.focus();
	var src = 'images/album/big/' + number + '.gif';
	var height = imageHeight( src ) + 60;
	var width = imageWidth( src ) + 20;
	/*
	if ( is.min ) {
		if ( navigator.appName=="Netscape" ) {
			photoWin.outerWidth=width;
			photoWin.outerHeight=height;
		} else {
			photoWin.resizeTo(width,height);
		}
	}
	*/
}



function popupBehind( number ) {
	hasBeenOpened = true;
	document.photoForm.photoNumber.value = number;
	document.photoForm.shouldResize.value = 1;
	photoWin = window.open('../cast/popupbehind.html','pw','resizable=yes,dependent=yes,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=400,height=350');	
	photoWin.focus();
	var src = '../../images/' + number + '_behind.gif';
	var height = imageHeight( src );
	var width = imageWidth( src );
	/*
	if ( is.min ) {
		if ( navigator.appName=="Netscape" ) {
			photoWin.outerWidth=width;
			photoWin.outerHeight=height;
		} else {
			photoWin.resizeTo(width,height);
		}
	}
	*/
}





function closePhotoWin() {
	if ( hasBeenOpened ) {
		photoWin.close();
	}
}

function imageWidth( source ) {
	if ( is.min ) {
		if ( navigator.appName=="Netscape" ) {
			return photoWin.document.images[0].width;		
		} else {
			var tempImg = new Image();
			tempImg.src = source;
			return tempImg.width;
		}
	} else {
		return 390;
	}
}

function imageHeight( source ) {
	if ( is.min ) {
		if ( navigator.appName=="Netscape" ) {
			return photoWin.document.images[0].height;		
		} else {	
			var tempImg = new Image();
			tempImg.src = source;
			return tempImg.height;
		}
	} else {
		return 350;
	}
}


