function writeFlash(strFlash,flashWidth,flashHeight,loc) {
	new SWFObject(strFlash,'swf'+loc,flashWidth, flashHeight,  "7", "#000000" ).write(loc);
}

var wini; //Reference to a window
function PopWin(url, name, width, height) {
	h = (height) ? height : 500;
	w = (width) ? width : 600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
	//if (wini && !wini.closed)
	//		wini.resizeTo(w, h);
	wini = window.open(url,name,settings);
	if (wini)
		wini.focus();
		
	return ( !wini )
}// PopWin()

function Popper(els) {
	for (var i = 0; i < els.length; i++) {
		if (els[i].className == 'popup') { //Show only 'A' tags with class="popup" within the content pane in a controlled popup window
			if (els[i].target == 'photowide') {
				els[i].onclick = function() { return PopWin(this.href, this.target, 650,430); }
			}
			else if (els[i].target == 'phototall') {
				els[i].onclick = function() { return PopWin(this.href, this.target, 470,575); }
			}
			else if (els[i].target == 'photosq') {
				els[i].onclick = function() { return PopWin(this.href, this.target, 480,480); }
			}
			else {
				els[i].onclick = function() { return PopWin(this.href, this.target, 700,570); }
			}// if(els[i].target)
		}// if(els[i].className)
	}// for
}// Popper()

function init(){
	if(document.getElementById && document.getElementsByTagName)
		els = document.getElementById('content').getElementsByTagName('A');
	else if(document.all)
		els = document.all['content'].all.tags('A');
	else	return;
	if (els )
		Popper(els);
}// init()
addEvent(window,'load',init);

//UTILITY functions below  ********************************************
//********************************************************************
function addEvent(obj,evType,fn){
	if(obj.addEventListener){
		obj.addEventListener(evType,fn,true);
		return true;
	}
	else if(obj.attachEvent){
		var r=obj.attachEvent("on"+evType,fn);
		return r;
	}
	else{
		return false;
	}
}

function Up(index) {
	if (document.images)
		document.images['nav' + index].src = navimg2[index].src
}

function Down(index) {
	if (document.images)
		document.images['nav' + index].src = navimg1[index].src
}


/*function ipix_win(ipix_string)
	{
		window.open("ipix_win.asp?ipix_str=" + ipix_string, "ipix_win", "width=500,height=400");
	}
*/

// OpenIpixWindow()
var wini = null;
function OpenIpixWindow(ipix_string)
{
		h = 400;
		w = 500;
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
		wini = window.open('/ipix-video/ipix_win.asp?ipix_str=' + ipix_string,'IPIX',settings);
}


// OpenIpixHelp()
var winh = null;
function OpenIpixHelp()
{
		h = 400;
		w = 500;
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
		winh = window.open('help.html','HELP',settings);
}


function ShowPopupWarning()
{
	//set cookie
	return confirm('NOTE: Please disable any Pop-up Blockers and click \'OK\' to continue...');
}

// OpenVideoWindow()
var wini = null;
function OpenVideoWindow(video_string, iheight, iwidth)
{
		h = iheight;
		w = iwidth;
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
		winj = window.open('/ipix-video/video_win.asp?video_str=' + video_string,'VIDEO',settings);
}
//-->