//
//#############################//
var userLogin={isCard:false,isFFbutton:false,isNull:function(obj)
{return(obj==""||obj==null||obj=="undefined");},loadJs:function(type,id)
{var Path="http://control.video.sina.com.cn/app/login/jsLogin.php?";if(type=='checkpass')
{var userid=document.getElementById('_userLogin_name').value;var pass=document.getElementById('_userLogin_pass').value;var code=document.getElementById('_userLogin_codenum').value;Path+='userid='+userid+'&password='+pass+'&code='+code+'&job=checkpass&id='+id;}
if(type=='checknum')
{Path+='job=checknum';}
if(type=='updatehead')
{Path="http://control.video.sina.com.cn/useradmin/header.php?q=1";}
Path+='&_='+Math.random();var head=document.getElementsByTagName("head")[0];var js=document.createElement("script");js.src=Path;js.onload=js.onreadystatechange=function()
{if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")
{head.removeChild(js);}}
head.appendChild(js);return true;},isLogin:function()
{return!this.isNull(new RegExp("(^|)SINAPRO=([^;]*)(;|$)","gi").exec(document.cookie));},toEvent:function(id,event)
{this.loginHide();var obj=document.getElementById(id);if(this.isNull(obj))
{var cardIframe=document.frames?top.document.frames['friendDialogIframe']:top.document.getElementById('friendDialogIframe').contentWindow;obj=cardIframe.document.getElementById(id);}
if(document.all)
{obj.click();}
else
{if(this.isNull(obj.getAttribute('isFriendDialog')))
{evt=document.createEvent("MouseEvents");evt.initMouseEvent('click',true,false,obj.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);obj.dispatchEvent(evt);}
else
{if(this.isCard)
{var cardIframe=top.document.getElementById('friendDialogIframe');var thisPos=this.getPos(cardIframe);}
else
{var thisPos=this.getPos(obj);}
var myEvent={target:obj,pageX:thisPos.left,pageY:thisPos.top,clientX:thisPos.left,clientY:thisPos.top};commonDialog.openWin(obj,myEvent);}}
return true;},showBg:function(type)
{var Div=document.getElementById('_userLoginBgDiv');if(type=='show')
{if(this.isNull(Div))
{var Div=document.createElement("div");var Body=document.getElementsByTagName("body")[0];Div.id="_userLoginBgDiv";Div.style.cssText="position:absolute;display:block;top:0px;left:0px;height:"+document.body.scrollHeight+"px;width:"+document.body.scrollWidth+"px;opacity:0.2;filter:alpha(opacity=20);background:#000;z-index:90009;";Body.appendChild(Div);}
else
{Div.style.display='block';}
Div.onclick=function(){userLogin.loginHide()}}
else
{try{Div.style.display='none'}catch(e){};}
return true;},showLogin:function(type,id,event)
{var obj=document.getElementById('_userLoginDiv');var html='<style>'
+'.quicklogin{ width:260px; }'
+'.quicklogin .frm{ padding:2px 2px 1px; color:#515151;}'
+'.quicklogin .tit .fleft{ padding-left:10px; color:#525252}'
+'.quicklogin .erro { color:#CC0000; display:block; line-height:20px; height:25px; text-align:center}'
+'.quicklogin dl{ margin:0px auto; width:180px; padding:0px;}'
+'.quicklogin dt,'
+'.quicklogin dd{ margin:0px; padding:0px; height:25px; text-align:left}'
+'.quicklogin dt { width:50px; overflow:hidden; line-height:22px; text-align:right;float:left; color:#333;  }'
+'.quicklogin dd { width:120px; display:block;float:left;}'
+'.quicklogin .bom{  height:30px; padding-left:40px; overflow:hidden;}'
+'.quicklogin .bom a{  display:block; float:left}'
+'.quicklogin .bom span{ float:left;margin:0px 30px;}'
+'</style>'
+'<div class="quicklogin">'
+'<div class="b_layer">'
+'<div class="tit">'
+'<div class="fleft">请登录</div>'
+'<div class="fright"><a href="###" onmousedown="userLogin.loginHide()" title="关闭"></a></div>'
+'</div>'
+'<div class="info">'
+'<span id="_userLogin_info" class="erro" style="display:none"></span>'
+'<dl>'
+'<dt>登录名：</dt><dd><input id="_userLogin_name" maxlength="20" type="text" class="frm" style="width:113px;" onkeydown="if(event.keyCode==13) userLogin.loadJs(\'checkpass\',\''+id+'\')" ></dd>'
+'<dt>密&nbsp;&nbsp;码：</dt><dd><input id="_userLogin_pass" maxlength="20" type="password" class="frm" style="width:113px;" onkeydown="if(event.keyCode==13) userLogin.loadJs(\'checkpass\',\''+id+'\')" >'
+'</dd>'
+'<dt id="_userLogin_codedt" style="display:none">验证码：</dt><dd id="_userLogin_codedd" style="display:none"><input  id="_userLogin_codenum" maxlength="4" type="text" class="frm" style="width:57px;" onkeydown="if(event.keyCode==13) userLogin.loadJs(\'checkpass\',\''+id+'\')"> <img id="_userLogin_codeimg"  src=""  height="20" border="0" align="absmiddle"></dd>'
+'<dt>&nbsp;</dt><dd><input type="image" src="http://image2.sina.com.cn/vblog/images/v_index_login/vlog_btn_ok.gif" onclick="userLogin.loadJs(\'checkpass\',\''+id+'\')"/></dd>'
+'</dl>'
+'<div class="clearboth"><div>'
+'</div>'
+'<div class="bom blue_line">'
+'<a href="http://unipro.sina.com.cn/getpass.html" onclick="userLogin.loginHide();return true;" target="_blank">忘记密码</a><span>|</span><a href="http://control.video.sina.com.cn/app/register/" onclick="userLogin.loginHide();return true;" target="_blank">尚未注册</a>'
+'</div>'
+'</div>'
+'<div class="clearboth"></div>'
+'</div>';if(type=='show')
{var thisHeight=158;var thisWidth=260;if(!this.isCard)
{var thisId=document.getElementById(id);var thisPos=this.getPos(thisId);var thisTop=Math.floor(thisPos.top-(thisHeight-thisId.offsetHeight)/2);var thisLeft=Math.floor(thisPos.left-(thisWidth-thisId.offsetWidth)/2);var cutWidth=document.body.scrollWidth-(thisLeft+thisWidth);}
else
{var cardIframe=top.document.getElementById('friendDialogIframe');var thisPos=this.getPos(cardIframe);var thisTop=thisPos.top+2;var thisLeft=thisPos.left+2;var cutWidth=document.body.scrollWidth-(thisLeft+thisWidth);}
thisTop=thisTop<=0?1:thisTop;thisLeft=cutWidth>=0?thisLeft:thisLeft+cutWidth-5;thisLeft=thisLeft<=0?1:thisLeft;var css="position:absolute;display:block;top:"+thisTop+"px;left:"+thisLeft+"px;height:auto;width:"+thisWidth+"px;z-index:90010;";if(this.isNull(obj))
{var Div=document.createElement("div");var Body=document.getElementsByTagName("body")[0];Div.id="_userLoginDiv";Div.style.cssText=css
Body.appendChild(Div);Div.innerHTML=html;this.loadJs('checknum');}
else
{obj.style.cssText=css;obj.innerHTML=html;this.loadJs('checknum');}
document.getElementById('_userLogin_name').focus();}
else
{try{obj.style.display='none'}catch(e){};}},loginHide:function()
{this.showBg('hide');this.showLogin('hide');},getPos:function(obj)
{var x=y=w=h=0;if(obj.getBoundingClientRect)
{var box=obj.getBoundingClientRect();y=box.top+Math.max(document.documentElement.scrollTop,document.body.scrollTop)-2;x=box.left+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft)-2;w=h=2;}
else
{for(;obj!=document.body;x+=obj.offsetLeft,y+=obj.offsetTop,obj=obj.offsetParent);w=h=2;if(this.isFFbutton)
{y-=12;h=12;}}
return{'left':x,'top':y,'w':w,'h':h};},showClickDiv:function(id,useLink)
{obj=document.getElementById(id);var isCursor="cursor:pointer";var Div=document.getElementById('_userLoginClickDiv');var pos=this.getPos(obj);if(this.isNull(Div))
{var Div=document.createElement("div");var Body=document.getElementsByTagName("body")[0];Div.id="_userLoginClickDiv";Div.style.cssText="position:absolute;display:block;"+isCursor+";top:"+pos.top+"px;left:"+pos.left+"px;height:"+(obj.offsetHeight+pos.h)+"px;width:"+(obj.offsetWidth+pos.w)+"px;background:#eee;z-index:90011;opacity:0.1;filter:alpha(opacity=10);";Body.appendChild(Div);}
else
{Div.style.cssText="position:absolute;display:block;"+isCursor+";top:"+pos.top+"px;left:"+pos.left+"px;height:"+(obj.offsetHeight+pos.h)+"px;width:"+(obj.offsetWidth+pos.w)+"px;background:#eee;z-index:90011;opacity:0.1;filter:alpha(opacity=10);";}
Div.onmouseout=function(){if(useLink)obj.style.color="#001A9F";this.style.display='none'}
Div.onclick=function(){this.style.display='none'
userLogin.showBg('show');userLogin.showLogin('show',id);}},checkLogin:function(id,notLink,FF)
{var useLink=(typeof notLink=="undefined");this.isFFbutton=!(typeof FF=="undefined");if(id=="card_showInvite"||id=="card_sendMsg")
{this.isCard=true;userLogin.showBg('show');userLogin.showLogin('show',id);return false;}
else
{this.isCard=false;if(this.isLogin())
{return true;}
else
{if(useLink)document.getElementById(id).style.color="#BD0302";this.showClickDiv(id,useLink);return false;}}}}//
//#############################//
var baseObject={htmlSpans:[],htmlLinks:[],htmlImages:[],htmlInput:[],isRequestIng:false,initBase:function(){var jsObj=this.$("loadJs");if(this.isNull(jsObj)){document.write('<script type="text/javascript" id="loadJs"></script>');}var iframeObj=this.$("loadIframe");if(this.isNull(iframeObj)){var strDisplay="";if(navigator.userAgent.toLowerCase().indexOf('msie')>=0){strDisplay="none";}var dialogStr='';dialogStr+='<div  style="display:'+strDisplay+'; height:0px;width:0px">';dialogStr+='<iframe name="loadIframe" id="loadIframe" height="0" width="0" style="display:'+strDisplay+'; width:0px; height:0px" ></iframe>';dialogStr+='<div id="loadDivForPost" style="display:none;"></div>';dialogStr+='</div>';if(typeof(hasInitPostIframe)=='undefined'){hasInitPostIframe=true;document.write(dialogStr);}}},_submitByPost:function(targetAddr){this.$('loadDivForPost').innerHTML="";var arrUrl=targetAddr.split(/\?/gi);var strAction=arrUrl[0];var strFormElement="";if(arrUrl.length>1&&!this.isNull(arrUrl[1])){var params=arrUrl[1];var arrparam=params.split(/&/gi);for(var i=0;i<arrparam.length;i++){var arrElement=arrparam[i].split(/=/gi);if(typeof(arrElement[1])=='undefined'||this.isNull(arrElement[1])){arrElement[1]="";}strFormElement+='<input type="hidden" name="'+arrElement[0]+'"  value="'+arrElement[1]+'" />';}}var regObj=new RegExp('\/\/[^\/]*\/','ig');var localDomain=document.location.href.match(regObj);localDomain=this.isNull(localDomain)?["you.video.sina.com.cn"]:localDomain;var regObj=new RegExp('\/','ig');localDomain=localDomain[0].replace(regObj,'');var strForm='<form  target="loadIframe" action="'+strAction+"?localDomain="+encodeURIComponent(localDomain)+"&golbalId="+this.getGlobalId()+'" name="loadForm" id="loadForm" method="post">';strForm+=strFormElement;strForm+='</form>';this.$('loadDivForPost').innerHTML=strForm;var objForm=this.$('loadForm');if(!this.isNull(objForm)){objForm.submit();}},requestJs:function(targetAddr,varName,callBack,timeout,timeoutCallBack,method){var me=this;method=this.isNull(method)?"get":method;method=method.toLowerCase();if(true==baseObject.isRequestIng){setTimeout(function(){me.requestJs(targetAddr,varName,callBack,timeout,timeoutCallBack,method);},100);}else{baseObject.isRequestIng=true;setTimeout(function(){baseObject.isRequestIng=false;},timeoutCallBack);if('get'==method){eval(varName+"=null;");this.loadJs(targetAddr,"loadJs");}else{this._submitByPost(targetAddr);}if(!this.isNull(callBack)){this.readJsData(varName,callBack,timeout,timeoutCallBack,method);}}},readJsData:function(varName,callBack,timeout,timeoutCallBack,method){timeout=this.isNull(timeout)?"30000":timeout;if(timeout<=0){baseObject.isRequestIng=false;if(!this.isNull(timeoutCallBack)){timeoutCallBack();}else{alert('数据超时了，请稍后在试')};}else{var requestJsData=null;if('get'==method){eval("requestJsData="+varName+";");}else{try{var dataIframe=document.frames?document.frames['loadIframe']:document.getElementById('loadIframe').contentWindow;var regObj=new RegExp('\/\/[^\/]*\/','ig');var IframeUrl=dataIframe.document.location.href.match(regObj);IframeUrl=this.isNull(IframeUrl)?[""]:IframeUrl;var regObj=new RegExp('\/','ig');IframeUrl=IframeUrl[0].replace(regObj,'');var regObj=new RegExp('\/\/[^\/]*\/','ig');var localUrl=document.location.href.match(regObj);localUrl=this.isNull(localUrl)?[""]:localUrl;var regObj=new RegExp('\/','ig');localUrl=localUrl[0].replace(regObj,'');if(localUrl==IframeUrl){eval("requestJsData=dataIframe."+varName+";");}}catch(e){}}if(this.isNull(requestJsData)){var me=this;setTimeout(function(){me.readJsData(varName,callBack,timeout-100,timeoutCallBack,method);},100);}else{callBack(requestJsData);baseObject.isRequestIng=false;return void(0);}}},splitHtmlCssScript:function(htmlStr){var regCss=/(?:<style.*?>)((\n|\r|.)*?)(?:<\/style>)|(<link[^<>]*>[^<>]*<\/link>)|(<link[^<>]*>)/img;var regScript=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/img;var strJs=htmlStr.match(regScript);var strCss=htmlStr.match(regCss);var strHtml=htmlStr.replace(regScript,'').replace(regCss,'');return{html:strHtml,css:strCss,js:strJs};},getUserInfo:function(){var userInfo={};var viewUid=this.getCookie('VBLOG_USERID');viewUid=(typeof(viewUid)=='undefined'||this.isNull(viewUid))?"":viewUid;var userCookie=this.getCookie('VBLOG_JS_USER');userCookie=this.isNull(userCookie)?"":userCookie;var arrUserNick=userCookie.split("|");var userNick="新浪网友";var signName="";if(!this.isNull(arrUserNick)&&!this.isNull(viewUid)){if(typeof(arrUserNick[1])!="undefined"){userNick=arrUserNick[1];userNick=userNick.replace(/%2B/g,"|");userNick=decodeURIComponent(userNick).replace(/\+/img," ").replace(/\|/g,"+");}if(typeof(arrUserNick[2])!="undefined"){signName=arrUserNick[2];signName=signName.replace(/%2B/g,"|");signName=decodeURIComponent(arrUserNick[2]).replace(/\+/img," ").replace(/\|/g,"+");}}userInfo['uid']=viewUid;userInfo['nick']=userNick;userInfo['signName']=signName;return userInfo;},getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));},getStrTagName:function(str){str=""+str;var tagName=str.match(/(<[^<\/>]*)|(<[^<\/>]*\/>)|(<[^<\/>]*>)/img);tagName=""+tagName;tagName=tagName.replace(/[<\/>]*/img,"");return tagName;},getStrDomAttribute:function(str){var regObj=new RegExp(' ','img');str=""+(""+str).replace(regObj,"  ");var arrObj={};try{var arrMachAttr=""+str;var eregStript=/(<[^<>]+\/>)|<[^<\/>]+>/ig;arrMachAttr=str.match(eregStript)[0].replace(/\/>/img," >");arrMachAttr=arrMachAttr.replace(/(<[^\/]*>)|(<[^>]*\/)|(<[^\/>]*)/ig,"").replace(/(>)|(\/>)/ig,"").replace(/*=*/ig,"=");var eregi=/[^<\/>]*=[^<>]*/img;arrMachAttr=arrMachAttr.match(eregi);if(!this.isNull(arrMachAttr)){for(var i=0;i<arrMachAttr.length;i++){var keyValueArr=(""+arrMachAttr[i]).split(/=/img);if(!this.isNull(keyValueArr[0])){arrObj[keyValueArr[0]]=keyValueArr[1];}}}}catch(e){arrObj={};}return arrObj;},stripTags:function(str){var returnStr=str.replace(/<\/?[^>]+>/gi,'');if(this.isNull(returnStr)){returnStr="";}return returnStr;},strToElement:function(str,objWin){str=""+str;if(this.isNull(objWin)){objWin=window;}var tagName=""+this.getStrTagName(str);var attrObj=this.getStrDomAttribute(str);var objEle=objWin.document?objWin.document.createElement(tagName):document.createElement(tagName);var strInnerHtml=this.stripTags(str);objEle.nodeValue=strInnerHtml;for(var indexName in attrObj){try{var key=indexName;var val=attrObj[indexName];if(!this.isNull(key)&&!this.isNull(val)){objEle.setAttribute(key,val);}}catch(e){}}return objEle;},appendHeadStr:function(str,objWin){if(this.isNull(objWin)){objWin=window;}try{var objEle=this.strToElement(str,objWin);this.appendHeaderElement(objEle,objWin);}catch(e){}},appendHeaderElement:function(objEle,objWin){if(this.isNull(objWin)){objWin=window;}try{objWin.document.getElementsByTagName("head")[0].appendChild(objEle);}catch(e){try{var firstNode=objWin.document.getElementsByTagName("body")[0].childNodes[0];firstNode.parentNode.insertBefore(objEle,firstNode);}catch(e){}}},appendScriptChild:function(_ID,_SRC){try{var objScript=document.getElementById(_ID);if(!this.isNull(objScript)){if(!this.isNull(_SRC)){objScript.src=_SRC;}}else{var s=document.createElement("SCRIPT");s.type="text/javascript";if(!this.isNull(_ID)){s.id=_ID;}if(!this.isNull(_SRC)){s.src=_SRC;}this.appendHeaderElement(s);s=null;}}catch(e){var srcAddr=this.isNull(_SRC)?"":'src="'+_SRC+'"';var idAttr=this.isNull(_ID)?"":'id="'+_ID+'"';document.write('<script type="text/javascript" '+idAttr+' '+srcAddr+'></script>');}},loadJs:function(jsUrl,_ID){_ID=this.isNull(_ID)?"loadJs":_ID;if(navigator.userAgent.toLowerCase().indexOf('msie')>=0){var jsObj=this.$(_ID);if(this.isNull(jsObj)){this.appendScriptChild(_ID,jsUrl);}else{jsObj.src=jsUrl;}}else{var js=document.createElement("script");js.setAttribute("type","text/javascript");js.setAttribute("src",jsUrl);document.body.insertBefore(js,null);}},getHtml:function(htmlObj){if(this.isNull(htmlObj)){htmlObj=document;}this.htmlSpans=htmlObj.getElementsByTagName("SPAN");this.htmlLinks=htmlObj.getElementsByTagName("A");this.htmlImages=htmlObj.getElementsByTagName("IMG");this.htmlInput=htmlObj.getElementsByTagName("INPUT");},getDim:function(htmlObj){var rd={x:0,y:0};do{rd.x+=htmlObj.offsetLeft;rd.y+=htmlObj.offsetTop;htmlObj=htmlObj.offsetParent;}while(htmlObj)return rd;},getPageSize:function(objWin){var xScroll,yScroll;objWin=this.isNull(objWin)?window:objWin;if(document.body&&document.body.scrollHeight>document.body.offsetHeight){xScroll=objWin.document.body.scrollWidth;yScroll=objWin.document.body.scrollHeight;}else if(document.documentElement){xScroll=objWin.document.documentElement.scrollWidth;yScroll=objWin.document.documentElement.scrollHeight;}var windowWidth,windowHeight;if(self.innerHeight){windowWidth=objWin.innerWidth;windowHeight=objWin.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=objWin.document.documentElement.clientWidth;windowHeight=objWin.document.documentElement.clientHeight;}else if(document.body){windowWidth=objWin.document.body.clientWidth;windowHeight=objWin.document.body.clientHeight;}if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}arrayPageSize={pw:pageWidth,ph:pageHeight,ww:windowWidth,wh:windowHeight,sw:xScroll,sh:yScroll};return arrayPageSize;},filterPage:function(page,totalpage){try{page=parseInt(page);}catch(e){page=1;}if(isNaN(page)||page<=0){page=1;}if(page>totalpage&&totalpage>0){page=totalpage;}return page;},isNull:function(object){return(object==""||object==null||object=="undefined");},addEvent:function(obj,EventName,callBack){obj["on"+EventName]=callBack;},pxParseInt:function(strPx){return parseInt((""+strPx).toLowerCase().replace(/px/g,""))},pointerX:function(event){try{return event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));}catch(e){return 0;}},pointerY:function(event){try{return event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));}catch(e){return 0;}},$:function(idname){if(document.getElementById){return document.getElementById(idname);}else if(document.all){return document.all[idname];}else if(document.layers){return document.layers[idname];}else{return null;}},getUnicodeLen:function(sChars){return sChars.replace(/[^\x00-\xff]/g,"xx").length;},cutUnicodeStr:function(sSource,iLen,ELIDED){if(this.getUnicodeLen(sSource)<=iLen){return sSource;}if(typeof(ELIDED)=='undefined'||ELIDED==null){ELIDED="..."}var str="";var l=0;var schar;for(var i=0;schar=sSource.charAt(i);i++){var charLen=(schar.match(/[^\x00-\xff]/)!=null?2:1);if(l>iLen-ELIDED.length-charLen){break;}else{str+=schar;l+=charLen;}}str+=ELIDED;return str;},_splitByTwoPart:function(srcstr,iLen){arrReturn={};sStr="";eStr="";if(this.getUnicodeLen(srcstr)<=iLen){sStr=srcstr;}else{var l=0;var schar;for(var i=0;i<srcstr.length;i++){schar=srcstr.charAt(i);var charLen=(schar.match(/[^\x00-\xff]/)!=null?2:1);if(l>iLen-charLen){eStr+=schar;}else{sStr+=schar;}l+=charLen;}}arrReturn['s']=sStr;arrReturn['e']=eStr;return arrReturn;},splitByLength:function(fullStr,splitLength,splicChar,userBr){fullStr=""+fullStr;splitLength=parseInt(splitLength);if(0==splitLength){splitLength=this.getUnicodeLen(fullStr)}var eachRow=[];var strReturn="";if(this.isNull(splicChar)){splicChar='<br />';}if(this.isNull(userBr)){userBr=true;}if(userBr){eachRow=fullStr.split(/<br[^<>]*>/img);}else{eachRow[0]=fullStr;}for(var i=0;i<eachRow.length;i++){if(this.isNull(eachRow[i])){eachRow[i]="";}var tmpStr=eachRow[i];while(!this.isNull(tmpStr)){arrTem={};arrTem=this._splitByTwoPart(tmpStr,splitLength);strReturn+=arrTem['s']+splicChar;tmpStr=arrTem['e'];}}test=strReturn=""+strReturn;strReturn=strReturn.replace(/(<br[^<>]*>[\r\n\t]*)$/ig,"");return strReturn;},getDomAttribute:function(clickObj){var objAttr={};if(clickObj.attributes&&clickObj.attributes.length){retval={};for(var i=0;i<clickObj.attributes.length;i++){var key=clickObj.attributes[i].nodeName;if(typeof(key)=="undefined")continue;var val=clickObj.attributes[i].nodeValue;if(!val)continue;key=key.toLowerCase();objAttr[key]=val;}}return objAttr;},getGlobalId:function(){var today,hour,second,minute,year,month,date;var strDate;today=new Date();year=today.getYear();month=today.getMonth()+1;date=today.getDate();hour=today.getHours();minute=today.getMinutes();second=today.getSeconds();strDate=""+year+month+date+hour+minute+second+parseInt(Math.random()*100);return strDate;},getCheckNumUrl:function(){var checkNumUrl="http://control.video.sina.com.cn/app/checknum/chknum.php?id="+this.getGlobalId();return checkNumUrl;},urlEndode:function(str){str=encodeURIComponent(str);return str;},$A:function(obj,attr){return obj.getAttribute(attr);},isLogin:function(type){var userinfo=this.getUserInfo();if(userinfo['uid']){return true;}return false;}};var hasInitBaseObject=true;baseObject.initBase();//
//#############################//

