// DO NOT EDIT THIS FILE! see README.TXT - Javascript Compressor 1.1.0

var Minglebox=window.Minglebox||{};
var code__='CHBG';
Minglebox.useLegacyEvent=function(el,et){
if(!el.addEventListener&&!el.attachEvent){
return true;
}else if(this.isSafari){
if("click"==et||"dblclick"==et){
return true;
}
}
return false;
}
Minglebox.addListener=function(el,et,eh,o){
var h=function(e){
return eh.call(el,e,o);
};
if(Minglebox.useLegacyEvent(el,et)){
}else if(el.addEventListener){
el.addEventListener(et,h,false);
}else if(el.attachEvent){
el.attachEvent("on"+et,h);
}
}
Minglebox.stopEvent=function(ev){
if(ev.stopPropagation){
ev.stopPropagation();
}else{
ev.cancelBubble=true;
}
if(ev.preventDefault){
ev.preventDefault();
}else{
ev.returnValue=false;
}
}
Minglebox.namespace=function(sNameSpace){
if(!sNameSpace||!sNameSpace.length){
return null;
}
var levels=sNameSpace.split(".");
var currentNS=Minglebox;
for(var i=(levels[0]=="Minglebox")?1:0;i<levels.length;++i)
{
currentNS[levels[i]]=currentNS[levels[i]]||{};
currentNS=currentNS[levels[i]];
}
return currentNS;
};
Minglebox.Request=
{
_msxml_progid:[
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
],
_poll:[],
_pi:50,
_tid:0,
setProgId:function(id){
this._msxml_progid.unshift(id);
},
create:function(transactionId){
var obj,http;
try{
http=new XMLHttpRequest();
obj={conn:http,tId:transactionId};
}catch(e){
for(var i=0;i<this._msxml_progid.length;++i){
try{
http=new ActiveXObject(this._msxml_progid[i]);
if(http){
obj={conn:http,tId:transactionId};
break;
}
}catch(e){
}
}
}
return obj;
},
conn:function(){
var o;
var tId=this._tid;
try{
o=this.create(tId);
if(o){
this._tid++;
}
}catch(e){
}
return o;
},
process:function(event,init,callback,uData,uri,formId,cMsg){
if(cMsg!=null&&!confirm(cMsg)){
return null;
}
uri+="&t="+new Date();
if(init!=null&&!init(event,uData,uri)){
return null;
}
var method="GET";
var postData=null;
var o=this.conn();
if(o){
if(formId){
postData=this.setForm(formId);
method="POST";
}
o.conn.open(method,uri,true);
if(postData){
o.conn.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
}
this.handleReadyState(o,callback,uData);
postData?o.conn.send(postData):o.conn.send(null);
return o;
}
},
handleReadyState:function(o,callback,uData){
var oConn=this;
try{
this._poll[o.tId]=window.setInterval(
function(){
if(o.conn&&o.conn.readyState==4){
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
oConn.handleResponse(o,callback,uData);
}
}
,this._pi);
}catch(e){
window.clearInterval(oConn._poll[o.tId]);
oConn._poll.splice(o.tId);
oConn.handleResponse(o,callback,uData);
}
},
handleResponse:function(o,callback,u){
if(!callback){
this.releaseObject(o);
return;
}
try{
var httpStatus;
try{
httpStatus=o.conn.status;
}catch(e){
httpStatus=13030;
}
if(httpStatus>=200&&httpStatus<300){
callback(u,this.createResponse(o));
}else{
callback(u,null);
}
}finally{
this.releaseObject(o);
}
},
createResponse:function(o){
var r={};
try
{
r.status="failure";
if(o.conn.responseText){
r.text=o.conn.responseText;
r.status="success";
}
var xml=o.conn.responseXML;
if(!xml){
return r;
}
this.processXml(xml,r);
}catch(e){
}
return r;
},
processXml:function(xml,r){
var ut=[];
var mt=[];
var response=xml?xml.getElementsByTagName("response"):null;
if(response&&response.length>0)
{
var root=response.item(0);
var attr=root&&root.attributes?root.attributes.getNamedItem("status"):null;
r.status=attr?attr.value:"unknown";
var ml=xml.getElementsByTagName("message");
var mm=ml&&ml.length>0?ml.item(0):null;
r.message=mm&&mm.firstChild?mm.firstChild.nodeValue:"";
ut=this.parse(xml,"user");
mt=this.parse(xml,"result");
}
r.users=ut;
r.results=mt;
},
parse:function(xml,tag){
var tl=[];
try{
var l=xml.getElementsByTagName(tag);
if(!l)
return tl;
for(var k=0;k<l.length;k++){
var t=l.item(k);
var fields=t.childNodes;
var r=[];
for(var m=0;m<fields.length;m++){
var f={};
var n=fields.item(m);
if(n.nodeType==3)
continue;
f.name=n.tagName;
f.value='';
var values=n.childNodes;
for(var v=0;v<values.length;v++){
f.value+=values[v].nodeValue;
}
r.unshift(f);
}
tl.unshift(r);
}
}catch(e){
}
return tl;
},
setForm:function(formId){
var sFormData='';
var oForm;
if(typeof formId=='string'){
oForm=(document.getElementById(formId)||document.forms[formId]);
}else if(typeof formId=='object'){
oForm=formId;
}else{
return sFormData;
}
var oElement,oName,oValue,oDisabled;
var hasSubmit=false;
for(var i=0;i<oForm.elements.length;i++){
oDisabled=oForm.elements[i].disabled;
if(oForm.elements[i].name!=""){
oElement=oForm.elements[i];
oName=oForm.elements[i].name;
oValue=oForm.elements[i].value;
}
if(!oDisabled){
switch(oElement.type){
case'select-one':
case'select-multiple':
for(var j=0;j<oElement.options.length;j++){
if(oElement.options[j].selected){
sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';
}
}
break;
case'radio':
case'checkbox':
if(oElement.checked){
sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';
}
break;
case'file':
case undefined:
case'reset':
case'button':
break;
case'submit':
if(!hasSubmit){
sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';
hasSubmit=true;
}
break;
default:
sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';
break;
}
}
}
sFormData=sFormData.substr(0,sFormData.length-1);
return sFormData;
},
releaseObject:function(o){
o.conn=null;
o=null;
}
};
function toMap(oList){
var oMap=new Object();
for(var i=0;i<oList.length;i++){
oMap[oList[i].name]=oList[i].value;
}
return oMap;
}
Minglebox.CCMgr=function(tO){
this.cfn='contextId';
this.wfn='websiteId';
this.wids=new Array();
this.timestamp=null;
this.wHandlers=new Object();
this.cHandlers=new Object();
this.uHandlers=new Object();
this.tO=tO;
this.p=false;
this.init();
}
Minglebox.CCMgr.URI="/comment.do?method=ping&wids=";
Minglebox.CCMgr.prototype={
init:function(){
var loader=this;
setTimeout(function(){
loader.request()
},loader.tO);
},setPollInt:function(t0){
this.tO=t0;
},registerUH:function(cb,o,w){
this.uHandlers[w]=function(m){
cb.call(o,m);
}
},register:function(cb,o,w,c,p){
if(!w&&!c)return;
var a=function(m){
cb.call(o,m);
};
if(c){
this.cHandlers[w+c]=a;
}else{
this.wHandlers[w]=a;
}
for(var j=0;j<this.wids.length;j++){
if(this.wids[j]==w){
return;
}
}
if(w)this.wids.push(w);
this.p=p;
},remove:function(w,c){
if(c&&w)this.cHandlers[w+c]=null;else this.cHandlers[w]=null;
},callback:function(userdata,result){
if(result){
if(result.status=="failure"&&this.p){
window.close();
}
for(var i=0;i<result.results.length;i++){
var oMap=toMap(result.results[i]);
this.timestamp=(oMap['date']);
var c=oMap[this.cfn];
var w=oMap[this.wfn];
var cbd=c?this.cHandlers[w+c]:null;
if(!cbd&&!readCookie(c))cbd=this.wHandlers[w];
if(cbd)cbd(oMap);
}
for(var k=0;k<result.users.length;k++){
for(var j=0;j<this.wids.length;j++){
var c=this.uHandlers[this.wids[j]];
if(c){
c(toMap(result.users[k]));
}
}
}
}else{
}
this.init();
},
request:function(){
var url=this.construct(Minglebox.CCMgr.URI,this.wids);
this.send(addContextPath(url));
},
construct:function(url,a){
var len=a.length;
if(len>0){
for(var i=0;i<len;i++){
url+=a[i];
if(i<len-1)url+=",";
}
}
url+="&timeStamp="+(this.timestamp==null?"":this.timestamp);
url+="&con"
if(this.p){
url+="&p=1";
}
return url;
},
send:function(url){
var cc=this;
Minglebox.Request.process(null,null,function(a,b){
cc.callback(a,b);
},null,url,null,null);
},setTime:function(t){
this.timestamp=t;
}
}
var ccMgr=new Minglebox.CCMgr(10000);
Minglebox.AlertHandler=function(wid){
this.wid=wid;
this.parentPointer=document.getElementById('masterAlertDiv');
this.init();
}
Minglebox.AlertHandler.prototype={
init:function(){
ccMgr.register(this.alertCallback,this,this.wid,null);
},
alertCallback:function(m){
if(m['type']==2){
var c=m["body"];
var i=m["contextId"];
if(m["alertType"]=="2"){
var message="<h3>Chat Room Invite - "+i+"</h3><p>"+c+"</p>";
this.displayMessage(message,m["id"]);
}else{
if(c.length>20){
c=c.substring(0,20);
c+=" ..";
}
var hLink="<img style=\"padding-right:5px;\" align=\"left\" src=\"" + addContextPath(m["photoUrl"]) + "\"/>";
var forward=addContextPath("/comment.do?method=reply&ajax=true&websiteId="+m["websiteId"]+"&contextId="+i);
var pforward="/comment.do?method=show&ajax=true&websiteId="+m["websiteId"]+"&contextId="+i;
var link="<a href=\"#null\" onclick=\"Minglebox.Request.process(event,showWindow,chatWindowCallback,'" + pforward + "','" + forward + "',null,null);closeAlert('" + m["id"] + "');\">Reply</a>";
var message="<h3>New ChitChat - "+i+"</h3><p style=\"height:60px;background-color:#DFDFDF;padding:5px;\">"+hLink+c+"<br/>"+link+"</p>";
this.displayMessage(message,m["id"]);
}
}
},displayMessage:function(message,uId){
if(this.parentPointer){
var child=document.createElement("div");
child.setAttribute("id",uId);
child.innerHTML=message;
child.className="alertDiv";
this.parentPointer.appendChild(child);
}
}
};
function closeAlert(id){
var el=document.getElementById(id);
el.parentNode.removeChild(el);
}
function initPing(tO){
ccMgr.setPollInt(tO);
var wid=document.getElementById("__userWebsiteId__").value;
new Minglebox.AlertHandler(wid);
}
var mb=new Object();
mb={scroll:function(h){
var c=typeof(h)=='string'?this._get(h):h;
var len=c.childNodes.length;
for(var j=0;j<len+5;j++){
c.scrollTop=c.scrollHeight;
}
},_get:function(h){
return document.getElementById(h);
},_refresh:function(){
var url=window.location.href;
if(url.indexOf("#")>-1){
url=url.substr(0,url.indexOf("#"));
}
window.location.assign(url);
}
}
function chatSubmit(){
var b=document.chatWindowForm;
var x=getLanguageText();
clearText();
if(x==""){
var s=mb._get('contentId').value;
if(s!=null&&s.length>0){
x="Here's a song for you. Enjoy!!";
}else{
alert("Please enter some text to send");
return false;
}
}
b.content.value=x;
return true;
}
var CC=null;
function hidechatWindow(){
var f=mb._get('chatWindowForm');
ccMgr.remove(mb._get("__userWebsiteId__").value,f.context.value);
f.content.value="";
f.context.value="";
hideComponent('chatWindow');
resetPlayListContext();
}
function showWindow(event,userdata,oValue){
if(!ccInit){
alert('Please wait till the page loads');
return false;
}
if(CC==null){
CC=new Minglebox.ChitChat('chatMessageBoxId','userContent');
}else{
hidechatWindow();
}
if(document.getElementById('selectLang').options.length==0){
initQuill(false);
}else{
setTimeout(setFocus,500);
}
var d=mb._get('floatOut');
if(d){
d.title=addContextPath(userdata);
}
setWebsite(userdata);
showComponent(event,'chatWindow');
CC.init(true);
setTimeout(setFocus,500);
return true;
}
function setWebsite(userdata){
var i=userdata.indexOf("websiteId=")+"websiteId=".length;
var j=userdata.indexOf("&",i);
document.chatWindowForm.websiteId.value=userdata.substring(i,j);
}
function initChitChat(p){
if(CC==null){
CC=new Minglebox.ChitChat('chatMessageBoxId','userContent',p);
}
CC.init(false);
CC.register();
return true;
}
function chatWindowCallback(u,r){
CC?CC.cb(u,r):null;
}
function chatSubmitCallback(u,r){
CC?CC.cb(u,r):null;
resetPlayListContext();
}
Minglebox.ChitChat=function(d,c,p){
this.d=mb._get(d);
this.c=mb._get(c);
this.p=p;
this.handle=mb._get(d);
}
Minglebox.ChitChat.prototype={init:function(doClear){
if(doClear)this.d.innerHTML='';
if(this.c){
this.c.focus();
}
},
cb:function(u,r){
if(r.users&&r.users.length>0)this.setContext(toMap(r.users[0]));
if(r!=null&&r.results.length>0){
for(var i=0;i<r.results.length;i++){
this.populate(toMap(r.results[i]));
}
this.scroll();
this.focus();
}
},populate:function(m){
if(m['type']==1){
var msg;
var moduleName=m['moduleName'];
if(moduleName=='PhotoManager'){
msg='<a href=\"'+m['objectPage']+'\"><img src=\"'+m['objectUrl']+'\" align=\"left\" class=\"img53\"/></a>';
}else if(moduleName=='PostManager'){
msg='<a href=\"'+m['objectPage']+'\" class=\"LinkButtonStyle\">Blog</a>';
}else{
var link=null;
if(m['contentType']=="1"){
link=m['contentUrl'];
}
if(link)
msg="<a href=\"" + link + "\"><img src=\"" + addContextPath("/images/website/musicscrap.gif") + "\"width=\"12\" height=\"13\" border=\"0\" alt=\"song scrap\" align=\"ABSMIDDLE\"  style=\"padding:0 3px 0 5px;\" /></a>";
}
msg=(msg?msg:'')+m['body'];
var ch=document.createElement("div");
ch.className='divClearBoth';
var hsu=m["headshot"]?m["headshot"]:document.chatWindowForm.userHeadshot.value
ch.innerHTML="<span>"+"<img align=\"left\" width=\"33px;\" src=\"" + hsu + "\"/>"+"<span class=\"ccSender\">"+m['from']+": </span>"+msg+"</span>";
this.handle.appendChild(ch);
}
},setContext:function(oMap){
if(oMap["contextWebsiteUrl"]){
if(oMap['access']=="false"){
alert("This users settings does not allow you to chit chat");
mb._get("chatmsgdiv").style.display="none";
}else{
mb._get("chatmsgdiv").style.display="block";
if(oMap['receiverWebsiteId']==oMap['senderWebsiteId'])mb._get("blockuser").style.display="none";
}
document.chatWindowForm.websiteId.value=oMap['receiverWebsiteId'];
var n=oMap['contextName'];
mb._get('chattitle').innerHTML=n;
mb._get('chatcontextphoto').src=oMap['contextPhotoUrl'];
mb._get('chatcontextphoto').setAttribute("alt",n);
mb._get('chatname').href=oMap['contextWebsiteUrl'];
document.chatWindowForm.context.value=oMap['contextName'];
if(n.length>14)n=n.substring(0,14)+"..";
mb._get('chatname').innerHTML=n;
}
this.register(oMap);
},register:function(oMap){
var cF=document.chatWindowForm;
ccMgr.setTime(cF.timeStamp.value);
if(oMap){
ccMgr.register(this.mcb,this,oMap['senderWebsiteId'],oMap['contextName'],this.p);
}
},mcb:function(m){
this.populate(m);
this.scroll();
this.focus();
},scroll:function(){
mb.scroll(this.d);
},focus:function(){
document.body.focus();
if(this.c){
this.c.focus();
}
}
}
var PLMgr=null;
PlayListUIMgr=function(event,comId,dId,wId,cId,ssId,ssM,plId,lsM){
this.event=event;
this.comId=comId;
this.dId=dId;
this.wId=wId;
this.cId=cId;
this.saId=ssId;
this.ssM=ssM;
this.pL=plId;
this.lsM=lsM;
}
PlayListUIMgr.prototype.start=function(){
var o=document.getElementById(this.dId);
if(o){
if(o.childNodes.length>0)return;
}
var c=document.getElementById(this.cId);
if(c){
if(c.value!="")if(!confirm("Do you want to change the song attachment?"))return;
}
showComponent(this.event,this.comId);
var PUMgr=this;
var url=addContextPath("/music/playlist.do?method=getPlayList&websiteId="+this.wId);
Minglebox.Request.process(null,null,function(a,b){
PUMgr.callback(a,b)
},null,url,null,null);
}
PlayListUIMgr.prototype.callback=function(userData,oresult){
if(oresult.status=="success"){
var o=document.getElementById(this.dId);
if(o)o.innerHTML="";
if(o){
var len=oresult.results.length;
var p=document.createElement('div');
for(var i=0;i<len;i++){
var id=oresult.results[i][0].value;
var name=oresult.results[i][1].value;
var artist=oresult.results[i][2].value;
var c=document.createElement('p');
c.innerHTML="<span>"+name+"</span>"+"<a href=\"#\" onclick=\"addSong('" + id + "');return false;\"> + add</a>";
p.appendChild(c);
}
if(len==0){
var c=document.createElement('p');
c.innerHTML="You dont a playlist, click <a href=\"" + addContextPath("/music/channel.do") + "\" style=\"float:none\">here</a> to create one !! ";
c.align="center";
p.appendChild(c);
}
o.appendChild(p);
}
}
}
PlayListUIMgr.prototype.addSong=function(id){
var c=document.getElementById(this.cId);
if(c)c.value=id;
this.hidePlayList();
this.changeStatus();
}
PlayListUIMgr.prototype.hidePlayList=function(){
this.removePlayListInfo();
hideComponent(this.comId);
}
PlayListUIMgr.prototype.removePlayListInfo=function(){
var o=document.getElementById(this.dId);
var c=o.childNodes;
for(var i=0;i<c.length;i++){
o.removeChild(c[i]);
}
}
PlayListUIMgr.prototype.changeStatus=function(){
var s=document.getElementById(this.saId);
if(s)s.innerHTML=this.ssM;
var l=document.getElementById(this.pL);
if(l)l.innerHTML=this.lsM['action'];
}
PlayListUIMgr.prototype.resetPlayListContext=function(){
var c=document.getElementById(this.cId);
if(c){
c.value="";
}
var s=document.getElementById(this.saId);
if(s)s.innerHTML="";
var l=document.getElementById(this.pL);
if(l)l.innerHTML=this.lsM['deaction'];
this.hidePlayList();
}
function getPlayList(event){
var u=mb._get('__userWebsiteId__');
if(u!=null){
var wId=u.value;
var linkStatus=new Object();
linkStatus['action']=' change';
linkStatus['deaction']=' scrap a song';
PLMgr=new PlayListUIMgr(event,'play','playlist',wId,'contentId','songAddStatus',' song added - ','songLink',linkStatus);
PLMgr.start();
}
}
function addSong(id){
if(PLMgr)PLMgr.addSong(id);
}
function hidePlayList(){
if(PLMgr)PLMgr.hidePlayList();
}
function resetPlayListContext(){
if(PLMgr)PLMgr.resetPlayListContext();
}
var offsetxpoint=-60;
var offsetypoint=20;
var ie=document.all;
var ns6=document.getElementById&&!document.all;
var isdrag=false;
var x,y;
var vx,vy;
var dob;
var dI=null;
var width=(ie&&!window.opera?ietruebody().clientWidth:window.innerWidth)-500;
var height=(ie&&!window.opera?ietruebody().clientHeight:window.innerHeight)-300;
function movemouse(e){
if(isdrag){
var l=vx+(ns6?e.clientX:event.clientX);
var b=vy+(ns6?e.clientY:event.clientY);
dob.style.left=(l<100?100:l>width?width:l)+"px";
dob.style.top=(b<100?100:b)+"px";
}
return false;
}
function track(e){
isdrag=true;
dob=document.all?document.all[dI]:document.getElementById?document.getElementById(dI):null;
tx=parseInt(dob.style.left);
ty=parseInt(dob.style.top);
x=ns6?e.clientX:event.clientX;
y=ns6?e.clientY:event.clientY;
vx=tx-x;
vy=ty-y;
document.onmousemove=movemouse;
return false;
}
function untrack(e){
isdrag=false;
}
function ietruebody()
{
return((document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body);
}
function showComponent(event_fire,cId)
{
var e=window.event;
if(!e)
{
e=event_fire;
}
dI=cId;
var oComponent=document.all?document.all[cId]:document.getElementById?document.getElementById(cId):null;
if(!oComponent)
{
alert("component not found");
return false;
}
var e=window.event;
if(!e)
{
e=event_fire;
}
var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;
var rightedge=ie&&!window.opera?ietruebody().clientWidth-event.clientX-offsetxpoint:window.innerWidth-e.clientX-offsetxpoint-20;
var bottomedge=ie&&!window.opera?ietruebody().clientHeight-event.clientY-offsetypoint:window.innerHeight-e.clientY-offsetypoint-20;
var leftedge=(offsetxpoint<0)?offsetxpoint*(-1):-1000;
var topedge=offsetypoint;
if(rightedge<oComponent.offsetWidth){
var leftPos=ie?ietruebody().scrollLeft+event.clientX-oComponent.offsetWidth/2+"px":
window.pageXOffset+e.clientX-oComponent.offsetWidth/2+"px";
oComponent.style.left=leftPos;
}
else if(curX<leftedge){
oComponent.style.left="5px";
}else{
oComponent.style.left=curX+offsetxpoint+"px";
}
if(bottomedge<oComponent.offsetHeight){
var topPos=ie?ietruebody().scrollTop+event.clientY-oComponent.offsetHeight/2-offsetypoint+"px":
window.pageYOffset+e.clientY-oComponent.offsetHeight/2-offsetypoint+"px";
oComponent.style.top=topPos;
}else if(curY<topedge){
oComponent.style.top="5px";
}else{
oComponent.style.top=curY+offsetypoint+"px";
}
oComponent.style.visibility="visible";
return false;
}
function hideComponent(cId)
{
var oComponent=document.all?document.all[cId]:document.getElementById?document.getElementById(cId):null;
if(!oComponent)
{
alert("component not found");
return;
}
oComponent.style.visibility="hidden";
}
function MM_preloadImages(){
var d=document;
if(d.images){
if(!d.MM_p)d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){
d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];
}
}
}
function MM_swapImgRestore(){
var i,z,a=document.MM_sr;
for(i=0;a&&i<a.length&&(z=a[i])&&z.oSrc;i++)z.src=z.oSrc;
}
function MM_findObj(n,d){
var p,i,z;
if(!d)d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(z=d[n])&&d.all)z=d.all[n];
for(i=0;!z&&i<d.forms.length;i++)z=d.forms[i][n];
for(i=0;!z&&d.layers&&i<d.layers.length;i++)z=MM_findObj(n,d.layers[i].document);
if(!z&&d.getElementById)z=d.getElementById(n);
return z;
}
function MM_swapImage(){
var i,j=0,z,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if((z=MM_findObj(a[i]))!=null){
document.MM_sr[j++]=z;
if(!z.oSrc)z.oSrc=z.src;
z.src=a[i+2];
}
}
function trackUrl(u,t){
return"/tracker"+u+"%26t="+t;
}
Minglebox.TextArea=function(ta,gb,gr){
this.ta=document.getElementById(ta);
this.gb=document.getElementById(gb);
this.gr=document.getElementById(gr);
this.h=250;
this.w=250;
this.dragx=false;
this.dragy=false;
this.oy=0;
this.dy=0;
this.ox=0;
this.dx=0;
this.nh=this.h;
this.nw=this.w;
Minglebox.addListener(this.gb,"mousedown",this._onDnY,this);
Minglebox.addListener(this.gb,"mouseup",this._onUp,this);
if(this.gr){
Minglebox.addListener(this.gr,"mousedown",this._onDnX,this);
Minglebox.addListener(this.gr,"mouseup",this._onUp,this);
}
Minglebox.addListener(document,"mouseup",this._onUp,this);
Minglebox.addListener(document,"mousemove",this._onMv,this);
}
Minglebox.TextArea.prototype={
resize:function(oSelf){
if(oSelf.dragy&&oSelf.dy!=0){
oSelf.nh+=oSelf.dy;
oSelf.oy+=oSelf.dy;
oSelf.ta.style.height=(oSelf.nh-8)+"px";
}
if(oSelf.dragx&&oSelf.dx!=0){
oSelf.nw+=oSelf.dx;
oSelf.ox+=oSelf.dx;
oSelf.ta.style.width=(oSelf.nw-8)+"px";
}
},_onDnY:function(event,oSelf){
if(event==null)event=window.event;
oSelf.dragy=true;
oSelf.oy=parseInt(event.clientY);
},_onDnX:function(event,oSelf){
if(event==null)event=window.event;
oSelf.dragx=true;
oSelf.ox=parseInt(event.clientX);
},_onMv:function(event,oSelf){
if(!oSelf.dragx&&!oSelf.dragy)return;
if(event==null)event=window.event;
if(oSelf.dragy)oSelf.dy=parseInt(event.clientY)-oSelf.oy;
else if(oSelf.dragx)oSelf.dx=parseInt(event.clientX)-oSelf.ox;
oSelf.resize(oSelf);
},_onUp:function(event,oSelf){
oSelf.h=oSelf.nh;
oSelf.w=oSelf.nw;
if(event==null)event=window.event;
oSelf.dragx=false;
oSelf.dragy=false;
}
}
function setCookie(name,value,expires,path,domain,secure){
document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+((secure)?"; secure":"");
}
function readCookie(name){
var nameEQ=name+"=";
var ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==' ')c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name,path){
var expires=new Date();
expires.setTime(expires.getTime()+-1*60*60*1000);
setCookie(name,"",expires,((path)?path:""));
}
function wopen(url,name,w,h,resizable)
{
w+=32;
h+=96;
var wleft=(screen.width-w)/2;
var wtop=(screen.height-h)/2;
var win=window.open(url,
name,
'width='+w+', height='+h+', '+
'left='+wleft+', top='+wtop+', '+
'location=no, menubar=no, '+
'status=yes, toolbar=no, scrollbars=no, resizable='+((resizable)?resizable:"yes"));
if(!win){
alert('Please enable popoups to chictchat in a separate window!');
return true;
}else{
win.focus();
}
return false;
}
Minglebox.WinUp=function(url,mzi,mIdle){
this.url=url;
this.mzi=mzi;
this.urls=[addContextPath("/showtime.do"),addContextPath("/channel/campus.do"),addContextPath("/channel/people.do"),addContextPath("/channel/photos.do"),addContextPath("/channel/blogs.do"),addContextPath("/channel/groups.do"),addContextPath("/channel/video.do")];
if(this.url)this.urls.push(this.url);
this.tID='';
this.count=0;
this.mIdle=mIdle;
var oSelf=this;
this.reloadPage();
Minglebox.addListener(document,"mousemove",this.oreset,oSelf);
Minglebox.addListener(document,"keydown",this.oreset,oSelf);
}
Minglebox.WinUp.prototype={
oreset:function(event,oSelf){
clearTimeout(oSelf.tID);
oSelf.count=0;
oSelf.reloadPage();
},reloadPage:function(){
var o=mb._get("chatWindow");
if(o&&o.style.visibility=='visible')
this.count=0;
else{
this.count++
if(this.count==this.mIdle){
window.location.replace(this.nextUrl(window.location.pathname));
}
}
var oSelf=this;
this.tID=setTimeout(function(){
oSelf.reloadPage();
},1000);
},nextUrl:function(href){
var u='';
for(var i=0;i<this.urls.length;i++){
if(href==this.urls[i]){
u=(i+1)<this.urls.length?this.urls[i+1]:this.urls[0];
break;
}
}
if(!u)u=this.urls[0]
u+=(u.indexOf("?")>0?"&":"?")+'mzi='+this.mzi;
return u;
}
}
Minglebox.captureEnter=function(){
this.c=null;
}
Minglebox.captureEnter.prototype={
capture:function(e,i,cb,ud,url,form,cm,b){
var event=window.event;
if(!event){
event=e;
}
if(this.c!=17&&event.keyCode==13){
Minglebox.Request.process(event,i,cb,ud,url,form,cm);
Minglebox.stopEvent(event);
}else if(this.c==17&&event.keyCode==13){
var r=mb._get(b);
if(r){
var v=r.value;
v=v+"\n";
r.value=v;
this.c=null;
Minglebox.stopEvent(event);
}else{
Minglebox.Request.process(event,i,cb,ud,url,form,cm);
}
}
this.c=event.keyCode;
}
}
var enterMgr=new Minglebox.captureEnter;
var slideDownInitHeight=new Array();
var slidedown_direction=new Array();
var slidedownActive=false;
var contentHeight=false;
var slidedownSpeed=20;
var slidedownTimer=7;
function slidedown_showHide(e,boxId,moodSpanId)
{
if(!slidedown_direction[boxId])slidedown_direction[boxId]=1;
if(!slideDownInitHeight[boxId])slideDownInitHeight[boxId]=0;
if(slideDownInitHeight[boxId]==0)slidedown_direction[boxId]=slidedownSpeed;else slidedown_direction[boxId]=slidedownSpeed*-1;
var slidedownContentBox=document.getElementById(boxId);
var subDivs=slidedownContentBox.getElementsByTagName('DIV');
var slidedownContent=subDivs?subDivs[subDivs.length-1]:slidedownContentBox.height;
contentHeight=slidedownContent.offsetHeight;
if(e)
showComponent(e,boxId);
else
slidedownContentBox.style.visibility='visible';
slidedownActive=true;
slidedown_showHide_start(slidedownContentBox,slidedownContent);
}
function slidedown_showHide_start(slidedownContentBox,slidedownContent)
{
if(!slidedownActive)return;
slideDownInitHeight[slidedownContentBox.id]=slideDownInitHeight[slidedownContentBox.id]/1+slidedown_direction[slidedownContentBox.id];
if(slideDownInitHeight[slidedownContentBox.id]<=0){
slidedownActive=false;
slidedownContentBox.style.visibility='hidden';
slideDownInitHeight[slidedownContentBox.id]=0;
}
if(slideDownInitHeight[slidedownContentBox.id]>contentHeight){
slidedownActive=false;
slideDownInitHeight[slidedownContentBox.id]=contentHeight;
}
slidedownContentBox.style.height=slideDownInitHeight[slidedownContentBox.id]+'px';
slidedownContent.style.top=slideDownInitHeight[slidedownContentBox.id]-contentHeight+'px';
setTimeout('slidedown_showHide_start(document.getElementById("'+slidedownContentBox.id+'"),document.getElementById("'+slidedownContent.id+'"))',slidedownTimer);
}
function setSlideDownSpeed(newSpeed)
{
slidedownSpeed=newSpeed;
}
function setMoodCallback(title,oresult){
addThemeCallback(title,oresult);
var ms=mb._get('moodSpan');
if(ms)ms.innerHTML=title;
slidedown_showHide(null,'box1','moodSpan');
}
function displayStandardMsg(oMsg){
var MsgDiv=document.getElementById("ajaxMessages");
var oMsgDiv=document.createElement("div");
MsgDiv.appendChild(oMsgDiv);
if(oMsgDiv)
{
oMsgDiv.className="promptDiv";
oMsgDiv.innerHTML="<label color='green'>"+oMsg+"</label>";
oMsgDiv.style.visibility="visible";
}
}
Minglebox.NavMgr=function(){
this.ctrlMap=new Object();
this.ctrlAltMap=new Object();
this.ctrlMap[37]='ctrl-la';
this.ctrlMap[39]='ctrl-ra';
this.ctrlAltMap[72]='/user/home.do?method=view';
this.ctrlAltMap[70]='/channel/friends.do?method=load';
this.ctrlAltMap[67]='/channel/campus.do?method=load';
this.ctrlAltMap[86]='/channel/video.do';
this.ctrlAltMap[80]='/channel/photos.do';
this.ctrlAltMap[71]='/channel/groups.do?method=load';
this.ctrlAltMap[66]='/channel/blogs.do';
this.ctrlAltMap[77]='/music/channel.do';
this.ctrlAltMap[65]='/channel/people.do?method=load';
Minglebox.addListener(document,"keydown",this.capture,this);
}
Minglebox.NavMgr.prototype={
capture:function(e,oSelf){
var event=window.event?window.event:null;
if(!event)
event=e;
var o=mb._get('kt_');
if(o)o.value=o.value+(''+event.keyCode);
if(event.ctrlKey&&event.altKey){
var k=oSelf.ctrlAltMap[event.keyCode]
if(k){
oSelf.url(k);
}
return;
}
if(event.ctrlKey){
var k=oSelf.ctrlMap[event.keyCode]
if(k)
oSelf.doAction(k);
}
},doAction:function(k){
var p=document.getElementsByName(k);
if(p&&p.length>0)
window.location.assign(p[0].href);
},url:function(k){
window.location.assign(k);
}
}
var navMgr__=new Minglebox.NavMgr;
var sliderCount__=0;
MediaSlider=function(pId,url,cb,width,small,offset,msg){
sliderCount__++;
this.pId=pId+sliderCount__;
this.opId=pId;
this.url=url;
this.cb=cb;
this.thumbs=new Array();
this.liId="imgBar"+this.pId;
this.icId="ImageContainer"+this.pId;
this.initialize=false;
this.small=small?small:false;
this.width=width?width:500;
this.offset=offset?offset:0;
this.pending=false;
this.msg=msg?msg:"there is no matching content";
}
MediaSlider.prototype.fetch=function(l,reverse){
if(this.pending){
return;
}
var self=this;
if(!this.initialized){
Minglebox.addListener(document.getElementById('moveLeft'+this.pId),"click",this.moveLeft,this);
Minglebox.addListener(document.getElementById('moveRight'+this.pId),"click",this.moveRight,this);
this.initialized=true;
}
if(document.getElementById(self.liId)){
document.getElementById(self.liId).style.display="block"
}
var o=reverse?this.offset:this.thumbs.length+this.offset;
self.pending=true;
Minglebox.Request.process(null,null,function(a,b){
try{
if(b.results&&b.results.length=='0'){
if(document.getElementById(self.liId)){
document.getElementById(self.liId).style.display="none"
}
if(self.thumbs.length=='0')
document.getElementById(self.icId).innerHTML="<td><b>"+self.msg+"</b></td>";
}else{
for(var xx=0;xx<b.results.length;xx++)
{
var mm=toMap(b.results[xx]);
self.thumbs[self.thumbs.length]=mm['src'].replace("m_data","s_data");
if(document.getElementById(self.liId))document.getElementById(self.liId).style.display="none";
if(self.thumbs[self.thumbs.length-1]==''){
return;
}
var oTD=document.createElement("TD");
oTD.vAlign='bottom';
var thumb=mm['src'];
var page=mm['link'];
var embed=mm['url'];
var oImg=document.createElement("IMG");
oImg.style.cursor='pointer';
oImg.style.border='1px solid black';
oImg.src=self.thumbs[self.thumbs.length-1];
oTD.appendChild(oImg);
var pos=reverse?self.offset+xx:self.offset+self.thumbs.length;
if(reverse&&document.getElementById(self.icId).firstChild){
document.getElementById(self.icId).insertBefore(oTD,document.getElementById(self.icId).firstChild);
}else
document.getElementById(self.icId).appendChild(oTD);
if(self.small){
var iw=oImg.width?oImg.width:0;
var ih=oImg.height?oImg.height:0;
if(iw!=0&&ih!=0){
oImg.width=53;
oImg.height=((ih/iw)*53);
}else{
oImg.width=53;
}
}
var args={self:self,thumb:thumb,page:page,embed:embed,offset:pos}
Minglebox.addListener(oTD,"click",self.cb,args);
if(self.small){
Minglebox.addListener(oImg,"mousemove",self.growImg,self);
}
}
}
}catch(e){
}
self.pending=false;
},null,addContextPath(this.url+'&limit='+l+'&offset='+o),null,null);
}
MediaSlider.prototype.getHtml=function(){
var imgR=addContextPath('/images/Right.png');
var imgROn=addContextPath('/images/Right-On.png');
var imgL=addContextPath('/images/Left.png');
var imgLOn=addContextPath('/images/Left-On.png');
var preImg=addContextPath('/images/preLoader.gif');
var ohtml='<table width="100%" id="mst'+this.pId+'"><tr><td valign="center" align="middle" width="6%"><img src="'+imgL+'"  id="moveRight'+this.pId+'" onmouseover="imgSwtchOn(this,\'' + imgLOn + '\')" onmouseout="imgSwtchOn(this,\'' + imgL + '\')" class="sliderLImg" alt="Left"></td><td><div id="interface'+this.pId+'" style="float:left;border:1px solid #e6e6e6;overflow:hidden;overflow-x:hidden;width:'+this.width+'px"><table border="0" cellpadding="2" cellspacing="1" height="110"><tr id="'+this.icId+'"></tr></table></div></td><td valign="center" align="middle" width="6%"><img src="'+imgR+'" id="moveLeft'+this.pId+'" onmouseover="imgSwtchOn(this,\'' + imgROn + '\')" onmouseout="imgSwtchOn(this,\'' + imgR + '\')" class="sliderLImg" alt="Right"></td></tr><tr><td colspan="3" align="center" height="20"><img src="'+preImg+'" align="center" id="'+this.liId+'" style="display:none;" height="15" width="15"></td></tr></table>';
return ohtml;
}
MediaSlider.prototype.moveLeft=function(oEvent,oSelf,moveBy){
var xx=document.getElementById("interface"+oSelf.pId);
var tempPos=xx.scrollLeft
xx.scrollLeft+=moveBy?moveBy:oSelf.small?50:100;
if(tempPos==xx.scrollLeft){
oSelf.fetch(10,false);
}
}
MediaSlider.prototype.moveRight=function(oEvent,oSelf,moveBy){
var xx=document.getElementById("interface"+oSelf.pId);
var tempPos=xx.scrollLeft
xx.scrollLeft-=moveBy?moveBy:oSelf.small?50:100;
var jump=0;
if(tempPos==xx.scrollLeft&&oSelf.offset>0){
if(oSelf.offset>10){
oSelf.offset-=9;
jump=10;
}else{
jump=oSelf.offset-1;
oSelf.offset=0;
}
oSelf.fetch(10,true);
}
}
MediaSlider.prototype.shrinkAll=function(oEvent,oSelf){
}
MediaSlider.prototype.growImg=function(oEvent,oSelf){
var oImg;
if(oEvent.target)oImg=oEvent.target;
else if(oEvent.srcElement)oImg=oEvent.srcElement;
if(oImg.nodeType==3)
oImg=oImg.parentNode;
var oTD=oImg.parentNode;
oSelf.resizeImg(oTD,oSelf,80);
var n=oTD.nextSibling;
var s=70;
while(n&&s>=50){
oSelf.resizeImg(n,oSelf,s);
s-=10;
n=n.nextSibling;
}
n=oTD.previousSibling;
s=70;
while(n&&s>=50){
oSelf.resizeImg(n,oSelf,s);
s-=10;
n=n.previousSibling;
}
var xx=document.getElementById("interface"+oSelf.pId);
var tdPos=oTD.offsetLeft-xx.scrollLeft;
if(tdPos<100)
oSelf.moveRight(oEvent,oSelf,2);
else if(tdPos>200)
oSelf.moveLeft(oEvent,oSelf,2);
}
MediaSlider.prototype.resizeImg=function(oTD,oSelf,s){
if(oTD&&oTD.tagName=='TD'&&oTD.childNodes&&oTD.childNodes[0]){
var oImg=oTD.childNodes[0];
var iw=oImg.width;
var ih=oImg.height;
var r=ih/iw;
oImg.width=s;
oImg.height=s*r;
}
}
function makevisible(cur,which){
strength=(which==0)?1:0.2
if(cur.style.MozOpacity)
cur.style.MozOpacity=strength;
else if(cur.filters)
cur.filters.alpha.opacity=strength*100;
}
function tabberObj(argsObj)
{
var arg;
this.div=null;
this.classMain="tabber";
this.classMainLive="tabberlive";
this.classTab="tabbertab";
this.classTabDefault="tabbertabdefault";
this.classNav="tabbernav";
this.classTabHide="tabbertabhide";
this.classNavActive="tabberactive";
this.titleElements=['h2','h3','h4','h5','h6'];
this.titleElementsStripHTML=true;
this.removeTitle=true;
this.addLinkId=false;
this.linkIdFormat='<tabberid>nav<tabnumberone>';
for(arg in argsObj){
this[arg]=argsObj[arg];
}
this.REclassMain=new RegExp('\\b'+this.classMain+'\\b','gi');
this.REclassMainLive=new RegExp('\\b'+this.classMainLive+'\\b','gi');
this.REclassTab=new RegExp('\\b'+this.classTab+'\\b','gi');
this.REclassTabDefault=new RegExp('\\b'+this.classTabDefault+'\\b','gi');
this.REclassTabHide=new RegExp('\\b'+this.classTabHide+'\\b','gi');
this.tabs=new Array();
if(this.div){
this.init(this.div);
this.div=null;
}
}
tabberObj.prototype.init=function(e)
{
var childNodes,i,i2,t,defaultTab=0,DOM_ul,DOM_li,DOM_a,aId,headingElement;
if(!document.getElementsByTagName){
return false;
}
if(e.id){
this.id=e.id;
}
this.tabs.length=0;
childNodes=e.childNodes;
for(i=0;i<childNodes.length;i++){
if(childNodes[i].className&&
childNodes[i].className.match(this.REclassTab)){
t=new Object();
t.div=childNodes[i];
this.tabs[this.tabs.length]=t;
if(childNodes[i].className.match(this.REclassTabDefault)){
defaultTab=this.tabs.length-1;
}
}
}
DOM_ul=document.createElement("ul");
DOM_ul.className=this.classNav;
for(i=0;i<this.tabs.length;i++){
t=this.tabs[i];
t.headingText=t.div.title;
if(this.removeTitle){
t.div.title='';
}
if(!t.headingText){
for(i2=0;i2<this.titleElements.length;i2++){
headingElement=t.div.getElementsByTagName(this.titleElements[i2])[0];
if(headingElement){
t.headingText=headingElement.innerHTML;
if(this.titleElementsStripHTML){
t.headingText.replace(/<br>/gi," ");
t.headingText=t.headingText.replace(/<[^>]+>/g,"");
}
break;
}
}
}
if(!t.headingText){
t.headingText=i+1;
}
DOM_li=document.createElement("li");
t.li=DOM_li;
DOM_a=document.createElement("a");
DOM_a.appendChild(document.createTextNode(t.headingText));
DOM_a.href="javascript:void(null);";
DOM_a.title=t.headingText;
DOM_a.onclick=this.navClick;
DOM_a.tabber=this;
DOM_a.tabberIndex=i;
if(this.addLinkId&&this.linkIdFormat){
aId=this.linkIdFormat;
aId=aId.replace(/<tabberid>/gi,this.id);
aId=aId.replace(/<tabnumberzero>/gi,i);
aId=aId.replace(/<tabnumberone>/gi,i+1);
aId=aId.replace(/<tabtitle>/gi,t.headingText.replace(/[^a-zA-Z0-9\-]/gi,''));
DOM_a.id=aId;
}
DOM_li.appendChild(DOM_a);
DOM_ul.appendChild(DOM_li);
}
e.insertBefore(DOM_ul,e.firstChild);
e.className=e.className.replace(this.REclassMain,this.classMainLive);
this.tabShow(defaultTab);
if(typeof this.onLoad=='function'){
this.onLoad({tabber:this});
}
return this;
};
tabberObj.prototype.navClick=function(event)
{
var rVal,a,self,tabberIndex,onClickArgs;
a=this;
if(!a.tabber){
return false;
}
self=a.tabber;
tabberIndex=a.tabberIndex;
if(self.cb[tabberIndex]&&typeof self.cb[tabberIndex]=='function'){
self.cb[tabberIndex]();
}
a.blur();
if(typeof self.onClick=='function'){
onClickArgs={'tabber':self,'index':tabberIndex,'event':event};
if(!event){
onClickArgs.event=window.event;
}
rVal=self.onClick(onClickArgs);
if(rVal===false){
return false;
}
}
self.tabShow(tabberIndex);
return false;
};
tabberObj.prototype.tabHideAll=function()
{
var i;
for(i=0;i<this.tabs.length;i++){
this.tabHide(i);
}
};
tabberObj.prototype.tabHide=function(tabberIndex)
{
var div;
if(!this.tabs[tabberIndex]){
return false;
}
div=this.tabs[tabberIndex].div;
if(!div.className.match(this.REclassTabHide)){
div.className+=' '+this.classTabHide;
}
this.navClearActive(tabberIndex);
return this;
};
tabberObj.prototype.tabShow=function(tabberIndex)
{
var div;
if(!this.tabs[tabberIndex]){
return false;
}
this.tabHideAll();
div=this.tabs[tabberIndex].div;
div.className=div.className.replace(this.REclassTabHide,'');
this.navSetActive(tabberIndex);
if(typeof this.onTabDisplay=='function'){
this.onTabDisplay({'tabber':this,'index':tabberIndex});
}
return this;
};
tabberObj.prototype.navSetActive=function(tabberIndex)
{
this.tabs[tabberIndex].li.className=this.classNavActive;
return this;
};
tabberObj.prototype.navClearActive=function(tabberIndex)
{
this.tabs[tabberIndex].li.className='';
return this;
};
function initTabs(divId){
if(!divId){divId="tabberdiv";}
var tempObj,divs,i;
var tabberArgs={};
tempObj=new tabberObj(tabberArgs);
divs=document.getElementById(divId).getElementsByTagName("div");
for(i=0;i<divs.length;i++){
if(divs[i].className&&divs[i].className.match(tempObj.REclassMain)){
tabberArgs.div=divs[i];
ttabs=divs[i].getElementsByTagName("div");
tabberArgs.cb={}
tt=0;
for(t=0;t<ttabs.length;t++){
if(ttabs[t].className&&ttabs[t].className.match(tempObj.REclassTab)){
if(ttabs[t].onclick){
tabberArgs.cb[tt]=ttabs[t].onclick;
}
tt++;
}
}
divs[i].tabber=new tabberObj(tabberArgs);
}
}
}
function imgSwtchOn(e,d){
e.src=d;
}
function updateTags(element,value,checked){
var e=mb._get(element);
var v=e.value;
if(checked){
if(v.search(value)==-1){
e.value=e.value+" "+value;
}
}else{
if(v.search(value)!=-1){
e.value=v.replace(value,"");
}
}
}
var enabletip=false;
function ddrivetip(thetext,thecolor,thewidth){
var tipobj=document.getElementById("tagtooltip");
if(tipobj){
try{
if(typeof thewidth!="undefined")tipobj.style.width=thewidth+"px";
if(typeof thecolor!="undefined"&&thecolor!="")tipobj.style.backgroundColor=thecolor;
tipobj.innerHTML=thetext;
enabletip=true;
}catch(e){}
}
return false;
}
function positiontip(e){
if(enabletip){
return showComponent(e,"tagtooltip");
}
return false;
}
function hideddrivetip(){
var tipobj=document.getElementById("tagtooltip");
if(tipobj){
try{
enabletip=false;
tipobj.style.visibility="hidden";
tipobj.style.left="-1000px";
tipobj.style.backgroundColor='';
tipobj.style.width='';
}catch(e){}
}
}
Minglebox.addListener(document,"mousemove",positiontip,null);
var fuo__=new Array();
AjaxFileUpload=function(oFileForm,fuCallback,oProgressDiv,oProgressText,oProgressContent){
var id=fuo__.length;
fuo__.push(this);
this.fileForm=oFileForm;
var i=document.createElement("input");
i.type='hidden';
i.name='ajaxUploadObjectId';
i.value=id;
oFileForm.appendChild(i);
this.fuCallback=fuCallback;
this.progressDiv=document.getElementById(oProgressDiv?oProgressDiv:'progressBar');
this.progressText=document.getElementById(oProgressText?oProgressText:"progressBarText");
this.progressContent=document.getElementById(oProgressContent?oProgressContent:'progressBarBoxContent');
if(!this.progressDiv){
this.progressDiv=document.getElementById('progressBar');
this.progressText=document.getElementById("progressBarText");
this.progressContent=document.getElementById('progressBarBoxContent');
}
this.req=null;
this.oSelf=this;
theAjaxUploadObject=this;
}
AjaxFileUpload.prototype.id=null;
AjaxFileUpload.prototype.fileForm=null;
AjaxFileUpload.prototype.fuCallback=null;
AjaxFileUpload.prototype.progressDiv=null;
AjaxFileUpload.prototype.req=null;
AjaxFileUpload.prototype.oSelf=null;
AjaxFileUpload.prototype.processed=false;
AjaxFileUpload.prototype={
start:function(){
},processResponse:function(){
}
}
AjaxFileUpload.prototype.start=function(){
this.processed=false;
if(this.fuCallback!=null)
this.fuCallback("start");
this.fileForm.submit();
this.progressDiv.style.display='block';
this.progressText.innerHTML='0%';
var self=this;
setTimeout(function(){self.checkProgress();},50);
}
AjaxFileUpload.prototype.checkProgress=function(){
var self=this;
Minglebox.Request.process(null,null,function(a,b){
self.statusCallback(a,b)},null,addContextPath("/status.jsp?dummy="+new Date().getTime()),null,null);
}
AjaxFileUpload.prototype.statusCallback=function(userData,result){
var progressPercent=result&&result.results&&result.results[0]&&result.results[0][0]?result.results[0][0].value:0;
this.progressText.innerHTML=progressPercent+"%";
this.progressContent.style.width=progressPercent+'%';
if(progressPercent<100){
a=this;
setTimeout(function(){a.checkProgress();},1000);
}else{
if(this.progressDiv)
this.progressDiv.style.display='none';
if(!this.processed)
this.fuCallback("complete",null);
}
if(document.getElementById("pUpPb")){
var p=document.getElementById('pUpPb')
p.style.display="block";
}
}
AjaxFileUpload.prototype.processResponse=function(xmlString){
var xml=null;
if(window.ActiveXObject)
{
xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.loadXML(xmlString);
}
else if(window.XMLHttpRequest)
{
var dp=new DOMParser();
xml=dp.parseFromString(xmlString,"text/xml");
}
var r={};
try{
r.status="success";
Minglebox.Request.processXml(xml,r);
}catch(e){
}
this.processed=true;
this.fuCallback("end",r);
}
function handleResponse(fuid,xmlString){
fuo__[fuid].processResponse(xmlString);
}
function strtrim(str){
str=this!=window?this:str;
return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}
function constructRedirectUrl(forwardUrl){
return window.location.protocol+"//"+window.location.host+strtrim(unescape(forwardUrl));
}
function LTrim(value){
var re=/\s*((\S+\s*)*)/;
return value.replace(re,"$1");
}
function RTrim(value){
var re=/((\s*\S+)*)\s*/;
return value.replace(re,"$1");
}
function trim(value){
return LTrim(RTrim(value));
}
var mbNavtabs={
subcontainers:[],last_accessed_tab:null,selected_tab:null,
showMenu:function(oSelf,curtabref){
if(oSelf.last_accessed_tab!=null)
oSelf.last_accessed_tab.className="";
if(curtabref!=null)
curtabref.className="current";
oSelf.last_accessed_tab=curtabref;
oSelf.revealsubmenu(oSelf,curtabref);
},
revealsubmenu:function(oSelf,curtabref){
oSelf.hideallsubs(oSelf);
if(curtabref!=null&&curtabref.getAttribute("id")&&document.getElementById(curtabref.getAttribute("id")+'Sub'))
document.getElementById(curtabref.getAttribute("id")+'Sub').style.display="block";
},
hideallsubs:function(oSelf){
for(var i=0;i<oSelf.subcontainers.length;i++){
if(document.getElementById(oSelf.subcontainers[i]))
document.getElementById(oSelf.subcontainers[i]).style.display="none"
}
},
init:function(containerId,menuId,selectedIndex){
var oSelf=this;
var tId;
var tabItems=document.getElementById(menuId).getElementsByTagName("a")
for(var i=0;i<tabItems.length;i++){
if(tabItems[i].getAttribute("id")){
this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("id")+'Sub'
}
if(selectedIndex!=""){
if(i==selectedIndex||tabItems[i].getAttribute("id").indexOf(selectedIndex)==0){
this.selected_tab=tabItems[i];
tabItems[i].className="current"
this.showMenu(this,tabItems[i])
}
}
tabItems[i].onmouseover=function(event){
oSelf.showMenu(oSelf,this);
}
}
document.getElementById(containerId).onmouseover=function(event){
clearTimeout(oSelf.tId);
}
document.getElementById(containerId).onmouseout=function(event){
if(checkMouseLeave(this,event)){
oSelf.tId=setTimeout(function(){
oSelf.showMenu(oSelf,oSelf.selected_tab)
},2000);
}
}
}
}
function showMoreMenu(t){
document.getElementById(t.id+'Vert').style.display="block";
}
function hideMoreMenu(t,e){
document.getElementById(t.id).style.display="none";
}
function containsDOM(container,containee){
var isParent=false;
do{
if((isParent=container==containee))
break;
containee=containee.parentNode;
}
while(containee!=null);
return isParent;
}
function checkMouseLeave(element,evt){
if(document.all){
evt=window.event
}
if(element.contains&&evt.toElement){
return!element.contains(evt.toElement);
}else if(evt.relatedTarget){
return!containsDOM(element,evt.relatedTarget);
}
}
var RUZEE=window.RUZEE||{};
RUZEE.ShadedBorder={
create:function(opts){
var isie=/msie/i.test(navigator.userAgent)&&!window.opera;
function sty(el,h){
for(k in h){
if(/ie_/.test(k)){
if(isie)el.style[k.substr(3)]=h[k];
}else el.style[k]=h[k];
}
}
function crdiv(h){
var el=document.createElement("div");
el.className="sb-gen";
sty(el,h);
return el;
}
function op(v){
v=v<0?0:v;
v=v>0.99999?0.99999:v;
return isie?" filter:alpha(opacity="+(v*100)+");":" opacity:"+v+';';
}
var sr=opts.shadow||0;
var r=opts.corner||0;
var bor=0;
var bow=opts.border||0;
var shadow=sr!=0;
var lw=r>sr?r:sr;
var rw=lw;
var th=lw;
var bh=lw;
if(bow>0){
bor=r;
r=r-bow;
}
var cx=r!=0&&shadow?Math.round(lw/3):0;
var cy=cx;
var cs=Math.round(cx/2);
var iclass=r>0?"sb-inner":"sb-shadow";
var sclass="sb-shadow";
var bclass="sb-border";
var edges=opts.edges||"trlb";
if(!/t/i.test(edges))th=0;
if(!/b/i.test(edges))bh=0;
if(!/l/i.test(edges))lw=0;
if(!/r/i.test(edges))rw=0;
var p={position:"absolute",left:"0",top:"0",width:lw+"px",height:th+"px",
ie_fontSize:"1px",overflow:"hidden",margin:"0",padding:"0"};var tl=crdiv(p);
delete p.left;p.right="0";p.width=rw+"px";var tr=crdiv(p);
delete p.top;p.bottom="0";p.height=bh+"px";var br=crdiv(p);
delete p.right;p.left="0";p.width=lw+"px";var bl=crdiv(p);
var tw=crdiv({position:"absolute",width:"100%",height:th+"px",ie_fontSize:"1px",
top:"0",left:"0",overflow:"hidden",margin:"0",padding:"0"});
var t=crdiv({position:"relative",height:th+"px",ie_fontSize:"1px",
margin:"0 "+rw+"px 0 "+lw+"px",overflow:"hidden",padding:"0"});
tw.appendChild(t);
var bw=crdiv({position:"absolute",left:"0",bottom:"0",width:"100%",height:bh+"px",
ie_fontSize:"1px",overflow:"hidden",margin:"0",padding:"0"});
var b=crdiv({position:"relative",height:bh+"px",ie_fontSize:"1px",
margin:"0 "+rw+"px 0 "+lw+"px",overflow:"hidden",padding:"0"});
bw.appendChild(b);
var mw=crdiv({position:"absolute",top:(-bh)+"px",left:"0",width:"100%",height:"100%",
overflow:"hidden",ie_fontSize:"1px",padding:"0",margin:"0"});
function corner(el,t,l){
var w=l?lw:rw;
var h=t?th:bh;
var s=t?cs:-cs;
var dsb=[];var dsi=[];var dss=[];
var xp=0;var xd=1;if(l){xp=w-1;xd=-1;}
for(var x=0;x<w;++x){
var yp=h-1;var yd=-1;if(t){yp=0;yd=1;}
var finished=false;
for(var y=h-1;y>=0&&!finished;--y){
var div='<div style="position:absolute; top:'+yp+'px; left:'+xp+'px; '+
'width:1px; height:1px; overflow:hidden; margin:0; padding:0;';
var xc=x-cx;var yc=y-cy-s;
var d=Math.sqrt(xc*xc+yc*yc);
var doShadow=false;
if(r>0){
if(xc<0&&yc<bor&&yc>=r||yc<0&&xc<bor&&xc>=r){
dsb.push(div+'" class="'+bclass+'"></div>');
}else
if(d<bor&&d>=r-1&&xc>=0&&yc>=0){
var dd=div;
if(d>=bor-1){
dd+=op(bor-d);
doShadow=true;
}
dsb.push(dd+'" class="'+bclass+'"></div>');
}
var dd=div+' z-index:2;'+(t?'background-position:0 -'+(r-yc-1)+'px;':'background-image:none;');
var finish=function(){
if(!t)dd=dd.replace(/top\:\d+px/,"top:0px");
dd=dd.replace(/height\:1px/,"height:"+(y+1)+"px");
dsi.push(dd+'" class="'+iclass+'"></div>');
finished=true;
};
if(xc<0&&yc<r||yc<0&&xc<r){
finish();
}else
if(d<r&&xc>=0&&yc>=0){
if(d>=r-1){
dd+=op(r-d);
doShadow=true;
dsi.push(dd+'" class="'+iclass+'"></div>');
}else{
finish();
}
}else doShadow=true;
}else doShadow=true;
if(sr>0&&doShadow){
d=Math.sqrt(x*x+y*y);
if(d<sr){
dss.push(div+' z-index:0; '+op(1-(d/sr))+'" class="'+sclass+'"></div>');
}
}
yp+=yd;
}
xp+=xd;
}
el.innerHTML=dss.concat(dsb.concat(dsi)).join('');
}
function mid(mw){
var ds=[];
ds.push('<div style="position:relative; top:'+(th+bh)+'px; height:2048px; '+
' margin:0 '+(rw-r-cx)+'px 0 '+(lw-r-cx)+'px; '+
' padding:0; overflow:hidden;'+
' background-position:0 '+(th>0?-(r+cy+cs):'0')+'px;"'+
' class="'+iclass+'"></div>');
var dd='<div style="position:absolute; width:1px;'+
' top:'+(th+bh)+'px; height:2048px; padding:0; margin:0;';
for(var x=0;x<lw-r-cx;++x){
ds.push(dd+' left:'+x+'px;'+op((x+1.0)/lw)+
'" class="'+sclass+'"></div>');
}
for(var x=0;x<rw-r-cx;++x){
ds.push(dd+' right:'+x+'px;'+op((x+1.0)/rw)+
'" class="'+sclass+'"></div>');
}
if(bow>0){
var su=' width:'+bow+'px;'+'" class="'+bclass+'"></div>';
ds.push(dd+' left:'+(lw-bor-cx)+'px;'+su);
ds.push(dd+' right:'+(rw-bor-cx)+'px;'+su);
}
mw.innerHTML=ds.join('');
}
function tb(el,t){
var ds=[];
var h=t?th:bh;
var dd='<div style="height:1px; overflow:hidden; position:absolute; margin:0; padding:0;'+
' width:100%; left:0px; ';
var s=t?cs:-cs;
for(var y=0;y<h-s-cy-r;++y){
ds.push(dd+(t?'top:':'bottom:')+y+'px;'+op((y+1)*1.0/h)+
'" class="'+sclass+'"></div>');
}
if(y>=bow){
ds.push(dd+(t?'top:':'bottom:')+(y-bow)+'px;'+
' height:'+bow+'px;" class="'+bclass+'"></div>');
}
ds.push(dd+(t?'background-position-y:0; top:':
'background-image:none; bottom:')+y+'px;'+
' height:'+(r+cy+s)+'px;" class="'+iclass+'"></div>');
el.innerHTML=ds.join('');
}
corner(tl,true,true);corner(tr,true,false);
corner(bl,false,true);corner(br,false,false);
mid(mw);tb(t,true);tb(b,false);
return{
render:function(el){
if(typeof el=='string')el=document.getElementById(el);
if(el.length!=undefined){
for(var i=0;i<el.length;++i)this.render(el[i]);
return;
}
el.className+=" sb";
sty(el,{position:"relative",background:"transparent"});
var node=el.firstChild;
while(node){
var nextNode=node.nextSibling;
if(node.nodeType==1&&node.className=='sb-gen')
el.removeChild(node);
node=nextNode;
}
var iel=el.firstChild;
var twc=tw.cloneNode(true);
var mwc=mw.cloneNode(true);
var bwc=bw.cloneNode(true);
el.insertBefore(tl.cloneNode(true),iel);el.insertBefore(tr.cloneNode(true),iel);
el.insertBefore(bl.cloneNode(true),iel);el.insertBefore(br.cloneNode(true),iel);
el.insertBefore(twc,iel);el.insertBefore(mwc,iel);
el.insertBefore(bwc,iel);
if(isie){
function resize(){
twc.style.width=bwc.style.width=mwc.style.width=el.offsetWidth+"px";
mwc.firstChild.style.height=el.offsetHeight+"px";
}
el.onresize=resize;
resize();
}
}
};
}
}
function initShadow(){
var myBox=new Array('lb1','lb2','rb1','rb2','rb3','rb4');
var myBorder=RUZEE.ShadedBorder.create({corner:10,shadow:20});
for(i=0;i<myBox.length;i++){
if(document.getElementById(myBox[i])){
myBorder.render(myBox[i]);
}
}
}


function MM_showHideLayers()
{
var i,p,v,obj,args=MM_showHideLayers.arguments;
for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null)
{
v=args[i+2];
if(obj.style)
{
obj=obj.style;
v=(v=='show')?'visible':(v=='hide')?'hidden':v;
}
obj.visibility=v;
}
}