/* functions related to displaying an image in its own popup window */
function CaricaFoto(img){
   foto1= new Image();
   foto1.src=(img);
   Controlla(img);
};

function Controlla(img){
   if((foto1.width!=0)&&(foto1.height!=0)){
       viewFoto(img);
   }
   else{
		 alert ("In controlla else");
	   funzione="Controlla('"+img+"')";
	   intervallo=setTimeout(funzione,20);
   }
};

function viewFoto(img){
   largh=foto1.width+20;
   altez=foto1.height+20;
   stringa="width="+largh+",height="+altez;
   finestra=window.open(img,"",stringa);
};

function chgImg(imgField, newImg){
		 if (document.images) {
		 	document[imgField].src=eval(newImg + ".src")
		 }
};
	
/* Rollover Image Script - Place within <head> tag */
function SwitchImg(){ //start
	   var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
   	   for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
   	   	   store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
   		   if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
       	   	  (store.indexOf('document.all[')==0 && document.all==null))
       		      store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
       	   obj = eval(store);
           if (obj != null) {
               switcher[keep++] = obj;
               switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
               obj.src = SwitchImg.arguments[rem+2];
           } 
	   }
       document.Data = switcher;
}; //end



function RestoreImg(){ //start
   if (document.Data != null)
   for (var rem=0; rem<(document.Data.length-1); rem+=2)
       document.Data[rem].src=document.Data[rem+1];
}; //end

function mailMe(form){
    EmailOne=document.AddMember.Email1.value;
    EmailTwo=document.AddMember.Email2.value;
	Handle=document.AddMember.Nickname.value;
    if ((EmailOne.length>=3) && (EmailOne==EmailTwo)) {
	   if (Handle.length>=2) {
	   	  location = "mailto:gobabevents@yahoo.com?subject='Add Me!'";
	   }
	   else{
		    alert('You have not entered a Handle/Nickname!');
	   }
	}
	else{
		 alert('Email addresses are not entered or are not the same!');
	}
    return true;
};						   


Onecurrent = 0;
//var OneLinks = new Array(3);
//OneLinks[0] = "http://www.freewarejava.com";
//OneLinks[1] = "http://www.javascriptkit.com";
//OneLinks[2] = "http://www.dynamicdrive.com";
function Onenext() {
    if (document.Oneslideform.Oneslide[Onecurrent+1]) {
	    document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent+1].value;
		document.Oneslideform.Oneslide.selectedIndex = ++Onecurrent;
	}
	else Onefirst();
};

function Oneprevious() {
    if (Onecurrent-1 >= 0) {
        document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent-1].value;
        document.Oneslideform.Oneslide.selectedIndex = --Onecurrent;
    }
    else Onelast();
};

function Onefirst() {
    Onecurrent = 0;
    document.images.Oneshow.src = document.Oneslideform.Oneslide[0].value;
    document.Oneslideform.Oneslide.selectedIndex = 0;
};

function Onelast() {
    Onecurrent = document.Oneslideform.Oneslide.length-1;
    document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
    document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
};

function Oneap(text) {
    document.Oneslideform.Oneslidebutton.value = (text == "Stop") ? "Start" : "Stop";
    Onerotate();
};

function Onechange() {
    Onecurrent = document.Oneslideform.Oneslide.selectedIndex;
    document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
};

function Onerotate() {
    var Onerotate_delay = 2000; // delay in milliseconds (5000 = 5 secs)
    if (document.Oneslideform.Oneslidebutton.value == "Stop") {
        Onecurrent = (Onecurrent == document.Oneslideform.Oneslide.length-1) ? 0 : Onecurrent+1;
        document.images.Oneshow.src = document.Oneslideform.Oneslide[Onecurrent].value;
        document.Oneslideform.Oneslide.selectedIndex = Onecurrent;
        window.setTimeout("Onerotate()", Onerotate_delay);
    }
};

//function Onetransport(){
//    window.location=OneLinks[Onecurrent];
//};

