// testimomial.jsp specific JavaScript functions.

function testimonial_init(){

	var message = common_getCookie('SendEmailFatal');
	if (message!=null && message!=""){
	    common_showBareId('testimonial_showFatal');
	    common_expireCookie('SendEmailFatal');	    
	}

	var error = common_getCookie('SendEmailError');
	if (error!=null && error!=""){
	    common_showBareId('error');
	    common_expireCookie('SendEmailError');

	    error = common_getCookie('TestimonialErrorSenderFirstName');
		if (error!=null && error!=""){
		    common_showBareId('errorSenderFirstName');
		    common_expireCookie('TestimonialErrorSenderFirstName');
		}

	    error = common_getCookie('TestimonialErrorSenderLastName');
		if (error!=null && error!=""){
		    common_showBareId('errorSenderLastName');
		    common_expireCookie('TestimonialErrorSenderLastName');
		}

	    error = common_getCookie('TestimonialErrorSenderEmail');
		if (error!=null && error!=""){
		    common_showBareId('errorSenderEmail');
		    common_expireCookie('TestimonialErrorSenderEmail');
		}

	    error = common_getCookie('TestimonialErrorSubject');
		if (error!=null && error!=""){
		    common_showBareId('errorSubject');
		    common_expireCookie('TestimonialErrorSubject');
		}

	    error = common_getCookie('TestimonialErrorComments');
		if (error!=null && error!=""){
		    common_showBareId('errorComments');
		    common_expireCookie('TestimonialErrorComments');
		}
	}

	var confirmation = common_getCookie('SendEmailConfirmation');
	if (confirmation!=null && confirmation!=""){
	    common_showBareId('confirmation');
	    common_hideBareId('testimonialFormDIV');
	    common_expireCookie('SendEmailConfirmation');	    
	}

	var firstName = common_getCookie('TestimonialValueFirstName');
	if (firstName!=null && firstName!=""){
		if (document.getElementById("name")){
			document.getElementById("name").value=firstName;
		}
	    common_expireCookie('TestimonialValueFirstName');	    
	}	
	var lastName = common_getCookie('TestimonialValueLastName');
	if (lastName!=null && lastName!=""){
		if (document.getElementById("last-name")){
			document.getElementById("last-name").value=lastName;
		}
	    common_expireCookie('TestimonialValueLastName');	    
	}	
	var email = common_getCookie('TestimonialValueEmail');
	if (email!=null && email!=""){
		if (document.getElementById("email")){
			document.getElementById("email").value=email;
		}
	    common_expireCookie('TestimonialValueEmail');	    
	}	
	var subject = common_getCookie('TestimonialValueSubject');
	if (subject!=null && subject!=""){
		if (document.getElementById("subject")){
			document.getElementById("subject").value=subject;
		}
	    common_expireCookie('TestimonialValueSubject');	    
	}	
	var comments = common_getCookie('TestimonialValueComments');
	if (comments!=null && comments!=""){
		if (document.getElementById("comments")){
			document.getElementById("comments").value=comments;
		}
	    common_expireCookie('TestimonialValueComments');	    
	}	
	var contactus = common_getCookie('TestimonialValueContact');
	if (contactus!=null && contactus!=""){
		if (document.getElementById("contactus")){
			document.getElementById("contactus").checked=true;
		}
	    common_expireCookie('TestimonialValueContact');	    
	}	
}