var Q="http://counter.sina.com.cn/querylist?format=js&entry=g_clist&id=0&key=";document.writeln('<scr'+'ipt id="COUNTER_FORIE" type="text/javascript"></scr'+'ipt>');var count_text="";var vids=[];var keys="";var obj_show;var commCountList={getCommSpans:function(){var objSpans=obj_show.getElementsByTagName('SPAN');var commSpans=[];var k=0;for(j=0;j<objSpans.length;j++){if("cmnt_count"==objSpans[j].getAttribute('name')){commSpans[k]=objSpans[j];k++;}}return commSpans;},filterData:function(arrData){var commSpans=this.getCommSpans();for(var i=0;i<arrData.length;i++){vid=arrData[i][0].split(':');var strCmnt_id="vblog:"+vid[1]+":0";for(j=0;j<commSpans.length;j++){if(strCmnt_id==commSpans[j].getAttribute('cmnt_id')){commSpans[j].style.display="";commSpans[j].innerHTML=arrData[i][1];}}}},clearDefault:function(){var commSpans=this.getCommSpans();for(j=0;j<commSpans.length;j++){var commSpansInnerHtml=commSpans[j].innerHTML.toLowerCase();if(commSpansInnerHtml.indexOf('_count_')>0){commSpans[j].style.display="";commSpans[j].innerHTML="0";}}},showCommCount:function(obj){count_text=obj.innerHTML;obj_show=obj;key_pattern=/vblog:([0-9]+):0/g;vids=count_text.match(key_pattern);if(vids!='undefined'&&vids!=null&&vids!=""&&vids.length>0){keys=vids.join(',');if(navigator.userAgent.toLowerCase().indexOf('msie')>=0){document.getElementById("COUNTER_FORIE").src=Q+keys;}else{var js=document.createElement("script");js.setAttribute("type","text/javascript");js.setAttribute("src",Q+keys);document.body.insertBefore(js,null);}}}};function counter_callback(){if(!document.getElementsByTagName){return false};commCountList.filterData(g_clist);commCountList.clearDefault();}function show_comment_count(data,obj){commCountList.showCommCount(obj);}
//
//#############################//
var base	= {
	tmp:		{},
	swfTmp:		null,
	$:			function(_sID){
		return document.getElementById(_sID);
	},
	$$:			function(_sID){
		return document.frames ? document.frames[_sID] : this.$(_sID).contentWindow;
	},
	$F:			function(_sID){
		return navigator.appName.indexOf("Microsoft") != -1 ? window[_sID] : document[_sID];
	},
	hide:		function(_sID){
		if(this.$(_sID).style.display == 'none')
			this.$(_sID).style.display	= '';
		else
			this.$(_sID).style.display	= 'none';
	},
	select:		function(_oThis, _sTag, _oArea, _vChange){
		var sFlg	= true;
		var aObject	= document.getElementsByTagName(_sTag);
		for(var i = 0; i < aObject.length; i++){
			for(attribute in _oArea){
				if(aObject[i].getAttribute(attribute) == _oArea[attribute])
					sFlg	= false;
			}
			if(sFlg	== false)
				for(k in _vChange)
					aObject[i].checked	= _oThis.checked;

			sFlg	= true;
		}
	},
	getValue:	function(_oThis, _sTag, _oArea){
		var aValue	= [];
		var sFlg	= true;
		var aObject	= documen
			t.getElementsByTagName(_sTag);
		for(var i = 0; i < aObject.length; i++){
			for(attribute in _oArea){
				if(aObject[i].getAttribute(attribute).toString() == _oArea[attribute].toString())
					sFlg	= false;
			}

			if(sFlg	== false)
				aValue[aValue.length]	= aObject[i].value;
					
			sFlg	= true;
		}
		return aValue.toString();
	},
	pointer:			function(_target) {
		var windowWidth, windowHeight;
		if(_target)
			target = _target.document;
		else
			target = document;

		if (self.innerHeight){
			if(_target)
				target = _target.self;
			else
				target = self;
			windowWidth		= target.innerWidth;
			windowHeight	= target.innerHeight;
		} else if (target.documentElement && target.documentElement.clientHeight) {
			windowWidth		= target.documentElement.clientWidth;
			windowHeight	= target.documentElement.clientHeight;
		} else if (target.body) {
			windowWidth		= target.body.clientWidth;
			windowHeight	= target.body.clientHeight;
		}
		return {width:parseInt(windowWidth),height:parseInt(windowHeight)};
	},
	swfSize:	function(_fID, _sMode, _iWidth, _iHeight){

		var fPlayer	= this.$F(_fID);

		var XY		= this.pointer();

		var parentObject	= fPlayer.parentNode;
		while(parentObject.tagName.toUpperCase() != "DIV"){
			parentObject	= parentObject.parentNode;
		}

		if(!fPlayer.getAttribute('initWidth')){
			fPlayer.setAttribute('initWidth',	fPlayer.getAttribute('width'));
			fPlayer.setAttribute('initHeight',	fPlayer.getAttribute('height'));
		}

		if(_sMode == 'full'){
			parentObject.style.position		= 'absolute';
			parentObject.style.overflow		= 'hidden';
			parentObject.style.zIndex		= '999999999';
			parentObject.style.top			= 0;
			parentObject.style.left			= 0;
			parentObject.style.width		= XY.width.toString() + 'px';
			parentObject.style.height		= XY.height.toString() + 'px';
			this.$F(_fID)['width']			= '100%';
			this.$F(_fID)['height']			= '100%';
		}else if(_sMode == 'zoom'){
			parentObject.style.position		= 'absolute';
			parentObject.style.overflow		= 'hidden';
			parentObject.style.width		= _iWidth;
			parentObject.style.height		= _iHeight;
			fPlayer['width']				= parentObject.style.width;
			fPlayer['height']				= parentObject.style.height;
		}else if(_sMode == 'init'){

			parentObject.style.position		= '';
			parentObject.style.position		= 'static';
			parentObject.style.overflow		= '';

			parentObject.style.width		= this.$F(_fID).getAttribute('initWidth') + 'px';
			parentObject.style.height		= this.$F(_fID).getAttribute('initHeight') + 'px';
			this.$F(_fID)['width']			= this.$F(_fID).getAttribute('initWidth');
			this.$F(_fID)['height']			= this.$F(_fID).getAttribute('initHeight');
		}
	}
}

