//jquery
$(document).ready(function() {
	
	
	
		//if its a festival, show more fields and relabel 1
	 $('.isFestival input').click(function(){
		
		
	 
      if  ($('.isFestival input').is(':checked')) { 
$('.isRadio').hide();
 	$('#festivalFields').slideDown('slow');
     $('.physicalLocation .FRMl').html('Physical location/venue info');
 
     $('.website .FRMl').text('Venue/stage website');
	  } else {
	$('.isRadio').show();
	$('#festivalFields').slideUp();
	clubFormDefaults();
	  }
	});
	 
	 
	
		//if its a radio station, show more fields and relabel 1
	 $('.isRadio input').click(function(){
		
		
	 
      if  ($('.isRadio input').is(':checked')) { 
$('.isFestival').hide();
 	$('#radiofields').slideDown('slow');
     $('.physicalLocation .FRMl').html('Radio show name');

     $('.website .FRMl').text('Radio show website (or station homepage)');
 
	  } else {
	$('.isFestival').show();
	$('#radiofields').slideUp();
 clubFormDefaults();
	  }
	});
	
	
	function clubFormDefaults() {
	  $('.physicalLocation .FRMl').html('Club/Client  name: <span class="mask">(don\'t put DJ names here.)</span>');
   $('.website .FRMl').text('Club/client website');
	}
	
})
 
	//end jquery					  
						  
						  

//popup
function popitup(url) {
	newwindow=window.open(url,'name','height=600,width=450');
	if (window.focus) {newwindow.focus()}
	return false;
}
    
    function start_slideshow(start_frame, end_frame, delay) {
        setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);
    }
                            
    function switch_slides(frame, start_frame, end_frame, delay) {
        return (function() {
            Effect.Fade('slideshow' + frame);
            if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
            setTimeout("Effect.Appear('slideshow" + frame + "');", 850);
            setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay + 850);
        })
    }
	
//check for email validity. make sure the ID of the element has a corresponding ID called thing_e which is the span with the error in it.
function isEmail(obj) {
var field = document.getElementById(obj);
var fieldMsg = document.getElementById(obj+'_e');
	if (  
		field.value.indexOf ('@', 1) == -1 ||
		field.value.indexOf ('.', 3) == -1) 
	{
		Effect.Appear(fieldMsg);
		return false;
	} 
	else
	{
		
		Effect.Fade(fieldMsg);
		return (true);
	} 
}


