
var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)
var flag = 0;
var msg = "Copyright 2005 by Aura sunspa.\nWARNING ! All images & content contained within this site is protected by copyright laws.\nUnauthorized use of our material is strictly prohibited.";
var x,y,x1,y1,copyAttempt;

function init()
{
	if (!(document.getElementById || document.all || document.layers)) return;
	if (specialcase && document.layers)
	{
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = special;
	}
	for (i=0;i<document.images.length;i++)
	{
		document.images[i].onmousedown = checkIt;
		document.images[i].onmouseup = function() {return false};
		if (specialcase)
		{
			document.images[i].onmousemove = special;
			document.images[i].onclick = clearIt;
		}
	}
}

function checkIt(e)
{
	copyAttempt = 0;
	if (window.Event)
	{
		x = e.screenX;
		y = e.screenY;
		theButt = (e.which == 3);
	}
	else
	{
		x = window.event.clientX;
		y = window.event.clientY;
		theButt = (window.event.button == 2);
	}
	if (theButt)
	{
		copyAttempt = 1;
		flag = 0;
		alert(msg);
		return false; // NN4 only
	}
	if (specialcase) flag = 1;
	return false;
}

function special(e)
{
	theObj = '';
	if (window.Event)
	{
		x1 = e.screenX;
		y1 = e.screenY;
		if (e.target.parentNode) theObj = e.target.parentNode.tagName;
	}
	else
	{
		x1 = window.event.clientX;
		y1 = window.event.clientY;
		theObj = window.event.srcElement.parentElement.tagName;
	}
	var isLink = (theObj == 'A');
	if (flag && (!isLink || ((Math.abs(x-x1) > 10) || (Math.abs(y-y1) > 10))))
	{
		copyAttempt = 1;
		flag = 0;
		alert(msg);
		return false;
	}
}

function clearIt()
{
	flag = 0;
	if (copyAttempt)
	{
		copyAttempt = 0;
		return false;
	}
}
window.onload=function(){init();}

IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var newWin=null;

function popup(loc, name, width, height) {
	var _params = "width="+width+",height="+height+",menubar=no,resizable=no,status=no,scrollbars=yes";

	// CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
	if (bVer >= 4) {
		 _left = ( (screen.width-width) >>1 );
		 _top = ( (screen.height-height) >>1 );
	} else {
		 _left = ( (800-width) >>1 );
		 _top = ( (600-height) >>1 );
	}

	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = window.open(loc, name, _params);
	if ( newWin!=null && !(IE && bVer<5) )
		newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}
function validateContact() {
	if (!document.getElementById("contactform").name.value) {
		alert("Please enter Your Name!");
		document.getElementById("contactform").name.select();
		return false;
	}
	var email = document.getElementById("contactform").email.value;
	if (!email.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)) {
		alert("Please enter a valid Email Address!");
		document.getElementById("contactform").email.select();
		return false;
	}
	document.getElementById("contactform").submit();
}
function validatejoinform() {
	if (!document.getElementById("joinform").name.value) {
		alert("Please enter Your Name!");
		document.getElementById("joinform").name.select();
		return false;
	}
	var email = document.getElementById("joinform").email.value;
	if (!email.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)) {
		alert("Please enter a valid Email Address!");
		document.getElementById("joinform").email.select();
		return false;
	}
	document.getElementById("joinform").submit();
}
function sendsearch() {
	var keywords = document.getElementById("searchform").keywords.value;
	keywords = keywords.replace(/\s/g, "-");
	window.location = "/Search/" + keywords + "/";
}
function clearform() {
	document.getElementById("searchform").keywords.value = "";
}$(window).load(function(){	$('.page-gallery-images').before('<div id="slide-pager">')	.cycle({		fx: 'fade', 		speed: 500, 		timeout: 8000, 		pager: '#slide-pager'	});});