function browserDetect(){
	var sUA = navigator.userAgent.toLowerCase();
	var sIE = sUA.indexOf("msie");
	var sOpera = sUA.indexOf("opera");
	var sMoz = sUA.indexOf("gecko");
	if (sOpera != -1) return "opera";
	if (sIE != -1){
		nIeVer = parseFloat(sUA.substr(sIE + 5));
		if (nIeVer >= 6) return "ie6";
		else if (nIeVer >= 5.5) return "ie55";
		else if (nIeVer >= 5 ) return "ie5";
	}
	if (sMoz != -1)	return "moz";
	return "other";
}
BROWSER	= browserDetect();
var MOZ	= true;
function fullscreen(_iMode){
	
	if(_iMode == 1){
		base.swfSize('mymovie', 'full');
	}else{
		base.swfSize('mymovie', 'init');
	}

}
//
//#############################//
// 功能栏处理
function switchShow(_oThis, _sShow){
	// 切换显示
	Element.toggle(_sShow);
	// 切换样式表
	_oThis.className	= _oThis.className == 'right1' ? 'right' : 'right1' ;
}
// 分栏处理
function switchTab(sTab1, sTab2, sShow1, sShow2){
	var Text1	= $(sTab1).innerText ? $(sTab1).innerText : $(sTab1).textContent;
	var Text2	= $(sTab2).innerText ? $(sTab2).innerText : $(sTab2).textContent;
	$(sTab1).innerHTML	= '<h2>' + Text1 + '</h2>';
	$(sTab2).innerHTML	= '<a href="javascript:;">' + Text2 + '</a>';
	Element.show(sShow1);
	Element.hide(sShow2);
}//
//#############################//
/**
* Copyright (C), 2007, Sina
* 
* 最终播放页JS处理
* 
* 历  史:
* <作者>          <时间>          <版本>       <说明>
* yannian       2007-03-16       1.0        创建模块
* 
* $Id$
*/
 

