
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
var ClaimPodcast = {
	flag:false,
	shield:null,
	alertFram:null,
	opacity:0,
	interval:null,
	start:function(pid){
		shieldWidth  = (document.body.scrollWidth > document.body.clientWidth)?document.body.scrollWidth:document.body.clientWidth;
		shieldHeight = (document.body.scrollHeight > document.body.clientHeight)?document.body.scrollHeight:document.body.clientHeight;
		if (ClaimPodcast.flag)
		{
			strTxt=strTxt.toString().replace(/\\/gi,"\\\\");
			strTxt=strTxt.replace(/"/gi,"\\\"");
			strTxt=strTxt.replace(/'/gi,"\\\'");
			strTxt=strTxt.replace(/\n/,"\\n");
			setTimeout("ClaimPodcast.start(\""+strTxt+"\","+boolCustom+");",500);
			return;
		}
		else
		{
			ClaimPodcast.flag=true;
		}
		ClaimPodcast.shield = document.createElement("DIV");
		ClaimPodcast.shield.style.position = "absolute";
		ClaimPodcast.shield.style.left = "0px";
		ClaimPodcast.shield.style.top  = "0px";
		ClaimPodcast.shield.style.width  = shieldWidth+'px';
		ClaimPodcast.shield.style.height = shieldHeight+'px';
		ClaimPodcast.shield.style.textAlign = "center";
		ClaimPodcast.shield.style.zIndex = "1";
		ClaimPodcast.shield.style.filter = "alpha(opacity=0)";
		ClaimPodcast.shield.style.opacity=0;
		ClaimPodcast.alertFram = document.createElement("DIV");
		ClaimPodcast.alertFram.style.position = "absolute";
		ClaimPodcast.alertFram.style.left = "50%";
		ClaimPodcast.alertFram.style.top = "50%";
		ClaimPodcast.alertFram.style.padding = "0px";
		ClaimPodcast.alertFram.style.marginLeft = "-300px";
		ClaimPodcast.alertFram.style.marginTop = "-160px";
		ClaimPodcast.alertFram.style.width = "600px";
		ClaimPodcast.alertFram.style.height = "320px";
		ClaimPodcast.alertFram.style.textAlign = "center";
		ClaimPodcast.alertFram.style.backgroundColor = "#ffffff";
		ClaimPodcast.alertFram.style.zIndex = "2";
		
		ClaimPodcast.alertFram.innerHTML = get_claim_content_loading();
		set_claim_content();
		
		document.body.appendChild(ClaimPodcast.alertFram);
		document.body.appendChild(ClaimPodcast.shield);
		ClaimPodcast.opacity = 0;
		ClaimPodcast.interval = setInterval("ClaimPodcast.doAlpha()",20);
	},
	doAlpha:function(){
		if (!ClaimPodcast.flag)
		{
			return;
		}
		if(ClaimPodcast.opacity==0){
			//这样可以避免在点击后有瞬间的闪烁
			ClaimPodcast.shield.style.background = "#B7B7B7";
		}
		if (ClaimPodcast.opacity>30)
		{
			clearInterval(ClaimPodcast.interval);
			return;
		}
		ClaimPodcast.shield.style.filter = "alpha(opacity="+ClaimPodcast.opacity+");";
		ClaimPodcast.shield.style.opacity=ClaimPodcast.opacity/100;
		ClaimPodcast.opacity+=3;
	},
	doCancel:function(){
		if (!ClaimPodcast.flag)
		{
			return;
		}
		ClaimPodcast.alertFram.parentNode.removeChild(ClaimPodcast.alertFram);
		ClaimPodcast.shield.parentNode.removeChild(ClaimPodcast.shield);
		ClaimPodcast.alertFram=null;
		ClaimPodcast.shield=null;
		ClaimPodcast.opacity=0;
		ClaimPodcast.interval=null;
		ClaimPodcast.flag=false;
	}

}//end ClaimPodcast

function get_claim_content_loading(){
    var return_html = '<div class="directory-listing" id="share_box" style="height:320px;">'
                    + '    <div class="sct"><div class="scl">.</div></div>'
                    + '    <div id="share_content" >'
                    + '         <div id="share_content_loading"></div>'
                    + '    </div><!-- #share_content -->'
                    + '    <div class="scb"><div class="scl">.</div></div>'
                    + '</div>';
    return return_html;
}

function set_claim_content(){
    var params = '&action=claim_podcast';
    params += shar_param;
    var myAjax = new Ajax.Updater({success: 'share_content'},shar_url, {method: 'get', parameters: params, evalScripts: true});
}
