/*if (document.images) 
{
   img1 = new Image();
   img2 = new Image();
   img3 = new Image();
   img4 = new Image();
   img5 = new Image();
   img6 = new Image();
   img7 = new Image();
   img8 = new Image();

   img1.src = "images/background.gif";
   img2.src = "images/hemaka_logo.gif";
   img3.src = "images/integrity_by_way_of_ingenui.gif";
   img4.src = "images/home_page.jpg";
   img5.src = "images/curved_border.gif";
   img6.src = "images/curved_border_bottom.gif";
   img7.src = "images/desert_brown.jpg";
   img8.src = "images/desert_white.jpg";
}
*/

function rollovers()
{
	main_rollovers()
}

function mailing_list_focus(o)
{
	if(o.value == 'Join Mailing List') o.value = '';	
}

function mailing_list_blur(o)
{
	if(o.value == '') o.value = 'Join Mailing List';
}

function main_rollovers()
{
	try
	{
		if (document.getElementById)
			var x = document.getElementById('main_navigation').getElementsByTagName('img');
		else if (document.all)
			var x = document.all['main_navigation'].all.tags('img');
		else return;
		if (!x) return;
	} catch (e) {return};
	var preloads = new Object();
	for (var i=0;i<x.length;i++)
	{
		if(x[i].className != 'selected' && x[i].className != 'nav_dot' && x[i].id)
		{
			preloads['normal_'+x[i].id] = new Image;
			preloads['normal_'+x[i].id].src = '/images/buttons/nav/'+ x[i].id + '.gif';
			preloads['over_'+x[i].id] = new Image;
			preloads['over_'+x[i].id].src = '/images/buttons/nav/'+ x[i].id + '-over.gif';
			x[i].onmouseover = function () {this.src=preloads['over_'+this.id].src;}
			x[i].onmouseout = function () {this.src=preloads['normal_'+this.id].src;}
		}
	}
}

simple_popup_window = null;

function simple_popup(url)
{
	var w,h,window_width,window_height,top,left;
	window_width  = 520
	window_height = 710


	left = (screen.width  - window_width)/2
	top  = (screen.height - window_height)/2		


	simple_popup_window = window.open
	(
		url,
		'simple_popup',
			'width='+window_width+','+
			'height='+window_height+','+
			'directories=no,'+
			'location=no,'+
			'menubar=no,'+
			'scrollbars=yes,'+
			'status=no,'+
			'toolbar=no,'+
			'resizable=no,'+
			'left='+left+","+
			'top='+top
	);
	simple_popup_window.focus()
	
}

function close_popups()
{
  if (simple_popup_window != null && simple_popup_window.open) simple_popup_window.close();
}


window.onload = rollovers;
window.onfocus = close_popups;