function $(_sID)
{
	return document.getElementById(_sID);
}

function $$(_sID)
{
	return document.frames ? document.frames[_sID] : $(_sID).contentWindow;
}

function $$$(objId)
{
	return vDialog.getObj().document.getElementById(objId);
}

//---控制弹出的IFRAME层的定时隐藏
function htmlCheck(obj)
{
	if(obj.value == "和大家一起写下您对该视频的评论吧！"){
		obj.innerHTML = "";}
}

var ObjTimeOut="";
function hideIframe()
{
	pauseHideIframe();
	ObjTimeOut=setTimeout(_hideIframe,2000);
}
function _hideIframe()
{
	//vDialog.reset();
}
function pauseHideIframe()
{
	if(""!=ObjTimeOut)
	{
		clearTimeout(ObjTimeOut);
	}
	ObjTimeOut="";
}

function setIframeSize(ifWidth,ifHeight)
{
	vDialog.setSize(ifWidth,ifHeight);
}

function getConfrmStr(strMsg)
{
	var confirmDialog="";
	confirmDialog+="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
	confirmDialog+="<html xmlns=\"http://www.w3.org/1999/xhtml\">";
	confirmDialog+="<head>";
	confirmDialog+="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />";
	confirmDialog+="<link rel=\"stylesheet\" type=\"text/css\" href=\"http://image2.sina.com.cn/vblog/css/front/general.css\" />";
	confirmDialog+="<title>播客提示</title>";
	confirmDialog+="</head>";
	confirmDialog+="<body>";
	confirmDialog+="<!-- 温馨提示 -->";
	confirmDialog+="<div class=\"nts_layer\">";
	confirmDialog+="<div class=\"b_layer\">";
	confirmDialog+="<div class=\"tit\">";
	confirmDialog+="<div class=\"fleft\">温馨提示</div>";
	confirmDialog+="<div class=\"fright\"><a href=\"#\" onclick=\"top.friendDialog.reset();return false\"></a></div>";
	confirmDialog+="</div>";
	confirmDialog+="<div class=\"info\">";
	confirmDialog+=""+strMsg+"<br /><br />";
	confirmDialog+="<input type=\"image\" onclick=\"top.friendDialog.reset();return false\" src=\"http://image2.sina.com.cn/vblog/images/front/layer_btn1.jpg\" />&nbsp;&nbsp;&nbsp;";
	confirmDialog+="</div>";
	confirmDialog+="</div>";
	confirmDialog+="<div class=\"clearboth\"></div>";
	confirmDialog+="</div>";
	confirmDialog+="</body>";
	confirmDialog+="</html>";
	
	return confirmDialog;
}


