try{
	var talent_ad = new Array();
	var mcid = new Array();
	var qazplm = (new Date()).getTime() + '_' + Math.floor(Math.random()*999999) + '_' + Math.floor(Math.random()*999999) + Math.floor(Math.random()*999999);

	if (getCookie("R_PR")!= undefined && getCookie("R_PR") != ""){
		$.getJSON("/upload1/104main/besttalent/besttalent.data?isnt=yes",{"qazplm":qazplm},
		function(data){
			var BTroot = data;
			var out_mcid = 0;
				for(var i=0;i<BTroot.info.length;i++){
					if (SearchBT(BTroot.info[i].adid)){
						switch(bt_block){
							case 'best_ap' :
								out_mcid = BTroot.info[i].mcid.split(",")[1];
								break;
							case 'best_jl' :
								out_mcid = BTroot.info[i].mcid.split(",")[2];
								break;
							case 'best_my' :
								out_mcid = BTroot.info[i].mcid.split(",")[3];
								break;
							case 'best_sj' :
								out_mcid = BTroot.info[i].mcid.split(",")[4];
								break;
						}
						talent_ad.push({
							'adid':BTroot.info[i].adid,
							'url':BTroot.info[i].url,
							'sub':BTroot.info[i].sub,
							'mcid':out_mcid,
							'start':BTroot.info[i].start,
							'end':BTroot.info[i].end
							});
						mcid.push(out_mcid);
					}
				}
				if (talent_ad != ""){
					adc(mcid,2);
					$(document).ready(function(){
						besttalent_request_done(talent_ad);
					});
				}
		});
	}else if (getCookie("R_PR") == undefined || getCookie("R_PR") == ""){
		if (bt_block == 'best_jl' || bt_block == 'best_sj'){
			if (getCookie("R_PF") != undefined && getCookie("R_PF") != ""){
				(new Image).src = "/jobbank/besttalent.cfm";
			}
		}
	}

	var talent_flag = "";
	function SearchBT(no){
		talent_flag = getCookie("R_PR");
		talent = talent_flag.split(",");
		if (talent.length > 1) {
			if (talent[1] != "_"){
				talent_no = talent[1].split("_");
				for(var x=0;x<talent_no.length;x++){
					if (talent_no[x] == no){
						return true;
					}
				}
			}
		}
		return false;
	}

	function adc(x,y){
		if (top.location.href.indexOf("https://")>=0)
			return;

		var path_link = "http://screw.104.com.tw/nonsense.htm?utmad=1&utmac=UA-2795003-2&prj=besttalent";
		if (x){
			y = (y)?y:1;
			path_link += "&adlist=" + x + "&cat=" + y + "&qazplm=" + qazplm;
			(new Image).src = path_link;
		}
	}
}catch(e){}
