function sendForm()
{
	if( document.getElementById("call").value == 'on' )
	{
		if( (document.getElementById("firstName").value != "First name") && (document.getElementById("telephone").value != "Telephone number") )
		{
			contactUs();
			setTimeout("document.forms['contactForm'].submit();", 700);
		}
		else
		{
			alert("Please fill in: \n- First name \n- Telephone number");
		}
	}
	else if( document.getElementById("newsletter").value == 'on' )
	{
		if( (document.getElementById("firstName").value != "First name") && (document.getElementById("emailaddress").value != "email@address.com") )
		{
			contactUs();
			setTimeout("document.forms['contactForm'].submit();", 700);
		}
		else
		{
			alert("Please fill in: \n- First name \n- E-mailaddress");
		}
	}
    else if( document.getElementById("telephone").value != "Telephone number" )
    {
    	contactUs();
		setTimeout("document.forms['contactForm'].submit();", 700);
    }
    else if( document.getElementById("emailaddress").value != "email@address.com" )
    {
    	contactUs();
		setTimeout("document.forms['contactForm'].submit();", 700);
    }
	else
	{
		alert("Please fill in: \nTelephone number or E-mailaddress");
	}
}

function sendForm2()
{
	if( document.getElementById("call2").value == 'on' )
	{
		if( (document.getElementById("firstName2").value != "First name") && (document.getElementById("telephone2").value != "Telephone number") )
		{
			setTimeout("document.forms['contactForm2'].submit();", 700);
		}
		else
		{
			alert("Please fill in: \n- First name \n- Telephone number");
		}
	}
	else if( document.getElementById("newsletter2").value == 'on' )
	{
		if( (document.getElementById("firstName2").value != "First name") && (document.getElementById("emailaddress2").value != "email@address.com") )
		{
			setTimeout("document.forms['contactForm2'].submit();", 700);
		}
		else
		{
			alert("Please fill in: \n- First name \n- E-mailaddress");
		}
	}
    else if( document.getElementById("telephone2").value != "Telephone number" )
    {
		setTimeout("document.forms['contactForm2'].submit();", 700);
    }
    else if( document.getElementById("emailaddress2").value != "email@address.com" )
    {
		setTimeout("document.forms['contactForm2'].submit();", 700);
    }
	else
	{
		alert("Please fill in: \nTelephone number or E-mailaddress");
	}
}

// Consultant profiles
function profile(profile)
{
	if( profile == 'short' )
	{
		$('.consultantButton#short').css( { backgroundColor:"#A79E85", color:"#4B4B46" } );
		$('.consultantButton#extended').css( { backgroundColor:"#D3CEC2", color:"#FFFFFF" } );
		
		$('.consultantExtendedInfo').css( { display:"none" } );
		$('.consultantShortInfo').css( { display:"block" } );
	}
	else
	{
		$('.consultantButton#extended').css( { backgroundColor:"#A79E85", color:"#4B4B46" } );
		$('.consultantButton#short').css( { backgroundColor:"#D3CEC2", color:"#FFFFFF" } );
		
		$('.consultantExtendedInfo').css( { display:"block" } );
		$('.consultantShortInfo').css( { display:"none" } );
	}
}

// Contact Popup
contactOpen = 'false';
function contactUs()
{
	if( contactOpen == 'false' )
	{
		$('#contactList').animate( { height:"358px" }, 500 );
		$('#contactList').animate( { height:"338px" }, 200 );
		contactOpen = 'true';
	}
	else
	{
		$('#contactList').animate( { height:"358px" }, 200 );
		$('#contactList').animate( { height:"0px" }, 500 );
		contactOpen = 'false';
	}
}

// Treatment Popup
function openTreatment()
{
	$('#treatmentsView').css( { display:"block", height:"0px" } );
	$('#treatmentsView').animate( { height:"457px" }, 500 );
}
function closeTreatment()
{
	setTimeout("closeTreatment2()", 500);
	$('#treatmentsView').animate( { height:"0px" }, 480 );
}
function closeTreatment2()
{
	$('#treatmentsView').css( { display:'none' } );
}

// Body Explorer
function bodyExplorer(tab)
{
	$('.tabsDiv').css( { backgroundColor:"#FFFFFF", opacity:"0.5", color:"#000" } );
	$('.tabsDiv#tab'+tab).css( { backgroundColor:"#A79E85", opacity:"1.0", color:"#FFF" } );
	
	$('.tabsContent').css( { display:"none" } );
	$('.tabsContent#tabs'+tab).css( { display:"block", opacity:"1.0", color:"#FFF" } );
	
	$('.tabsDiv2').css( { backgroundColor:"#FFFFFF", opacity:"0.5", color:"#000" } );
	$('.tabsDiv2#tab'+tab).css( { backgroundColor:"#A79E85", opacity:"1.0", color:"#FFF" } );
	
	$('.tabsContent2').css( { display:"none" } );
	$('.tabsContent2#tabs'+tab).css( { display:"block", opacity:"1.0", color:"#FFF" } );
}