function getTellHTML(e,videoid,userid,videoTitle){
var url='http://you.video.sina.com.cn/pg/play/showTell.html?uid='+userid+'&vid='+videoid+'&videotitle='+escape(videoTitle);
friendDialog.card(e, 'tellvideo' , url, 340, 400, e.offsetHeight-150, e.offsetWidth/2-170);
}
/***
*该用户其他视频
*/
function displayUserOtherVideo(uid,vid)
{
	var url = 'http://you.video.sina.com.cn/pg/play/userOtherVideo.php';
	var pars = 'uid='+uid+'&vid='+vid;

	var da = new Ajax.Request(url,{method: 'get',
						parameters: pars,
						onComplete: showUserOtherVideoResponse
					});
}

function showUserOtherVideoResponse(originalRequest)
{
	eval('result='+originalRequest.responseText);
	if(result)
	{
        var _count=result.length;
        var uid= location.href.substring(location.href.indexOf('-') + 1,location.href.indexOf('.html'));
		var rs="";	
		for(var i=0;i<_count;i++){
			rs+='<dl><dt class="dt1"><a href="/b/'+result[i]['vid']+'-'+result[i]['uid']+'.html"><img src="'+result[i]['map']+'" class="img1" width="80" height="60"/></a></dt><dt class="dt2"><a href="javascript:;" name="playlist" vid="'+result[i]['vid']+'" uid="'+result[i]['uid']+'" author="'+result[i]['uid']+'" title="'+result[i]['name']+'" pic="'+result[i]['map']+'" ><img src="http://image2.sina.com.cn/vblog/images/front/icon_add.gif" onmouseover="playlist.PLShow(this,\'playlist\',true)" onmouseout="playlist.PLShow(this,\'playlist\',false)" onclick="playlist.eventClick(this)" id="playlist'+result[i]['vid']+'"/></a></dt><dd class="blue_line"><a href="/b/'+result[i]['vid']+'-'+result[i]['uid']+'.html" title="'+result[i]['name']+'">'+result[i]['name']+'</a></dd><dd>播放：<span showVCount="V'+result[i]['vid']+'-'+result[i]['vid']+'">0</span></dd><dd>评论：<span name="cmnt_count" cmnt_id="vblog:'+result[i]['vid']+':0"  style="display:none">(_COUNT_)</span></dd></dl>';
		}
	   	var obj = $("userOtherVideoList");
        obj.innerHTML =rs;
        
        var refreshCount=function (){
        	if(typeof(show_comment_count)!="undefined"&&typeof(getVCount)!="undefined"){
        		show_comment_count(obj.innerHTML,obj);
        		getVCount.getCount();
        		 try{playlist.selectPicture({'tag':'a', 'name':'playlist' },obj);}catch(e){}
        	}else{
        		setTimeout(function(){refreshCount();},100);
        	}
        };refreshCount();
		var moreHTML='<div class="fleft">1-'+_count+'个视频</div>';
		if(_count>15){moreHTML+='<div class="fright"><a href="/m/'+uid+'#video"><span style="text-decoration:underline">更多</span> &gt;&gt;</a></div>';}
		$('userOtherVideoMore').innerHTML=moreHTML;
	}else{
		$('userOtherVideoList').innerHTML = '<div class="nothing"><span class="span"><img src="http://image2.sina.com.cn/vblog/images/front/icon_nothing.gif"  /> 我还没有上传其他视频，一会儿再来看吧...</span></div>'; 
		$('userOtherVideoMore').style.display='none';
		}
}
	
	
/**
*该用户其他专辑
*/
function displayUserOtherSpecial(uid)
{
	var url = 'http://you.video.sina.com.cn/pg/play/userOtherSpecial.php';
	var pars = 'uid='+uid;

	var da = new Ajax.Request(
	url,
	{
		method: 'get',
		parameters: pars,
		onComplete: showUserOtherSpecialResponse
	});

}

