var iwads = function()
{
	function _reloadAd(wpid){
		window.frames['AD_'+ wpid].location.reload();
	}

	function _reloadAllAds(){
		jQuery('.iwad_wpid').each(function(){
			//alert(jQuery(this).data('wpid'));
			if( jQuery(this).data('adtype') == 3){
				var wpid =  jQuery(this).data('wpid');
				jQuery('#AD_'+ jQuery(this).data('wpid')).each(function(){
					_reloadAd(wpid);
					//this.contentWindow.location.reload(true);
				});
			}
		});
	}

	// public
	return new function(){
		this.reloadAd 		= _reloadAd;
		this.reloadAllAds 	= _reloadAllAds;
	}
}()