// Interview movie starten
interviewStarted = false;
function openInterview()
{
	if( interviewStarted == false )
	{
		$('#interviewMovie').animate( { border:"1px solid #a79e85" }, 1 );
		$('#interviewMovie').animate( { height:"600px" }, 400 );
		$('#interviewMovieClose').animate( { height:"25px" }, 100 );
		$('#interviewMovie2').animate( { border:"1px solid #a79e85" }, 1 );
		$('#interviewMovie2').animate( { height:"600px" }, 400 );
		$('#interviewMovieClose2').animate( { height:"25px" }, 100 );
		interviewStarted = true;
	}
	else
	{
		$('#interviewMovie').animate( { height:"0px" }, 400 );
		$('#interviewMovieClose').animate( { height:"0px" }, 100 );
		$('#interviewMovie').animate( { border:"0px solid #a79e85" }, 1 );
		$('#interviewMovie2').animate( { height:"0px" }, 400 );
		$('#interviewMovieClose2').animate( { height:"0px" }, 100 );
		$('#interviewMovie2').animate( { border:"0px solid #a79e85" }, 1 );
		interviewStarted = false;
	}
}

treatmentHeight = 590;

function treatmentLength()
{
	height = 590;
	if( document.getElementById('sliderTreatmentNr-1').offsetHeight > height )
	{
		height = document.getElementById('sliderTreatmentNr-1').offsetHeight;
	}
	else if( document.getElementById('sliderTreatmentNr-2').offsetHeight > height )
	{
		height = document.getElementById('sliderTreatmentNr-2').offsetHeight;
	}
	else if( document.getElementById('sliderTreatmentNr-3').offsetHeight > height )
	{
		height = document.getElementById('sliderTreatmentNr-3').offsetHeight;
	}
	
	if( height == 590 )
	{
		
	}
	else
	{
		treatmentHeight = height;
	}
	
	cHead1 = parseInt(treatmentHeight) + 60;
	cCont1 = parseInt(treatmentHeight) + 60 + 30;
	
	cHead2 = parseInt(treatmentHeight) + 60 + 31;
	cCont2 = parseInt(treatmentHeight) + 60 + 31 + 30;
	
	cHead3 = parseInt(treatmentHeight) + 60 + 31 + 31;
	cCont3 = parseInt(treatmentHeight) + 60 + 31 + 31 + 30;
	
	$('#head1').css( { marginTop : "0px" } );
	$('#head2').css( { marginTop : cHead2+"px" } );
	$('#head3').css( { marginTop : cHead3+"px" } );
	
	$('#head1Content').css( { height : treatmentHeight + "px", marginTop : "30px" } );
	$('#head2Content').css( { height : treatmentHeight + "px", marginTop : cCont2+"px" } );
	$('#head3Content').css( { height : treatmentHeight + "px", marginTop : cCont3+"px" } );
	
	cTreatmentHeight = parseInt(treatmentHeight) + 60 + 31 + 31 + 31;
	$('#treatmentAccordion').css( { height : cTreatmentHeight+"px" } );
}

function treatmentTab(id)
{
	$('.treatmentsKop').css( { "backgroundColor":"#c9c9c8" } );
	$('.treatmentsKop#treatmentsKop'+id).css( { "backgroundColor":"#4b4b46" } );
	
	$('.treatmentsContent').css( { "display":"none" } );
	$('.treatmentsContent#treatmentsContent'+id).css( { "display":"block" } );
}
function promotion(val)
{
		$('#megaPromo').animate( { height:"168px", width:"465px", "top" : "308px" }, 700 ).fadeOut(400);
		
}
$('#promoTimer').animate( { width:"946px" }, 6000);

time = setTimeout("promotion()", 5000);


function promotionOpen(val)
{
	
	$('#megaPromo').fadeIn(300).animate( { height:"476px", width:"946px", "top" : "0px" }, 600);

	
}



function closePromo()
{ 
	$('#megaPromo').animate( { height:"168px", width:"465px", "top" : "308px" }, 500 ).fadeOut(300);

	window.clearTimeout(time);
} 

pos = false;
function showPreview(divid)
{
	if(pos == false)
	{
		$('#video_'+divid).animate( { height:"250px"}, 500 );
		pos=true;
	}
	else
	{
		$('#video_'+divid).animate( { height:"0px"}, 500 );
		
		pos=false;
	}
}