function showUserOtherSpecialResponse(originalRequest)
{

	eval('result='+originalRequest.responseText);
	if(result){
		var count=result.length;
		var rs="";	
		var uid= location.href.substring(location.href.indexOf('-') + 1,location.href.indexOf('.html'));
		for(var i=0;i<count;i++){
			rs+='<dl><dt><a href="/a/'+result[i]['id']+'-'+uid+'.html"><img src="'+result[i]["topic_map"]+'" alt="'+result[i]['name']+'" width="80" height="60"></a></dt><dd class="blue_line"><a href="/a/'+result[i]['id']+'-'+uid+'.html">'+result[i]['name']+'</a></dd><dd><span class="gray">专辑视频数：'+result[i]['vcount']+'</span></dd><dd><span class="gray">播放数：'+result[i]['ccount']+'</span></dd></dl>';
		}
		$("userOtherSpecialList").innerHTML =rs;
		var moreHTML='<div class="fleft">1-'+count+'个专辑</div>';
		if(count>15){moreHTML+='<div class="fright"><a href="/m/'+uid+'#special"><span style="text-decoration:underline">更多</span> &gt;&gt;</a></div>';}
		$('userOtherSpecialMore').innerHTML=moreHTML;
	}else{
		$('userOtherSpecialList').innerHTML = '<div class="nothing"><img src="http://image2.sina.com.cn/vblog/images/front/icon_nothing.gif"  /> 我还没有创建专辑，一会儿再来看吧...</div>'; 
		$('userOtherSpecialMore').style.display='none';
		}
}
/**
* 关联视频 盛冬平
*/
function showRelatVideoRes(originalRequest)
{
	eval('result='+originalRequest.responseText);
	if(typeof result == 'object')
	{
		var rs="";	
		var count = result.length;
		for(var i = 0; i<count; i++)
		{
			rs += '\
<dl> \
	<dt class="dt1">\
		<a href="/b/' + result[i].curr_vid + '-' + result[i].curr_uid + '.html"><img src="'+result[i].video_image +'" class="img1" width="80" /></a>\
	</dt>\
	<dt class="dt2"><a href="javascript:;" name="playlist" vid="'+result[i].curr_vid+'" uid="'+result[i].curr_uid+'" author="'+result[i].curr_uid+'" title="'+result[i].name+'" pic="'+result[i].video_image+'" ><img src="http://image2.sina.com.cn/vblog/images/front/icon_add.gif" onmouseover="playlist.PLShow(this,\'playlist\',true)" onmouseout="playlist.PLShow(this,\'playlist\',false)" onclick="playlist.eventClick(this)" id="playlist'+result[i].curr_vid+'"/></a></dt>\
	<dd class="blue_line">\
		<a href="/b/' + result[i].curr_vid + '-' + result[i].curr_uid + '.html" title="'+result[i].name+'">\
		' + result[i].name + '\
		</a>\
	</dd>\
	<dd>播放：' + result[i].view_count + '</dd>\
	<dd>评论：<span name="cmnt_count" cmnt_id="vblog:' + result[i].curr_vid + ':0"  style="display:none">(_COUNT_)</span></dd>\
</dl>';
		}
		$("videoRelatVideo").innerHTML =rs;
		 var refreshCount=function (){
        	if(typeof(show_comment_count)!="undefined"){
        		show_comment_count(rs,$("videoRelatVideo"));
        		try{playlist.selectPicture({'tag':'a','name':'playlist'},$("videoRelatVideo"));}catch(e){}//点播单
        	}else{
        		setTimeout(function(){refreshCount();},100);
        	}
        };refreshCount();
	}
	else
	{
		$('videoRelatVideo').innerHTML = '<div class="nothing"><img src="http://image2.sina.com.cn/vblog/images/front/icon_nothing.gif"  /> 文案没定...</div>'; 
	}
}


