
function clearInput(formfield)
{
  if (formfield.defaultValue==formfield.value)
   	formfield.value = ""
}
function fillInput(formfield)
{
  if (formfield.value== "")
   	formfield.value = "Search using key words"
 }

$.fn.equalHeight = function () {
		var height		= 0;
		var maxHeight	= 0;
	
		// Store the tallest element's height
		this.each(function () {
			height		= $(this).outerHeight();
			maxHeight	= (height > maxHeight) ? height : maxHeight;
		});
	
		// Set element's min-height to tallest element's height
		return this.each(function () {
			var t			= $(this);
			var minHeight	= maxHeight - (t.outerHeight() - t.height());
			var property	= $.browser.msie && $.browser.version < 7 ? 'height' : 'min-height';
	
			t.css(property, minHeight + 'px');
		});
};

$(document).ready(function() {
						   
   	//$('.heroHook').equalHeight();
						  
	$(".newsletter").colorbox({iframe:true, innerWidth:412, innerHeight:170});
	
	//alert($(window).height());
	
	var viewport = $(window).height();
	
	var totalHeight = $('#headerContainer').height() + $('#heroContainer').height() + $('#heroHooksContainer').height() + $('#homeContentContainer').height() + $('#footerContainer').height();
	
	var footer = $('#footerContainer').height();
	//alert(totalHeight);
	
	if(viewport > totalHeight) {
		//$('#footerContainer').height(viewport - (totalHeight + footer));
	}
	
	$('.pageGraphicsHome li.active').show();
	
	    setInterval(function() {
		if($('.pageGraphicsHome li.active').next().length != 0){
          $('.pageGraphicsHome li.active').removeClass('active').fadeOut(2500).next().fadeIn(2500).addClass('active');
		} else {
			$('.pageGraphicsHome li.active').fadeOut(2500).removeClass('active');
			$('.pageGraphicsHome li:first').fadeIn(2500).addClass('active');
		}
    }, 4000);

	$('ul.topNav li').hover(function(){
               $(this).addClass('over');
        }, function() {
               $(this).removeClass('over');
        });
		
		
	$('#form .content_2').hide();	
	$('#form .content_3').hide();	
	
	///////////--product version selector--/////////

	$('.selectType').change(function() {
		var selectVal = $(this).val();	 
		//alert(selectVal);  
	 	
		if(selectVal == 2) {
			$('#form .content_2').show();	
			$('#form .content_3').hide();	
		} else if(selectVal == 3) {
			$('#form .content_2').show();	
			$('#form .content_3').show();	
		} else {
			$('#form .content_2').hide();	
			$('#form .content_3').hide();	
		}
	 
	});
	
	
});
