/* Custom Javascript */

$(document).ready(function(){

	if($('form#contact_form').length) {
		
		contact_form = $('form#contact_form').get(0);
		
		$('a#contact_form_reset').click(function() {contact_form.reset();});
		
		$('a#contact_form_submit').click(function() {
		
			var name = $('input#name').val();
			var from = $('input#from').val();
			var phone = $('input#phone').val();
			var fax = $('input#fax').val();
			var address = $('input#address').val();
			var comments = $('textarea#comments').val();
			
			var sent_message = 'name: ' + name  + '\n' +
							   'from: ' + from  + '\n' +
							   'phone: ' + phone  + '\n' +
							   'fax: ' + fax  + '\n' +
							   'address: ' + address  + '\n' +
							   'comments: ' + comments  + '\n';
							   			
			$('input#message').val(sent_message);
			
			
			contact_form.submit();
		});
		
		toggleInputFormDefault("name", "\u00A0\u00A0your name");
		toggleInputFormDefault("from", "\u00A0\u00A0e-mail");
		toggleInputFormDefault("phone", "\u00A0\u00A0phone");
		toggleInputFormDefault("fax", "\u00A0\u00A0fax");
		toggleInputFormDefault("address", "\u00A0\u00A0address");
		toggleTextAreaFormDefault("comments", "\u00A0\u00A0comments");
	
	
	}


	if($('#home-newsfeed').length) {
		
		$('#home-newsfeed').cycle( {
			fx: 'fade',
			timeout: 10000,
			speed: 1000,
			pager: '#home-newsfeed-pager'
		});
		
	}

	
});