//播放廣告
function playAd(place) {
	$("#ad_for_video").show();
	
	if (place == "before") {//影音前廣告
		ad1 ="<iframe src='http://www.nownews.com/include_ver8/js/ad/ad_befor_video.htm' width='300' height='250' frameborder='0' scrolling='no' name='win' id='win'></iframe>";
		$("#text_report").hide();
		$("#videonews").hide();
		$("#before_video").show();
		$("#after_video").hide();
		$("#before_video").html(ad1);
		int=setTimeout("skipAd('before')",7000);
	} else if (place=="after") {//影音後廣告
		ad2 ="<iframe src='http://www.nownews.com/include_ver8/js/ad/ad_after_video.htm' width='300' height='250' frameborder='0' scrolling='no'></iframe>";
		$("#text_report").hide();
		$("#videonews").hide();
		$("#before_video").hide();
		$("#after_video").show();
		$("#after_video").html(ad2);
		int=setTimeout("skipAd('after')",40000);
	}
}

// call flash 播新聞
function callflash() {
	window.document.f2j.SetVariable("playchk", "ok");
}

//關閉廣告並call flash 播新聞
function skipAd(place) {
	$("#ad_for_video").hide();	
	$("#text_report").show();
	$("#videonews").show();	
	if (place == "before") {
		$("#before_video").hide().remove();
		//若是影音前廣告，要去call flash播新聞
        setTimeout("callflash()",200);		
	} else if (place=="after") {
		$("#after_video").hide().remove();
	}
}
