<!--

if (document.images) {

	newsOff			= new Image
	bioOff			= new Image
	showsOff		= new Image
	photosOff		= new Image
	multimediaOff	= new Image
	merchOff		= new Image
	linksOff		= new Image
	contactOff		= new Image

	newsOff.src			= "images/news.jpg"
	bioOff.src			= "images/bio.jpg"
	showsOff.src		= "images/shows.jpg"
	photosOff.src		= "images/photos.jpg"
	multimediaOff.src	= "images/multimedia.jpg"
	merchOff.src		= "images/merch.jpg"
	linksOff.src		= "images/links.jpg"
	contactOff.src		= "images/contact.jpg"

	newsOn			= new Image
	bioOn			= new Image
	showsOn			= new Image
	photosOn		= new Image
	multimediaOn	= new Image
	merchOn			= new Image
	linksOn			= new Image
	contactOn		= new Image

	newsOn.src			= "images/news-over.jpg"
	bioOn.src			= "images/bio-over.jpg"
	showsOn.src			= "images/shows-over.jpg"
	photosOn.src		= "images/photos-over.jpg"
	multimediaOn.src	= "images/multimedia-over.jpg"
	merchOn.src			= "images/merch-over.jpg"
	linksOn.src			= "images/links-over.jpg"
	contactOn.src		= "images/contact-over.jpg"

	sectionH		= new Image
	newsH			= new Image
	bioH			= new Image
	showsH			= new Image
	photosH			= new Image
	multimediaH		= new Image
	merchH			= new Image
	linksH			= new Image
	contactH		= new Image

	sectionH.src		= "images/go_14.jpg"
	newsH.src			= "images/news-h.jpg"
	bioH.src			= "images/bio-h.jpg"
	showsH.src			= "images/shows-h.jpg"
	photosH.src			= "images/photos-h.jpg"
	multimediaH.src		= "images/multimedia-h.jpg"
	merchH.src			= "images/merch-h.jpg"
	linksH.src			= "images/links-h.jpg"
	contactH.src		= "images/contact-h.jpg"
}

function menu_rollover(imgField,newImg,imgH,chgH) {
	if (document.images) {
		document[imgField].src= eval(newImg + ".src")
		document[imgH].src= eval(chgH + ".src")
	}
}

	function valid_email(email) {
		invalid_chars = " /:,;";

		if(email == ""){
			return false;
		}
		for(i=0; i<invalid_chars.length; i++) {
			bad_char = invalid_chars.charAt(i)

			if(email.indexOf(bad_char,0) > -1){
				return false;
			}
		}

		at_pos = email.indexOf("@",1);
		if(at_pos == -1) {
			return false;
		}

		if(email.indexOf("@",at_pos+1) > -1) {
			return false;
		}
		
		dot_pos = email.indexOf(".",at_pos)
		if(dot_pos == -1) {
			return false;
		}
		
		if(dot_pos+3 > email.length) {
			return false;
		}
		return true;
	}

	function email_submit(mailing_list) {
		if(!valid_email(mailing_list.email.value)) {
			alert("Please enter a valid address");
			mailing_list.email.focus();
			//mailing_list.email.select();
			return false;
		}
		return true;
	}

// produces a popup window positioned in the upper left-hand corner of the screen containing websites linked outside the Ghost Orgy website
function open_links(siteurl) {
	LinkWindow = window.open("http://"+siteurl, "GhostOrgy", "width=760,height=420,scrollbars=yes,toolbar=yes,status=yes,location,resizable=1,menubar,left=0,top=0");
}

//function popup_pic(sPicURL) { 
//	var x = window.open( "../popup.php?"+sPicURL, "GhostOrgy", "resizable=1,status=0,left=0,top=0,height=200,width=200");
//	x.focus();
//}

function open_img(img){
	ImgWindow = window.open(img,"","width=450,height=450,scrollbars=no,toolbar=no,status=no,resizable=0,left=0,top=0");
}

function linkWindow(index) {
	window.open(extLinks[index], "linkWindow", "toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=750,height=410,left=0,top=0");
}

function open_store(siteurl){
	StoreWindow = window.open("http://"+siteurl,"","width=780,height=420,scrollbars=yes,toolbar=yes,status=yes,location,resizable=1,menubar,left=0,top=0");
}

function lyrics_window(siteurl){
	LinkWindow = window.open(siteurl,"","width=550,height=550,scrollbars=yes,toolbar=yes,status=yes,location,resizable=1,menubar,left=0,top=0");
}

// open mailing list form
function open_mailinglist(siteurl) {
	LinkWindow = window.open("mailing_entry.php","","width=450,height=450,scrollbars=yes,toolbar=yes,status=yes,location,resizable=1,menubar,left=0,top=0");
}

// new front page script for rollovers - 2005-06-06

function mm_swap_img_restore() { //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_swap_image() { //v3.0
  var i,j=0,x,a=mm_swap_image.arguments; document.mm_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=mm_find_obj(a[i]))!=null){document.mm_sr[j++]=x; if(!x.osrc) x.osrc=x.src; x.src=a[i+2];}
}

function mm_find_obj(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_find_obj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
// -->
