

$(document).ready(function()
{
	var url = document.location.href.split('#');
	if( url.length >= 1 )
		url = url[1];
		
	var values = url.split('&');
	var email;
	var doctor;
	var location;
	
	for( var i = 0 ; i < values.length ; i++ )
	{
		if( values[i].substr(0, 8) == 'DoctorID')
			doctor = values[i].substr( 9, values[i].length - 9 );

		if( values[i].substr(0, 10) == 'LocationID')
			location = values[i].substr( 11, values[i].length - 11 );

		if( values[i].substr(0, 7) == 'EmailID')
			email = values[i].substr( 8, values[i].length - 8 );
	}

	
	$('#destination').val(email);
	$('#Location').val(location);
	$('#Doctor').val(doctor);
})

var email = false;                                                     
function isEmail( txt )
{
	return txt != '';
}

function check()
{                                                
	if( email && !isEmail( document.getElementById( "Contact" ).value ) )
	{
		alert( 'Please specify an email address where we can reach you.' );
		return false;
	}
	else       
	{
		return validateForm('form');
	}

}

