//page link
jQuery.easing.quart = function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(document).ready(function(){
jQuery('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});

});

//box height
$(document).ready(function(){
    $('#container, #rightcolumn').flatHeights(); //right column
    $('.recomendblockA').flatHeights(); //top ranking area
    $('.recomendblockB').flatHeights(); //top ranking area
    $('#feature div').flatHeights(); //feature
    
});

//form default text
$(document).ready(function(){
    $("input:text, input:password").each(function(){
        if(this.value == ''){
            this.value = this.title;
			$(this).css("color","#999");
		}else{
			$(this).css("color","#333");
		}
	 });
    $("input:text, input:password").focus(function(){
        if(this.value == this.title)
            this.value = '';
        	$(this).css("color","#333");
    });
    $("input:text, input:password").blur(function(){
        if(this.value == ''){
            this.value = this.title;
            $(this).css("color","#999");
          }
    });
    $("input:image, input:button, input:submit").click(function(){
        $(this.form.elements).each(function(){
            if(this.type =='text' || this.type =='textarea' || this.type =='password' ){
                if(this.value == this.title && this.title != ''){
                    this.value='';
                }
            }
        });
    });
});


//select width on IE
/*
$(function() {

    $(".classOpt select")

        .mouseover(function(){
            $(this)
                .data("origWidth", $(this).css("width"))
                .css("width", "auto");
        })

        .mouseout(function(){
            $(this).css("width", $(this).data("origWidth"));
        });

});
*/