var popup=0;
function newSlides(newURL) {
	popup = window.open(newURL,'NewSlideShow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=780,height=580');
}

function newPhoto(newURL) {
	popup = window.open(newURL,'NewPhoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=640,height=580');
}

function newMap(newURL) {
	popup = window.open(newURL,'NewMap','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=720,height=600');
}

function newMovie(newURL) {
	popup = window.open(newURL,'NewMovie','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=320,height=280');
}

function popupZoom(newURL,newTitle) {
	popup = window.open('http://www.bhigr.com/media/zooms/zoomFlash.php?path=' + newURL + '&title=' + newTitle,'NewZoom','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=720,height=580');
}

function popupZoomSlides(newURL,newTitle) {
	popup = window.open('http://www.bhigr.com/media/zoomslides/' + newURL + '/index.php?title=' + newTitle,'NewZoomSlides','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600');
}

function popupSlides(newURL,newTitle) {
	popup = window.open('http://www.bhigr.com/media/slides/' + newURL + '/index.php?title=' + newTitle,'NewSlides','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600');
}

function newWindow(newURL,w,h) {
	popup = window.open(newURL,'NewWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+'');
}

function checkQT() {
	popup = window.open('/scripts/qt/index.html','CheckQT','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=no,width=580,height=400');
}

function imagePop(imgurl,w,h) {
	mybody = "<html>\r<head>\r<title>Image<\/title>\r";
	mybody += " <\/head>\r";
	mybody += " <body leftmargin='8' marginheight='8' marginwidth='8' topmargin='8' bgcolor='#cccc99' background='/interface/body_bkgrd.gif'>\r";
	mybody += "  <div align='center'>\r";
	mybody += "    <img src='"+imgurl+"' width='"+w+"' height='"+h+"'alt=''>\r";
	mybody += "   <\/div>\r";
	mybody += " <\/body>\r";
	mybody += "<\/html>";
	if (w > 560) {
	 w = 598;
	}else{
	 w += 38;
	}
	if (h > 410) {
	 h = 468;
	}else{
	 h += 58;
	}
	newWindow = window.open('','Image','toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+'');
	newWindow.document.write(mybody);
}
function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (i=0;i<array.length;i+=2) {
			img = null; var n = array[i];
			if (d.images) {
				if (d.layers) {img = findElement(n,0);}
				else {img = d.images[n];}
			}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (!img && d.getElementsByName) {
				var elms = d.getElementsByName(n);
				if (elms) {
					for (j=0;j<elms.length;j++) {
						if (elms[j].src) {img = elms[j]; break;}
					}
				}
			}
			if (img) {img.src = array[i+1];}
		}
	}
}
function changeImages() {
	changeImagesArray(changeImages.arguments);
}