function displayRelatVideoA(vid, uid,strVTags,strVName)
{
	var url = 'http://you.video.sina.com.cn/pg/play/relat.php';
	var pars = 'video=' + vid + "-" + uid+"&tags="+encodeURIComponent(strVTags)+"&name="+encodeURIComponent(strVName);
	var da = new Ajax.Request(
	url,
	{
		method: 'get',
		parameters: pars,
		onSuccess: showRelatVideoRes
	});
}

/**
* 关联专辑 盛冬平
*/
function showRelatTopicRes(originalRequest)
{
	eval('result='+originalRequest.responseText);
	if(typeof result == 'object')
	{
		var rs="",uid="";	
		
		count = result.length;
		for(var i = 0; i<count; i++)
		{
            uid=result[i].rela_topic_uid;if(!uid){uid='';}
			rs += '<dl><dt><a href="/a/' + result[i].rela_topic_id +'-'+uid+'.html">'+
				  '<img src="' +result[i].rela_topic_map + '" width="80" /></a></dt><dd class="blue_line">'+
				  '<a href="/a/' + result[i].rela_topic_id +'-'+uid+ '.html">' + result[i].rela_topic_name +
				  '</a></dd><dd><span class="gray">专辑视频数：' + result[i].rela_topic_vcount + 
				  '</span></dd><dd><span class="gray">播放数：' + result[i].rela_topic_ccount + 
				  '</span></dd></dl>';		
		}
		
		$("iSpecialList").innerHTML =rs;
	}
	else
	{
		$('iSpecialList').innerHTML = '<div class="nothing"><img src="http://image2.sina.com.cn/vblog/images/front/icon_nothing.gif"  /> 文案没定...</div>'; 
	}
}


function displayRelatTopic(vid, uid)
{
	var url = 'http://you.video.sina.com.cn/pg/play/relat_album.php';
	var pars = 'relatId=' + parseInt(Math.random()*100);
	var da = new Ajax.Request(
	url,
	{
		method: 'get',
		parameters: pars,
		onSuccess: showRelatTopicRes
	});
}

//拷贝
function copytext(txt,m){
var isIE=(navigator.userAgent.toLowerCase().indexOf('msie') >= 0 )?true:false;
if(isIE){
if(txt=="") return;
 var rng = document.body.createTextRange();
 var ct=document.createElement("span");
 ct.innerHTML=txt;
 document.body.appendChild(ct);
 ct.style.display="none";
 rng.moveToElementText(ct);
 rng.execCommand("Copy");
 rng.collapse(false);
 alert(m);
}else{
alert("请在IE下使用复制功能！");
}
}
function cs(){ window.status="";}
function ss(w){ window.status=w;return true;}//
//#############################//
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars='+ pairs +'&realfull=1&moz=1"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
			
		}
		var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
		n.innerHTML = this.getSWFHTML();
		return true;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
