function validate_gig_form()
{
    valid = true;

    if ( document.gig_form.title.value == "" || document.gig_form.date.value == "" || document.gig_form.venue.value == "" || document.gig_form.city.value == "" || document.gig_form.time.value == "")
    {
        alert ( "Please complete all fields marked with *." );
        valid = false;
    }   
    

    return valid;
}



function validate_page_form()
{
        valid = true;
    
        if ( document.page_form.parent_id.selectedIndex == 1 || document.page_form.title.value == "" || document.page_form.title.value == " " || document.page_form.title.value == "  " || document.page_form.friendly_url.value == "" )
        {
            alert ( "Please complete all fields marked with *." );
            valid = false;
        }   
        
    
    return valid;
}


function validate_page_edit_form()
{
        valid = true;
    
        if ( document.page_edit_form.title.value == "" || document.page_edit_form.title.value == " " || document.page_edit_form.title.value == "  " || document.page_edit_form.parent_id.selectedIndex == 1 || document.page_edit_form.friendly_url.value == "" )
        {
            alert ( "Please complete all fields marked with *." );
            valid = false;
        }   
        
    
    return valid;
}




function validate_contactform ( )
{
    valid = true;

    if ( document.contact_form.name.value == "" || document.contact_form.message.value == "" || document.contact_form.email.value == "" )
    {
        alert ( "Please make sure all details marked with * are complete." );
        valid = false;
    }   
    else if(document.contact_form.message.value.length>400)
    {
        alert ( "Your message must be less than 400 characters." );
        valid = false;
    }
    

    return valid;
}

function validate_casestudy_form()
{
        valid = true;
    
        if ( document.casestudy_form.parent_id.selectedIndex == 0 || document.casestudy_form.parent_id.selectedIndex == 1 || document.casestudy_form.title.value == "" || document.casestudy_form.title.value == " " || document.casestudy_form.title.value == "  " )
        {
            alert ( "Please complete all fields marked with *." );
            valid = false;
        }   
        
    
    return valid;
}

function validate_screenshot_form()
{
        valid = true;
    
        if ( document.screenshot_form.case_id.selectedIndex == 0 || document.screenshot_form.case_id.selectedIndex == 1)
        {
            alert ( "Please complete all fields marked with *." );
            valid = false;
        }   
        
    
    return valid;
}


function validate_sidebox_form()
{
        valid = true;
    
        if ( document.sidebox_form.page_id.selectedIndex == 1 || document.sidebox_form.case_id.selectedIndex == 1 || document.sidebox_form.title.value == "")
        {
            alert ( "Please complete all fields marked with *. Please make sure link and case study are also set." );
            valid = false;
        }   
        
    
    return valid;
}

function validate_callback_form()
{
	valid = true;
	
	 if ( document.callback_form.time.selectedIndex == 0 || document.callback_form.name.value == "Your name" || document.callback_form.name.value == "" || document.callback_form.tel.value == "" || document.callback_form.tel.value == "Your telephone No." )
    {
        alert ( "Please make sure you provide valid details." );
        valid = false;
    }   
	
    
    return valid;
  
}

