﻿jQuery(document).ready(function() {
var h = document.getElementsByTagName('head').item(0);
var s= document.createElement("script");
s.type = "text/javascript";
s.src="http://static.stardoll.tom.com/js/chat/chat.js?1";
h.appendChild(s);
});

var sdJsLang = new Object;

sdJsLang.adding = '加入中...';
sdJsLang.btn_cancel = '取消';
sdJsLang.btn_close = ' 关闭';
sdJsLang.btn_continue = '继续';
sdJsLang.btn_no = '不想';
sdJsLang.btn_ok = '确定';
sdJsLang.btn_save = '储存';
sdJsLang.btn_send = '送出';
sdJsLang.btn_yes = '想';
sdJsLang.confirmation = '确认';
sdJsLang.deleting = '刪除中...';
sdJsLang.error = '错误';
sdJsLang.failed_delete = '删除失败...';
sdJsLang.forum_quote_said = '说:';
sdJsLang.im_accept_invite = '接受';
sdJsLang.im_bye = '再见！';
sdJsLang.im_canceled_invite_from = '哎喲，我現在其实还未能聊天';
sdJsLang.im_canceled_invite_from_button = 'Ok.';
sdJsLang.im_canceled_invite_from_text = '我得先走啦...答应你下次再聊！';
sdJsLang.im_decline_invite = '不接受';
sdJsLang.im_hold_on = '等一等......';
sdJsLang.im_invite_accept = '接受';
sdJsLang.im_invite_decline = '拒绝';
sdJsLang.im_invite_to_chat = '想跟你聊天';
sdJsLang.im_no_chatfriends = '沒有可以聊天的好友';
sdJsLang.im_no_friends = '沒有在线或空闲的好友';
sdJsLang.im_no_onlinefriends = '沒有在线的好友';
sdJsLang.im_oops = '屋主已离开了此聊天';
sdJsLang.im_save = '你想在离开此聊天之前储存你所做的变更吗？';
sdJsLang.im_sendfailed = '发送消息失败!';
sdJsLang.im_sorry = '对不起';
sdJsLang.im_suiteChat = '场景聊天';
sdJsLang.im_suiteChat_invite = '你还没有被邀请到该场景聊天';
sdJsLang.im_thank_you = '谢谢！';
sdJsLang.im_wanna_chat = '想聊天吗？';


// JavaScript Document
/** 
* @name RollBanner类
* @作者:杨雄南(yangxiongnan@tomonline-inc.com) 郭方舟(guofzh@tom.com)
* @功能描述:一个定时轮换的js轮播器
* @日期:2008-11-13
*/
//定时轮播类,构造函数
function RollBanner(){
this.index = 0;//当前播放广告索引
this.tmpZIndex = 0;
this.opa = 10;//每秒等差透明度
this.tmpOpa = 0;
this.relay = 6;//透明度达到100后,所等待的时间=this.relay*(setTimeout("RollBannerRun()",200);)
this.tmp_relay =this.relay;
this.banner = [];
this.visibleBanner = null;
this.MaxZIndex = 50;
this.preIndex = -1;
this.isPause = false;
this.bannerNav = null;
}
//添加图片方法 bannerID:放置图片的容器的ID
RollBanner.prototype.addBanner= function (bannerID){			
this.banner[this.banner.length] = {bannerID:bannerID};
}
//定时调用的函数
RollBanner.prototype.run = function(){
if(!this.visibleBanner){//首次运行，已有索引0显示，淡出效果开始索引为1
this.visibleBanner=document.getElementById(this.banner[this.index++].bannerID);
this.tmpOpa=100;
this.tmp_relay = 	this.relay;
}
if(this.tmpOpa!=100){//淡出效果				
this.tmpOpa+=this.opa
if(this.tmpOpa>100)this.tmpOpa=100;
if(navigator.userAgent.indexOf("Firefox")>0){//为ff浏览器 
this.visibleBanner.style.opacity=""+this.tmpOpa/100;//firefox使用											 
}else{
this.visibleBanner.style.filter="Alpha(opacity="+this.tmpOpa+")";//ie使用
}		 
}else if(this.tmpOpa==100&&this.tmp_relay!=0){
if(this.tmp_relay==this.relay&&!this.isPause){		  	
if(navigator.userAgent.indexOf("Firefox")>0){//为ff浏览器
if(this.preIndex!=-1)document.getElementById(this.banner[this.preIndex].bannerID).style.opacity="0";//firefox使用
this.preIndex=-1;
}else{
if(this.preIndex!=-1)document.getElementById(this.banner[this.preIndex].bannerID).style.filter="Alpha(opacity="+0+")";//ie使用
this.preIndex=-1;
}
if(this.index -1==-1)this.preIndex = this.banner.length-1;else this.preIndex = this.index -1;
}
if(!this.isPause)this.tmp_relay--;
}else if(this.tmpOpa==100&&this.tmp_relay==0){
this.tmpOpa =0;		  		  	
this.visibleBanner.style.zIndex=this.tmpZIndex;
this.turnActiveNav(this.index+1);
this.visibleBanner=document.getElementById(this.banner[this.index++].bannerID);		  			  	
this.visibleBanner.style.zIndex=this.MaxZIndex;
this.index=this.index%this.banner.length;//下一张	this.index索引 0...length-1	  	
this.tmp_relay = 	this.relay;
}
}

//停止播放
RollBanner.prototype.pause = function(){this.isPause = true;}

//继续播放
RollBanner.prototype.play = function(){this.isPause = false;}

//选择播放
RollBanner.prototype.selectRun = function(index){
this.turnActiveNav(index);
this.isPause = false;
this.index = index-1;
this.tmpOpa =80;		  		  	
this.visibleBanner.style.zIndex=this.tmpZIndex;
this.visibleBanner=document.getElementById(this.banner[this.index++].bannerID);		  			  	
this.visibleBanner.style.zIndex=this.MaxZIndex;
this.index=this.index%this.banner.length;//下一张	this.index索引 0...length-1	  	
this.tmp_relay = 	this.relay;
}

//继续播放
RollBanner.prototype.turnActiveNav = function(index){
if(!this.bannerNav)this.bannerNav = document.getElementById("slide_numbers");
this.bannerNav.className = "slide_number"+index;
}
//====================================================================================================
var indexRollBanner = new  RollBanner();				
function RollBannerRun(){
if(indexRollBanner.banner.length==0){
indexRollBanner.addBanner("stardoll_banner1");
indexRollBanner.addBanner("stardoll_banner2");
indexRollBanner.addBanner("stardoll_banner3");
indexRollBanner.addBanner("stardoll_banner4");
}
if(indexRollBanner.banner.length>0)indexRollBanner.run();
setTimeout("RollBannerRun()",200);
}