//
//#############################//
var Prototype={Version:'1.5.0',BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
var Abstract=new Object();Object.extend=function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;}
Object.extend(Object,{inspect:function(object){try{if(object===undefined)return'undefined';if(object===null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);}});Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}}
var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}}
String.interpret=function(value){return value==null?'':String(value);}
Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var name=decodeURIComponent(pair[0]);var value=pair[1]?decodeURIComponent(pair[1]):undefined;if(hash[name]!==undefined){if(hash[name].constructor!=Array)
hash[name]=[hash[name]];if(value)hash[name].push(value);}
else hash[name]=value;}
return hash;});},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;}});var $break=new Object();var $continue=new Object();var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){try{iterator(value,index++);}catch(e){if(e!=$continue)throw e;}});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator){var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.map(iterator);},collect:function(iterator){var results=[];this.each(function(value,index){results.push((iterator||Prototype.K)(value,index));});return results;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},toArray:function(){return this.map();}}
Object.extend(Enumerable,{map:Enumerable.collect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0,length=iterable.length;i<length;i++)
results.push(iterable[i]);return results;}}
Object.extend(Array.prototype,Enumerable);Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},compact:function(){return this.select(function(value){return value!=null;});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},reduce:function(){return this.length>1?this:this[0];},clone:function(){return[].concat(this);},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';},indexOf:function(object){for(var i=0,length=this.length;i<length;i++)
if(this[i]==object)return i;return-1;}});String.prototype.gsub.prepareReplacement=function(replacement){if(typeof replacement=='function')return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};}
Array.prototype.toArray=Array.prototype.clone;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){return this.template.gsub(this.pattern,function(match){var before=match[1];if(before=='\\')return match[2];return before+String.interpret(object[match[3]]);});}}
var Hash=function(obj){Object.extend(this,obj||{});};Object.extend(Hash,{toQueryString:function(obj){var parts=[];this.prototype._each.call(obj,function(pair){if(!pair.key)return;if(pair.value&&pair.value.constructor==Array){var values=pair.value.compact();if(values.length<2)pair.value=values.reduce();else{key=encodeURIComponent(pair.key);values.each(function(value){value=value!=undefined?encodeURIComponent(value):'';parts.push(key+'='+encodeURIComponent(value));});return;}}
if(pair.value==undefined)pair[1]='';parts.push(pair.map(encodeURIComponent).join('='));});return parts.join('&');}});Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(iterator){for(var key in this){var value=this[key];if(value&&value==Hash.prototype[key])continue;var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},toQueryString:function(){return Hash.toQueryString(this);}});var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0}
Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(typeof responder[callback]=='function'){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''}
Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=='string')
this.options.parameters=this.options.parameters.toQueryParams();}}
Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=this.options.parameters;if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
params=Hash.toQueryString(params);if(params&&/Konqueror|Safari|KHTML/.test(navigator.userAgent))params+='&_='
if(this.method=='get'&&params)
this.url+=(this.url.indexOf('?')>-1?'&':'?')+params;try{Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)
setTimeout(function(){this.respondToReadyState(1)}.bind(this),10);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(typeof extras.push=='function')
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){return!this.transport.status||(this.transport.status>=200&&this.transport.status<300);},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(state=='Complete'){try{this._complete=true;(this.options['on'+this.transport.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(transport,json);}catch(e){this.dispatchException(e);}
if((this.getHeader('Content-type')||'text/javascript').strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(transport,json);Ajax.Responders.dispatch('on'+state,this,transport,json);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},evalJSON:function(){try{var json=this.getHeader('X-JSON');return json?eval('('+json+')'):null;}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){return null}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))}
this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,param){this.updateContent();onComplete(transport,param);}).bind(this);this.request(url);},updateContent:function(){var receiver=this.container[this.success()?'success':'failure'];var response=this.transport.responseText;if(!this.options.evalScripts)response=response.stripScripts();if(receiver=$(receiver)){if(this.options.insertion)
new this.options.insertion(receiver,response);else
receiver.update(response);}
if(this.success()){if(this.onComplete)
setTimeout(this.onComplete.bind(this),10);}}});if(!window.Element)
var Element=new Object();Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;}};Object.extend(Element,Element.Methods);function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(typeof element=='string')
element=document.getElementById(element);return element;}
function $H(object){if(object&&object.constructor==Hash)return object;return new Hash(object);};//
//#############################//

function scroll_to_top()
{
	document.body.scrollTop=0;
}

function hideFrame()
{
		document.getElementById('friendIframeShow').style.display = 'none';
		document.getElementById('friendWin').style.display = 'none';
}


function iframeResize(_oThis)
{
	var indexwin    = null;
	if (document.getElementById)
	{
		dyniframe       = _oThis;
			if (dyniframe)
		{
			if (dyniframe.contentDocument)
			{
				dyniframe.height	= dyniframe.contentDocument.getElementsByTagName('html')[0].scrollHeight + 50;
			}
			else if (dyniframe.document && dyniframe.document.body.scrollHeight)
			{
				iframeheight	= _oThis.contentWindow.document.body.scrollHeight + 50;
				dyniframe.height = iframeheight;
			}
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", iframeResize, false)
else if (window.attachEvent)
	window.attachEvent("onload", iframeResize)
else
	window.onload=iframeResize

function winopen(url)
{
	 window.open("/control/section" + url, "control", "width=680,height=450,scrollbars=yes,left=" + (window.screen.width-680)/2 + ",top=" + (window.screen.height-450)/2);
}

function toggle(sId)
{
	var obj = document.getElementById(sId);
	if (obj.style.display == '')
		obj.style.display = 'none';
	else
		obj.style.display = '';
		
	return false;
}function setFresh(){
	if(typeof(commonDialog)=="undefined"){
		setTimeout(function(){setFresh();},100);
	}else{
		commonDialog.setClickEvent();
	}
	if(typeof(sendComm)=="undefined"||typeof(commListObj)=="undefined"){
		setTimeout(function(){setFresh();},100);
	}else{
		
		sendComm.refreshEvent();
		commListObj.setRefreshEvent();
		commonDialog.setClickEvent();
	}
}
function setAllHidden(){
	var objList=document.getElementsByTagName('DIV');
	for(var i=0;i<objList.length;i++){
		var setHidden=objList[i].getAttribute('setHidden');
		if("yes"==setHidden){
			objList[i].style.display="none";
		}
	}
}