pic1= new Image();pic1.src="gfx/transbg.png";
function checkEmail()
{
	var email = document.getElementById('email').value;
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email))
	{
		alert('Please provide a valid email address');
		email.focus
		return false;
	}
	else
		document.mailinglist.submit()
}

function pageHeight()
{
	if (navigator.appName.indexOf("Microsoft")!=-1) return document.body.offsetHeight;
	else return window.innerHeight;
}

function pageWidth()
{
	if (navigator.appName.indexOf("Microsoft")!=-1) return document.body.offsetWidth;
	else return window.innerWidth;
}

function noflash()
{
	document.write('no flash!');
}

function popupPic(sPicURL)
{
	window.open("pub/image_window.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
} 

function bgAdjust(ratio) // adjusts dimensions of the background image
{
	//background image width is always bigger than height
	document.getElementById('bgImage').style.width=pageWidth();
	document.getElementById('bgImage').style.height=document.getElementById('bgImage').offsetWidth/ratio;

	if (document.getElementById('bgImage').offsetHeight<pageHeight())
	{
		document.getElementById('bgImage').style.height=pageHeight();
		document.getElementById('bgImage').style.width=pageHeight()*ratio;
	}

	//adjust position of div that contains image
	document.getElementById('bgImageDiv').style.left=(pageWidth()-document.getElementById('bgImage').offsetWidth)/2;
	document.getElementById('bgImageDiv').style.top=(pageHeight()-document.getElementById('bgImage').offsetHeight)/2;
}

function adjust() // adjusts height of the content div
{

	document.getElementById('content').style.height=pageHeight()-220;
	document.getElementById('tede').style.height=pageHeight()-212;
	if (navigator.appName.indexOf("Microsoft")!=-1) document.getElementById('content').style.width=document.getElementById('tede').offsetWidth-15;

	document.getElementById('hands').style.left=(pageWidth()-931)/2;
}

pic1= new Image(); pic1.src="gfx/menu12.png"; 
pic2= new Image(); pic2.src="gfx/menu22.png"; 
pic3= new Image(); pic3.src="gfx/menu32.png"; 
pic4= new Image(); pic4.src="gfx/menu42.png"; 
pic5= new Image(); pic5.src="gfx/menu52.png"; 
pic9= new Image(); pic9.src="gfx/footer22.png"; 

function header()
{
	document.write('<table cellpadding=0 cellspacing=0 border=0>');
	document.write('<tr>');
	document.write('<td><img src="gfx/menu11.png" onclick=\'location.href="http://davidmillernd.com"\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/menu12.png"\' onmouseout=\'this.src="gfx/menu11.png"\'></td>');
	document.write('<td><img src="gfx/menu21.png" onclick=\'location.href="news.php"\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/menu22.png"\' onmouseout=\'this.src="gfx/menu21.png"\'></td>');
	document.write('<td><img src="gfx/menu31.png" onclick=\'location.href="about.htm"\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/menu32.png"\' onmouseout=\'this.src="gfx/menu31.png"\'></td>');
	document.write('<td><img src="gfx/menu41.png" onclick=\'location.href="services.htm"\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/menu42.png"\' onmouseout=\'this.src="gfx/menu41.png"\'></td>');
	document.write('<td><img src="gfx/menu51.png" onclick=\'location.href="contact.htm"\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/menu52.png"\' onmouseout=\'this.src="gfx/menu51.png"\'></td>');
	document.write('</tr>');
	document.write('</table>');
}

function footer()
{
	document.write('<table cellpadding=0 cellspacing=0 border=0>');
	document.write('<tr>');
	document.write('<td><img src="gfx/footer.png"></td>');
	document.write('<td><img src="gfx/footer21.png" onclick=\'window.open("http://www.alvaroramos.com")\' onmouseover=\'this.style.cursor="pointer";this.src="gfx/footer22.png"\' onmouseout=\'this.src="gfx/footer21.png"\'></td>');
	document.write('</tr>');
	document.write('</table>');
}

/// Adjust bg image
function getRatio(){ return document.getElementById('bgImage').offsetWidth/document.getElementById('bgImage').offsetHeight }

function finalAdjustment()
{
	setTimeout("bgAdjust(getRatio())",1);
	document.getElementById('hands').style.left=(pageWidth()-931)/2;
	window.onresize = function()
	{
		adjust();	 
		bgAdjust(getRatio());
	}
}