if(typeof deconcept=="undefined"){var deconcept={}}
if(typeof deconcept.util=="undefined"){deconcept.util={}}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={}}
deconcept.SWFObject=function(l,o,x,Z,C,z,v,O,i,I,c){var w=this;if(!document.getElementById){return}
w.DETECT_KEY=c?c:"detectflash";w.skipDetect=deconcept.util.getRequestParameter(w.DETECT_KEY);w.params={};w.variables={};w.attributes=[];if(l){w.setAttribute("swf",l)}
if(o){w.setAttribute("id",o)}
if(x){w.setAttribute("width",x)}
if(Z){w.setAttribute("height",Z)}
if(C){w.setAttribute("version",new deconcept.PlayerVersion(C.toString().split(".")))}
w.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(z){w.addParam("bgcolor",z)}
var X=O?O:"high";w.addParam("quality",X);w.setAttribute("useExpressInstall",v);w.setAttribute("doExpressInstall",false);var V=(i)?i:window.location;w.setAttribute("xiRedirectUrl",V);w.setAttribute("redirectUrl","");if(I){w.setAttribute("redirectUrl",I)}};deconcept.SWFObject.prototype={setAttribute:function(i,I){this.attributes[i]=I},getAttribute:function(i){return this.attributes[i]},addParam:function(i,I){this.params[i]=I},getParams:function(){return this.params},addVariable:function(i,I){this.variables[i]=I},getVariable:function(i){return this.variables[i]},getVariables:function(){return this.variables},getVariablePairs:function(){var I=[];var i,l=this.getVariables();for(i in l){I.push(i+"="+l[i])}
return I},getSWFHTML:function(){var C=this,i="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(C.getAttribute("doExpressInstall")){C.addVariable("MMplayerType","PlugIn")}
i="<embed type=\"application/x-shockwave-flash\" src=\""+C.getAttribute("swf")+"\" width=\""+C.getAttribute("width")+"\" height=\""+C.getAttribute("height")+"\"";i+=" id=\""+C.getAttribute("id")+"\" name=\""+C.getAttribute("id")+"\" ";var o=C.getParams();for(var I in o){i+=[I]+"=\""+o[I]+"\" "}
var l=C.getVariablePairs().join("&");if(l.length>0){i+="flashvars=\""+l+"\""}i+="/>"}else{if(C.getAttribute("doExpressInstall")){C.addVariable("MMplayerType","ActiveX")}
i="<object id=\""+C.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+C.getAttribute("width")+"\" height=\""+C.getAttribute("height")+"\">";i+="<param name=\"movie\" value=\""+C.getAttribute("swf")+"\" />";var O=C.getParams();for(var I in O){i+="<param name=\""+I+"\" value=\""+O[I]+"\" />"}
var c=C.getVariablePairs().join("&");if(c.length>0){i+="<param name=\"flashvars\" value=\""+c+"\" />"}i+="</object>"}
return i},write:function(i){var o=this;if(o.getAttribute("useExpressInstall")){var I=new deconcept.PlayerVersion([6,0,65]);if(o.installedVer.versionIsValid(I)&&!o.installedVer.versionIsValid(o.getAttribute("version"))){o.setAttribute("doExpressInstall",true);o.addVariable("MMredirectURL",escape(o.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";o.addVariable("MMdoctitle",document.title)}}
if(o.skipDetect||o.getAttribute("doExpressInstall")||o.installedVer.versionIsValid(o.getAttribute("version"))){var l=(typeof i=="string")?document.getElementById(i):i;l.innerHTML=o.getSWFHTML();return true}else{if(o.getAttribute("redirectUrl")!=""){document.location.replace(o.getAttribute("redirectUrl"))}}
return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var i=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var l=navigator.plugins["Shockwave Flash"];if(l&&l.description){i=new deconcept.PlayerVersion(l.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var I=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}
catch(e){try{var I=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");i=new deconcept.PlayerVersion([6,0,21]);I.AllowScriptAccess="always"}
catch(e){if(i.major==6){return i}}try{I=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}
catch(e){}}if(I!=null){i=new deconcept.PlayerVersion(I.GetVariable("$version").split(" ")[1].split(","))}}
return i};deconcept.PlayerVersion=function(i){var I=this;I.major=i[0]!=null?parseInt(i[0]):0;I.minor=i[1]!=null?parseInt(i[1]):0;I.rev=i[2]!=null?parseInt(i[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(i){var I=this;if(I.major<i.major){return false}
if(I.major>i.major){return true}
if(I.minor<i.minor){return false}
if(I.minor>i.minor){return true}
if(I.rev<i.rev){return false}return true};deconcept.util={getRequestParameter:function(I){var o=document.location.search||document.location.hash;if(o){var i=o.substring(1).split("&");for(var l=0;l<i.length;l++){if(i[l].substring(0,i[l].indexOf("="))==I){return i[l].substring((i[l].indexOf("=")+1))}}}
return ""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return}
var i=document.getElementsByTagName("OBJECT");for(var I=0;I<i.length;I++){i[I].style.display="none";for(var l in i[I]){if(typeof i[I][l]=="function"){i[I][l]=function(){}}}}};deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload=="function"){var i=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();i()}}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs}};if(typeof window.onbeforeunload=="function"){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload()}}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload}
if(Array.prototype.push==null){Array.prototype.push=function(i){var I=this;I[I.length]=i;return I.length}}
var getQueryParamValue=deconcept.util.getRequestParameter,FlashObject=deconcept.SWFObject,SWFObject=deconcept.SWFObject;

function json2Obj(astr){
	var ljson;
	if(typeof astr == "object"){
		return astr;
	}
	astr = (astr != null) ? astr.split("\n").join("").split("\r").join("") : "";
	if (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(astr.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''))) {
		if (astr != "") {
			ljson = eval('(' + astr + ')');
			return ljson;
		}
	}
	return {};
}

//催促音乐人
function tellTask(obj,task,ID){
	var popAlertLogHTML= ['		<div class="setup_mod">',
					'			<div class="login_mid_prof">',
					'			抱歉，只有已登录用户才能进行此操作，请先<a href="http://signupv2.myspace.cn/modules/signup/pages/signupstep1.aspx">注册</a>或<a href="http://loginv2.myspace.cn/modules/cnlogin/pages/login.aspx">登录</a>。',
					'			</div>',
					'			<div class="setup_btn">',
					'			<input name="input2" type="button"  class="submit3"  value="" id="unLogTipsCloseBtn" />',
					'			</div>  ',
					'	</div>'].join("");
	
//未登录提示
	if(MO_MySpaceContext.UserId<0){
		var popIsExist = document.getElementById("unLogTips");
		if (popIsExist) {popIsExist.parentNode.removeChild(popIsExist);}
			
		popAlertLog = document.createElement("div");
		popAlertLog.id = "unLogTips";
		popAlertLog.className = "setup_mod_box login_setup";
		popAlertLog.innerHTML = popAlertLogHTML;
		document.getElementsByTagName("body")[0].appendChild(popAlertLog);
		MsPopload("unLogTips");
		MsClickUnPopload("unLogTipsCloseBtn","unLogTips");
		
		var unlogBtn = document.getElementById("unLogTipsCloseBtn");
		var unlogTips = document.getElementById("unLogTips");

		unlogBtn.onclick = function(){
			MsUnload("unLogTips");
			unlogTips.parentNode.removeChild(unlogTips);
		}
				
		return false;
	}
	
	if (obj.className.indexOf("nosubmit")>=0) {return false;}
	var tellURL = "http://ajaxv2.myspace.cn/_Common/AjaxService/BandProfileService.svc/json/InsertBandTaskUser";
	var data = {bandId:ID, taskType:task};
	
	var lxUrl=[];
	for(var x in data){					
		lxUrl.push(x);
		lxUrl.push("=");
		lxUrl.push(data[x]);
		lxUrl.push("&");
	}
	lxUrl.pop();
	
	var taskData={
			"url": tellURL,
			"contentType":"application/x-www-form-urlencoded",
			"method":"post",
			"data":data,
			"callback":callBack

	};
	loadAjax(taskData);
	
	function callBack(aoJson){
		var taskName = {"ShowTask":"巡演","IntroTask":"补充资料","MusicTask":"上传歌曲","MblogTask":"发微","AlbumTask":"上传照片","BlogTask":"发博客","VedioTask":"添加视频"};
		var popbackHTML= ['		<div class="setup_mod">',
						'			<div class="login_mid_prof">',
										JS_Context.fans_title.replace("的歌迷",""),
										taskName[task],
						'时MySpace将通知您',
						'			</div>',
						'			<div class="setup_btn">',
						'			<input name="input2" type="button"  class="submit3"  value="" id="popbacksucBtn" />',
						'			</div>  ',
						'	</div>'].join("");
		if (!document.getElementById("popbacksuc")) {
		popback = document.createElement("div");
		popback.id = "popbacksuc";
		popback.className = "setup_mod_box login_setup";
		document.getElementsByTagName("body")[0].appendChild(popback);
		}
		popback.innerHTML = popbackHTML;
				
		aoJson = json2Obj(aoJson);
		if(aoJson.Result == 0){
			obj.className += " nosubmit";
			MsPopload("popbacksuc");
			
			var closeBtn = document.getElementById("popbacksucBtn");
			//var divTips = document.getElementById("popbacksuc");
			function closeSucTips(){
				MsUnload("popbacksuc");
				//divTips.parentNode.removeChild(divTips);		
			}
			setTimeout(closeSucTips,5000)
			
			closeBtn.onclick = function(){
				closeSucTips()
			}
		}else{
			return false;
		}
	}
}