var t_height,t_gap, container_height=0;
jQuery(document).ready(function(){
//search box
	var tl_keyword='Search';
	jQuery(".mainsearch .keyword").val(tl_keyword);
	
	jQuery(".mainsearch .keyword").bind("focus", function(){
  		if(jQuery(this).val()==tl_keyword) jQuery(this).val('');
	});
	
	jQuery(".mainsearch .keyword").bind("blur", function(){
  		if(jQuery(this).val()=='')	jQuery(this).val(tl_keyword);
	});

//check height	for background
	if(jQuery("#container").height()<550) jQuery("#content").height(550);
	checkheight();
	setInterval("checkheight()",2000);

//drop-down menu
    jQuery("#menu li").hover(function(){
      jQuery(this).addClass("hover");
		jQuery('ul:first',this).css('visibility', 'visible');
    }, function(){
        jQuery(this).removeClass("hover");
        jQuery('ul:first',this).css('visibility', 'hidden');
    });
    jQuery("#menu li ul li:has(ul)").find("a:first").append(" &raquo;");
});

function checkheight(){
	if(container_height!=jQuery("#container").height()){
		jQuery("#container").css({"padding-bottom":"0px","margin-bottom":"0px"});
		t_height=jQuery("#container").height() + jQuery("#header").height();
		//t_gap=Math.ceil(t_height/455)*455-t_height+216;
		t_gap=Math.ceil(t_height/200)*200-t_height+127;
		if(t_gap>=200) t_gap=t_gap-200;
		jQuery("#container").css({"padding-bottom":t_gap+"px"});
		container_height=jQuery("#container").height();
	}
}
