function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function autol(){
	var l = $("#Headbox_l").offset().left;//alert(l);
	$('iframe').attr('style', 'position: absolute; left: '+ parseInt($("#Headbox_l").offset().left+20) +'px; top: 150px; display: inline;width:267px;height:285px;overflow:hidden;');//.width('280').height('320');
}

$(function(){
	$('#FocusPostionOnly').html('<div id="flashContent">\n\
				<object type="application/x-shockwave-flash" data="/ad/flash/newfocus.swf" width="995" height="350" id="newfocus" align="middle">\n\
					<param name="movie" value="/ad/flash/newfocus.swf" />\n\
					<param name="quality" value="high" />\n\
					<param name="bgcolor" value="#cccccc" />\n\
					<param name="play" value="true" />\n\
					<param name="loop" value="true" />\n\
					<param name="wmode" value="transparent" />\n\
					<param name="scale" value="showall" />\n\
					<param name="menu" value="true" />\n\
					<param name="devicefont" value="true" />\n\
					<param name="salign" value="" />\n\
                    <param name="flashvars" value="xmlroot=/flash/?'+ Math.random() +'" />\n\
					<param name="allowScriptAccess" value="sameDomain" />\n\
					<a href="http://www.adobe.com/go/getflash">\n\
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />\n\
					</a>\n\
				</object>\n\
		</div>');
	
	$('body').mousemove(function(e){
		var xx = e.pageX;yy = e.pageY;cc = $("#Headbox_l").offset().left;
		//$("input").val(cc+' '+$("#Headbox_l").offset().top);
		if(xx<cc || xx>990+cc || yy<80 || yy>475 || (xx<333+cc && yy<130) || (xx>733+cc && yy<130)) MM_showHideLayers('Headmenushownews','','hide','HeadmenushowDrama','','hide','HeadmenushowProgram','','hide');
	});
	//autol();
	$(".drama_zt1").append('<img src="/skin/021php/images/drama_zt1.gif" style="width:79px;height:78px;margin:-130px 0 52px 4px;padding:0;background-image:none;" />');
	$(".drama_zt2").append('<img src="/skin/021php/images/drama_zt2.gif" style="width:79px;height:78px;margin:-130px 0 52px 4px;padding:0;background-image:none;" />');
	
	
	$("a").each(function(){
		h0 = $(this).attr('href');	h1 = h0.substring(h0.lastIndexOf("/")+1);	h2 = h1.substring(h1.lastIndexOf('.'));
		if(h2 == '.html'){
			regNum=/^\d*$/;	h = h1.replace(h2, '');
			if(regNum.test(h) || h.length == 32) $(this).attr('target', '_blank');
		}
	});
	
});

function Continue() {
            try {
                document.getElementById("newfocus").Continue();
            }
            catch (e) {
                //alert(e);
            }
        }
        function Pause() {
            try {
                document.getElementById("newfocus").Pause();
            }
            catch (e) {
                //alert(e);
            }
            
        }
		function ChangeDiv(divname,src){
			var did = src.replace('?', '').replace('.', '').replace('/', '').replace('/', '').replace('/', '');//alert(did);
			if(!$("#"+did).html()){$.get(src, {}, function(d){$("body").append("<span style='display:none;' id='"+did+"'><div style='width:267px;height:265px;' onmousemove='Pause()'  onmouseover='Pause()' onmouseout='Continue()'>"+d+"</div></span>");$("#"+divname).html($("#"+did).html());});}
			$("#"+divname).html($("#"+did).html());
			$("#"+divname+" a").attr('target', '_blank');
		}
