function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	function MM_preloadImages() { //v3.0
	 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
  		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  		if (restore) selObj.selectedIndex=0;
	}
	



var message="All photos and text © 2005 Derrick Rice, all rights reserved worldwide. No form of reproduction or usage - including copying, altering, or saving of digital image and text files - is permitted without the express written permission of Derrick Rice";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")


function isValidEmail(obj)
		{
		    var str     = obj.value ; // value to be 'tested'
		    var name    = obj.name  ; // name of the field
		    var errMsg  = "Please enter your valid email address."
		          errMsg +="\nfor " + name + ". (Required entry)" ;
		          errMsg +="\nYou entered \"" + str +"\"." ;
		   var newString = str.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		   if (!newString){
		        alert(errMsg) ; // tell the user what is wrong
		        obj.focus()   ; // focus on the field with the problem
		                obj.select()  ; // select the contents of the field with the problem
		                return false  ; // tell wrap around function that this value fails
		   }
		    return true; // tell wrap around function that this value passes
		}



		function validatemainform(form)
		{
			if(window.document.mainform.name.value == '')
			{
				alert('You must enter your full name.');
				window.document.mainform.name.focus();
				return false;
			}
			
			else if(window.document.mainform.email.value == '')
			{
				alert('You must enter a value for the email.');
				window.document.mainform.email.focus();
				return false;
			}
			
			else
			{
				return true;
			}
		}

		function clickMe()
		{
			var IsItTrueOrFalse;

			IsItTrueOrFalse = validatemainform(window.document.mainform);

			if(IsItTrueOrFalse)
			{
				//passed validation
				window.document.mainform.action = 'generate_email.php';
				alert('Thanks for contacting Me, I will get back to you soon.');
				window.document.mainform.submit();
			}
			else
			{
				//did not pass validation, you can add an alert here.
			}
		}

var aw = screen.availWidth;
var ah = screen.availHeight;
var vWidth = screen.width;
var vHeight = screen.height;
	
function opensesame (url, full, w, h) {
    var opts = "width="+ w +",height="+ h +",scrollbars=0";
    if(full == true) opts += ",fullscreen=1";
    //opts += ",top="+(ah-720)/2+",left="+(aw-1000)/2;
    opts += ",top=0,left=0";
    var ow = window.open(url,"ow",opts);
    ow.focus();
}

var win = null;
function newWindow(mypage,myname,w,h,features) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
	

