// Global Variables

// jQuery Plugins
$(document).ready(function(){
	$(".get-coupon").colorbox({width:"80%", height:"80%", iframe:true});
	$(".rate").colorbox({width:"400px", height:"286px", iframe:true});
	$("select").uniform();
});

// Smooth Scroll
$(function(){
	$("a[href*=#]").click(function() {
		if(location.pathname.replace(/^\//,"") == this.pathname.replace(/^\//,"") && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $("[name=" + this.hash.slice(1) +"]");
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$("html,body").animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});
});

// Form Validation Plugin
/*jQuery.noConflict();
jQuery(document).ready(function() {
	jQuery("a[id^='success']").click(function(){
		jQuery("div[id^='result']").html('');
		var id = jQuery(this).attr('value');
		jQuery.ajax({
		   type: "POST",
		   url: "rate.php",
		   data: 'success=1&couponid='+id,
		   success: function(data){
			 jQuery('#result'+id).html(data);
		   }
		 });
	});
	jQuery("a[id^='notsuccess']").click(function(){
		jQuery("div[id^='result']").html('');
		var id = jQuery(this).attr('value');
		jQuery.ajax({
		   type: "POST",
		   url: "rate.php",
		   data: 'success=-1&couponid='+id,
		   success: function(data){
			 jQuery('#result'+id).html(data);
		   }
		 });
	});
});*/
