//turborogue.com javascript




//no right click
function click() {
if (event.button==2)
{alert('Nope! No image stealing permitted!:-)');
}
}
document.onmousedown=click;


//email form vaidation
function validate(form) {
	var msg="";
	if (form.name.value == "") msg += "  * Name\n";
	if ((form.email.value.indexOf('@') == -1) || (form.email.value.length < 8)) msg += "  * E-mail\n";
	if (form.message.value == "") msg += "  * Message\n";
	if (msg == "") {
		return true;
	} else {
		alert("Please enter in the following information in order to submit your e-mail:\n" + msg);
		return false;
	}
}


//photo page popup window
function popupwin(link) {
     window.open('popup.html?image=' +link,'popup', 'height=600,width=600,scrollbars=1,resizable=1,toolbar=1,location=1,status=1,top=0,left=0');
}

function popcall() {
	var image = window.location.href.split("=")[1];
	window.document.getElementById("picarea").innerHTML = "<img src='" +image+ "' />";
}







//testing below


/*
//xhtml strict validation for photos in external window
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
       anchor.target = "_blank";
 } 
}
window.onload = externalLinks;
*/



/*
window.onload = function popupwin() {
var closeElementId='closewindow';
var closeLinkText='Close window';
var windowAttributes='height=560,width=600,scrollbars=1,resizable=1,toolbar=1,location=1,status=1';

if(!window.opener) {
	var as,i,popfun
	as=document.getElementsByTagName('a');
	for (i=0;i<as.length;i++) {
		if(as[i].rel) {
			popfun=function(){window.open(this.href,'',windowAttributes);return false;};
			as[i].onclick=popfun;
			as[i].onkeypress=popfun;
		}
	}
	
	} else {
	var closep,closelink,closetext;
	closelink=document.createElement('a');
	closetext=document.createTextNode(closeLinkText);
	closelink.href='#';
	closelink.appendChild(closetext);
	closelink.onclick=function(){self.close();};
	closelink.onkeypress=function(){self.close();};
	if(document.getElementById(closeElementId))
	{
		document.getElementById(closeElementId).appendChild(closelink);	
	} else {
		closep=document.createElement('p');
		closep.id=closeElementId;
		closep.appendChild(closelink);
		document.body.insertBefore(closep,document.body.firstChild);	
	}
}
}
*/


/*
function popupwin(foo) {
	var popupwindow = window.open('popup.html','foo','height=560,width=600,scrollbars=1,resizable=1,toolbar=1,location=1,status=1');
	var popone = document.getElementsByTagName("a");
	for (var i=0; i<popone.length; i++) {
		var picpop = popone[i];
		if (picpop.getAttribute("rel") == "external")
		//document.getElementById("picarea").location.href = 'images/pics/pic125.jpg';
		popu();
	}
}


function popu() {
document.getElementById("picarea").innerHTML = "<img alt='photo' src='" +foo+ "' />";
}
*/


/*
//Pop-up Window
function childPop(file) {
	myWindow8 = window.open('blank.htm','myExample8','width=200,height=200');
myWindow8.location.href = 'testpage.htm';

//		childpop = window.open ('images/pics/pic125.jpg','childone','height=560,width=740,scrollbars=1,resizable=1,toolbar=1,location=1,status=1');
	}
	
*/