// JavaScript Document
jQuery(function( $ ){
	var isOverGoogleAd_160 = false;
	$( ".gsense-160 iframe[ id *= google ]" ).mouseover(function(){ isOverGoogleAd_160 = true; }).mouseout(function(){ isOverGoogleAd_160 = false; });
	
	var isOverGoogleAd_728 = false;
	$( ".gsense-728 iframe[ id *= google ]" ).mouseover(function(){ isOverGoogleAd_728 = true; }).mouseout(function(){ isOverGoogleAd_728 = false; });
	
	//var isOverGoogleAd_336 = false;
	//$( ".gsense-336 iframe[ id *= google ]" ).mouseover(function(){ isOverGoogleAd_336 = true; }).mouseout(function(){ isOverGoogleAd_336 = false; });
		
	$( window ).blur(
		function(){
			var flag = false;
			var adType = '';
			
			if (isOverGoogleAd_160) { flag = true; adType = '160'; }
			if (isOverGoogleAd_728) { flag = true; adType = '728'; }
			//if (isOverGoogleAd_336) { flag = true; adType = '336'; }
			
			if (flag){
				$.ajax({
					type: "post",
					url: "track",
					data: {
						adUrl: window.location.href,
						adType: adType
					}
				});
			}
		}
	)
	.focus();
});
