/*
* @version : 2.4.1 (Patch 13)
* @update : 2011-12-14
* @author : บริษัท อีมีเดีย จำกัด
* @comment : Support CSC, 1150 VIP
*/

$(function(){
	if ($("div#plBannerSlide div.nivoSlider img").length > 1) {

		$("div#plBannerSlide div.nivoSlider").nivoSlider({
			effect: 'random', //Specify sets like: 'fold,fade,sliceDown'
			slices: 15,
			animSpeed: 500,
			pauseTime: 5000,
			startSlide: 0, //Set starting Slide (0 index)
			directionNav: true, //Next & Prev
			directionNavHide: true, //Only show on hover
			controlNav: true, //1,2,3...
			controlNavThumbs: false, //Use thumbnails for Control Nav
			//controlNavThumbsFromRel:false, //Use image rel for thumbs
			//controlNavThumbsSearch: '.jpg', //Replace this with...
			//controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav: false, //Use left & right arrows
			pauseOnHover: true, //Stop animation while hovering
			manualAdvance: false, //Force manual transitions
			captionOpacity: 0.8, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function(){} //Triggers after all slides have been shown
		});
	}

	/*$("div.pageHome a.btGetCoupon").click(function(e){
		e.preventDefault();

		blockPage();
		$.ajax({
			url: "api/coupon.php",
			data: "action=get_coupon",
			type: "get",
			cache: false,
			dataType: "text",
			complete: function (result) {
				unblockPage();
				dialogCoupon(result.responseText)
			},
			error: function(result) {
				unblockPage();
			}
		});
	});

	$("div.pageHome a.btGetCouponInfo").click(function(e){
		e.preventDefault();
		dialogCouponInfo();
	});

	$("div.pageHome a.btGetOnlineDeal").click(function(e){
		e.preventDefault();
		dialogOnlineDeal();
	});*/

	$("div.pageHome a.btGetHotPromotion").click(function(e){
		e.preventDefault();
		dialogHotPromotion();
	});


	renderDropDown("form#frmLocation select");
	bindStoreProvince("form#frmLocation select#province", "form#frmLocation select#amphur");

});

