// JavaScript Document

$(document).ready(function(){
	//show clock time
	//ShowToday();StartTime();
	//round conner
	/*	
	
	if(!$.browser.msie)// && $.browser.version < 8)
	{
		//$('.search').corner("round 12px");
	}*/
	$('.payment_block').corner("round 7px");
	$('.payment_block_title a').corner("round top 7px");
	$('.payment_block img').corner("round bottom 7px");
	$('.scroll_bestseller').corner("round 12px");
	$('.main_product_detail').corner("round 10px");
	$('.product_description').corner("round 5px");
	$('.product_content_tab').corner("round 5px");
	$('.nav_vote_title').corner("round top 5px");
	$('.nav_vote').corner("round 5px");
	
	//load menu
	ddsmoothmenu.init({
		mainmenuid: "smoothmenu2", //menu DIV id
		orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
		classname: 'ddsmoothmenu2', //class added to menu's outer DIV
		//customtheme: ["#1c5a80", "#18374a"],
		contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	});
	
	$("#input_search").click(function(){
		$(this).val("");
	});
	$("#input_search").blur(function(){
		var str=$(this).val();
		var str_lang='';
		var lang=$("#langkey").val();
		if(lang=='en') str_lang="Type a text here"; else str_lang="Gõ từ cần tìm vào đây";
		if(str=='') $(this).val(str_lang);
	});

	//lightbox
	$('#product_detail_left a').lightBox({ 
		imageLoading:			sitepath+'images/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
		imageBtnPrev:			sitepath+'images/lightbox/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
		imageBtnNext:			sitepath+'images/lightbox/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
		imageBtnClose:			sitepath+'images/lightbox/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
		imageBlank:				sitepath+'images/lightbox/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
		fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
		containerResizeSpeed:	400,			 // Specify the resize duration of container image. These number are miliseconds. 400 is default.
		overlayBgColor: 		"#000",		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
		overlayOpacity:			.9,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
		txtImage:				'Hình ảnh',				//Default text of image
		txtOf:					'/'
	});
	
	
	//resize img
	/*$("#product_detail_wrap img").load(function(){
	var w=$("#product_detail_wrap img").width();
	var h=$("#product_detail_wrap img").height();
	var nw=650,nh=650;
	var rw=0,rh=0;ratio=0;
	
	rw=nw/w; rh=nh/h; ratio=(rw>rh) ? rh : rw;
	(ratio>1) ? nw=w : nw=ratio*w;
	//alert(ratio);
	
	$("#product_detail_wrap img").css("width",nw);
	$("#product_detail_wrap img").css("height","auto");
	});*/

});





