// JavaScript Document

$(document).ready(function() {
	   $(".dropdown dt a").click(function() {
			$(".dropdown dd ul").toggle();
			return false;
		});
					
		$(".dropdown dd ul li a").click(function() {
			var text = $(this).html();
			$(".dropdown dt a span").html(text);
			$(".dropdown dd ul").hide();
			$("#result").html("Selected value is: " + getSelectedValue("sample"));
			return false;
			
		});		
});

$(document).ready(function() {
	   $(document).click(function() {
			$(".dropdown dd ul").hide();
		});		
});


$(document).ready(function() {
		$("input[type=submit]").not('[class]').addClass('black_new');
});


$(document).ready(function() {
   $(".product-sec img").each(function(){
       $(this).css('display','none');
      
   });
});

$(window).load(function() {
   $(".product-sec img").each(function(){
      if($(this).width()>135){
		   var w = $(this).width();
		   var h = $(this).height();
		   $(this).height(Math.ceil((h*135)/w));
		   $(this).width(135);
		}

	   if($(this).height()>140){
           var w = $(this).width();
           var h = $(this).height();
           $(this).width(Math.ceil((w*140)/h));
           $(this).height(140);
       }
	   
		
   $(this).css('display','');
   });
});


$(document).ready(function() {
   $(".img_box img").each(function(){
       $(this).css('display','none');
      
   });
});

$(window).load(function() {
   $(".img_box img").each(function(){
      if($(this).width()>200){
		   var w = $(this).width();
		   var h = $(this).height();
		   $(this).height(Math.ceil((h*200)/w));
		   $(this).width(200);
		}

	   if($(this).height()>300){
           var w = $(this).width();
           var h = $(this).height();
           $(this).width(Math.ceil((w*300)/h));
           $(this).height(300);
       }
	   
		
   $(this).css('display','');
   });
});


$(document).ready(function() {
	   $(".dropdown2 dt a").click(function() {
			$(".dropdown2 dd ul").toggle();
			return false;
		});
					
		$(".dropdown2 dd ul li a").click(function() {
			var text = $(this).html();
			$(".dropdown2 dt a span").html(text);
			$(".dropdown2 dd ul").hide();
			$("#result").html("Selected value is: " + getSelectedValue("sample2"));
			return false;
		});
					
		
});

/* for right height
$(document).ready(function() {
	var rtheight = $(".right").height();
	$(".left").css('height',rtheight+100)
});
*/


$(document).ready(function() {
        var tabContainers = $('.content-section > div');
        tabContainers.hide().filter(':first').show();
			
			$('ul.tab-container a').click(function (){
            tabContainers.hide();
            tabContainers.filter(this.hash).show();
			$('ul.tab-container a').removeClass('active');
           $(this).addClass('active');
            return false;
        });
});

$(document).ready(function() {
        var tabContainers = $('.socialnetworkinfo > div');
        tabContainers.hide().filter(':first').show();
			
			$('ul.sociallink a').click(function (){
            tabContainers.hide();
            tabContainers.filter(this.hash).show();
			$('ul.sociallink a').removeClass('active');
           $(this).addClass('active');
            return false;
        });
});

$(document).ready(function() {
        var tabContainers = $('.slider-container > div');
        tabContainers.hide().filter(':first').show();
		$('ul.tablink a').click(function (){
        tabContainers.hide();
        tabContainers.filter(this.hash).show();
		$('ul.tablink a').removeClass('active');
        $(this).addClass('active');
        return false;
        });
});
