jQuery.fn.ImageAutoSize = function(width,height)
{
    $("img",this).each(function()
    {
        var image = $(this);
        if(image.width()>width)
        {
            image.width(width);
            image.height(width/image.width()*image.height());
        }
        if(image.height()>height)
        {
            image.height(height);
            image.width(height/image.height()*image.width());
        }
    });
} 


$(document).ready(function() {
	// do something here
$(".img").ImageAutoSize(500,500);
$(".keywords").each(function(){
        if(this.value == '')
      this.value = this.title;
    })
	.focus(
			function(){$(this).parents("form").css("border","1px solid #c30")
			if(this.value == this.title) 
			this.value = '';
				})
	.blur(
			function(){
		   $(this).parents("form").css("border","1px solid #422120");
		    if(this.value == '')
            this.value = this.title;
		   });

$(".prolist li").hover(function(){
					   $(this).css({"background-color":"#F2EBDB","background-position":"200px"});
					   },function(){
						   $(this).css({"background-color":"transparent","background-position":"10px"});
					   })
$(".productslist").hover(function(){
					   $(this).addClass("on");
					   },function(){
						   $(this).removeClass("on");
					   });
$(".feedback").find("input:text,input:password,textarea").css({"border":"1px solid #7F9DB9","background-color":"#fff","color":"#999","padding":"2px 0"})
.focus(
			function(){$(this).css({"border":"1px solid #AA9166","background-color":"#F1EBE4"})
		
				})
	.blur(
			function(){
		   $(this).css({"border":"1px solid #7F9DB9","background-color":"#fff"});
		   });

if($("#wrap").height()>$("#LeftSideColumn").height()-40){
$(".leftbar").height($("#wrap").height()-$("logo").height())};
});
