writeFlashTransparent = function(s,w,h,a) {
  
  var alternateContent = a;
  if (alternateContent == '') {
    alternateContent = 'Voor deze site heeft u <a target="_blank" href="http://www.microsoft.com/download/">Microsoft Internet Explorer</a> versie 5.5 (of hoger) en de <a target="_blank" href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&P5_Language=English">Macromedia Flash plugin</a> versie ' + requiredVersion + ' (of hoger) nodig.'
  }

  var flashContent = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WMODE="transparent" WIDTH="'+w+'" HEIGHT="'+h+'" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
  + '<PARAM NAME="MOVIE" VALUE="'+s+'">'
  + '<PARAM NAME="PLAY" VALUE="true">'
  + '<PARAM NAME="LOOP" VALUE="false">'
  + '<PARAM NAME="QUALITY" VALUE="high">'
  + '<PARAM NAME="WMODE" VALUE="transparent">'
  + '<PARAM NAME="MENU" VALUE="false">'
  + '<EMBED SRC="'+s+'" WIDTH="'+w+'" HEIGHT="'+h+'" PLAY="true" LOOP="false" QUALITY="high" WMODE="transparent" MENU="false" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'
  + '<NOEMBED>' + alternateContent + '</NOEMBED></OBJECT>';

  if (hasRightVersion) {
    document.write(flashContent);
  } else {
    document.write(alternateContent);
  }
}


/* For the video player to measure the views */
function onMediaClipStart( data ) {
 var id = data.id;
 document.getElementById('contentViewCounter'+id).innerHTML='<img src="/web/contentViewCounter?contentid=' + id + '" width="0" height="0" style="display: none" alt="" />';
} 


/* Only try to load an alternative image url once */
function ImgError(source,alternative){
	source.src = alternative;
	source.onerror = "";
	return true;
}



	
	
	// JavaScript Document By Trance
$(function(){
		try{
		$(".ocdoor span").doors();
		$("#ppt").fcs();
		tab("#toptab","h3","#topcon","div","click");
		tab("#phtab","li","#phtabn","div","mouseover");
		tab("#navt","a","#navn","div","mouseover");
		/*Ranking Switch*/
	    tab("#ranktab","h3","#rankcon","div","mouseover");
		}catch (e){}
		//var curh3=$("#toptab").find("h3.cur");
		$("#toptab").find("h3").click(function(){
				//alert($(this).attr("class"))
				$("#toptab").toggleClass("tgl");
			})
		 //隔行换色
		$(".tabbg").find("tr:odd").addClass("odd");
		$(".drill_name").find("tr:odd").addClass("odd");
		$(".phtabn").find("tr:odd").addClass("odd");
	})
	/*标记当前*/
	function cur(ele,currentClass,tag){
		var ele= $(ele)|| ele ;
		var tag= tag || "";
		var mark= currentClass || "cur";
		ele.addClass(mark).siblings(tag).removeClass(mark);
		}
	/*选项卡*/
	
	function tab(id_tab,tag_tab,id_con,tag_con){
	$(id_tab).find(tag_tab).each(function(i){
	$(id_tab).find(tag_tab).eq(i).mouseover(
		function(){
			cur(this);
			$(id_con).find(tag_con).eq(i).show().siblings(tag_con).hide();
			}
		)									  
	})	
	}
//收缩展开栏目
	$.fn.doors=function(){
			var _this=this;
			_this.click(function(e){
			var span=$(e.target);
			var div =span.parents(".clearfix").find(".chcon");
			span.toggleClass("open");
			div.toggle();
		})
		}
	//Focus 幻灯片	
	$.fn.fcs=function(opt){
		var dft={
			auto:true,
			fout:200,
			fint:300,
			antm:300,
			itvl:3000
			}
		if(opt){
			dft=$.extend(dft,opt);
			}	
		var tmr=false;	
		var idx=0;
		var ppt=$(this);
		var mpc=$("#mpc");
		var div=mpc.find("div");
		var mlen=div.length;
		var h2=ppt.find("h2");
		var ul=ppt.find("ul");
		var li="";
		for (i=0; i<mlen; i++){
			li+="<li>"+(i+1)+"<\/li>";
			}
		ul.html(li);
		li=ul.find("li");
		cur(li.eq(0));
		li.bind("click",function(e){
			tar=$(e.target);							 
			if(tar.hasClass("cur")){
				return;
				}else{
				idx=li.index(tar[0]) ; 
				cur(tar);
				mpc.find("div:visible").fadeOut(dft.fout,function(){
				div.eq(idx).fadeIn(dft.fint);});
				ppt.find("h2:visible").slideUp(dft.fout,function(){
				h2.eq(idx).slideDown(dft.fint);});	
				}
			})
		
		if(!dft.auto){
			return;
			}else{
				start();
			}
			
		ppt.hover(function(){ pause()},function(){start()});
		function play(){
				idx++;
                if(idx==mlen){idx=0;}
                li.eq(idx).click();
			}
		function pause(){
			if(tmr) clearInterval(tmr);
			}	
		function start(){
			tmr=setInterval(play, dft.itvl);
			}
		
	}

