$(document).ready(function(){
 	$('input[id^=contact_email]').keyup(function() {
        $('form[id^=ContactForm]').attr('action','http://www.uhwg.com.au/cfsubmit.php?action=sendCF');
    });

    $('.nojs').hide();
    $('form[id^=ContactForm]').css('display','block');

$('input[type=text]').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		});

$('input[type=password]').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		});

$('textarea').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		});




	$('#slideshow').cycle({ 
			fx: 'scrollHorz',
			speed:  300,
			pager:  '.paging',
			prev:   '#prev',
    		next:   '#next',
			pause: 1,
			timeout:  5000
		});
	
var slideCount = $('.paging').children().size();
var pagingW = 27 * slideCount;
$('.paging').width(pagingW);





$('.styled').selectbox();

$('.selWrap').click(function () {
	$('.selWrap').each(function() {
		$(this).removeClass('over');
	 });
	 $(this).addClass('over');
	// over means this has highest z index from all selectbox
	
});



		$('#Menu ul > li').hover(function() {									 
			$(this).addClass('over');
			return false;
			
		},
		function() {
			$(this).removeClass('over');
		});
	
		$('#Menu ul li.menuItem').each(function(intIndex) {									 
			$(this).addClass('menu-' + intIndex);
		});
		$('#Menu ul li:last-child').addClass('last');
});


