//D-Gate Project Version 6.1.1
//Power by Tangyb

var _ServerPath = "http://www.d-gate.jp/WebDGate/dog";
var _ServerPath2 = "http://www.d-gate.jp/mou/dog/";
//var _ServerPath = "http://192.168.1.13/dog";
//var _ServerPath = "http://127.0.0.1/CharaStuff/dog-test/";
var _SystemFolder = "panda";
var _Start = 0;
var winWidth = 0;
var winHeight = 0;
var MascotNum = 1;
var Mascot = new Array(MascotNum);
var _Mascot = new Array(MascotNum);
var MascotT,MascotB,MascotL,MascotR;
var winT,winB,winL,winR;
var screenT,screenB,screenL,screenR;
var st = new Array(MascotNum);
var ft = new Array(MascotNum);
var the_timeout1;
var currentMoveObj = null;
var relLeft;
var relTop;

function LoadFlash(MascotID,Nid,Url,Width,Height){
MascotID.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+Width+"' height='"+Height+"' id='myflash"+Nid+"'><param name='movie' value='"+_ServerPath+"/"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always'><embed src='"+_ServerPath+"/"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"' name='myflash"+Nid+"' wmode='transparent' allowScriptAccess='always'></embed></object>";
}

function AutoConfig(ID) { 
_Mascot[ID].left = String(10)+"px";
_Mascot[ID].top = String(-140)+"px";
}

function Config(ID,L,T) { 
_Mascot[ID].left = L+"px";
_Mascot[ID].top = T+"px";
}

function callok() {
alert("ok~!");
}

function callExternalInterface(ID) {
var _temp = String("myflash"+ID);
thisMovie(_temp).goflash();
}

function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
}else {
return document[movieName];}
}

function startrandom(){
LoadFlash(Mascot[0],0,'mauto.swf',160,160);
return callExternalInterface(0);
}

function LoadAction() {
var getbody = document.getElementsByTagName("body")[0];
getbody.style.overflow="visible";
getbody.bgcolor="#FF0000";
getbody.scroll="no";
Settings();
document.cookie="uid=20090301";

for(i=0;i<MascotNum;i++){
var divobj = "Mascot"+i;
Mascot[i] = document.getElementById(divobj);	
_Mascot[i] = document.getElementById(divobj).style;
AutoConfig(i);
LoadFlash(Mascot[i],i,'mgate.swf',160,160);
drag(Mascot[i]);
//the_timeout2= setTimeout('callExternalInterface('+i+');',2000);
}
drag(document.getElementById('showbox'));

//ChatBox('CustomerSide.swf',360,650);
ChatBox(_ServerPath2+'CustomerSide.swf',360,650);
//Flashshow('http://127.0.0.1/CharaStuff/dog-test/CustomerSide.swf')
}

function starting(){
_Start++;
if(_Start==1){
for(i=0;i<MascotNum;i++){
the_timeout2= setTimeout('callExternalInterface('+i+');',1000);
//callExternalInterface(i);
}}
}

function Move(ID,Direct,Speed,Stoped) {
var MascotID=_Mascot[ID];
var Re="Move("+ID+","+Direct+","+Speed+","+Stoped+")";
if(Direct==1){
MascotID.left=String(parseInt(MascotID.left)-Speed)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.left)<Stoped){
clearTimeout(the_timeout1);
return callExternalInterface(ID)}}
if(Direct==2){
MascotID.left=String(parseInt(MascotID.left)+Speed)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.left)>Stoped){
clearTimeout(the_timeout1);
return callExternalInterface(ID)}}
}

function MascotLoad(ID,Left,Stoped) {
_Mascot[ID].left = String(Left)+"px";
_Mascot[ID].top = String(winHeight-140)+"px";
return ChangeAct(ID,Stoped);
}

function ChangeAct(ID,Stoped) {
st[ID]++;
the_timeout1= setTimeout('ChangeAct('+ID+','+Stoped+')',50);
if (st[ID]>Stoped){
st[ID] = 0;
clearTimeout(the_timeout1);
return callExternalInterface(ID);
}
}

function Climb(ID,Direct,Speed,Stoped) {
var MascotID=_Mascot[ID];
var Re="Climb("+ID+","+Direct+","+Speed+","+Stoped+")";	
if(Direct==1){
MascotID.top=String(parseInt(MascotID.top)-Speed)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.top)<=Stoped){
clearTimeout(the_timeout1);
return callExternalInterface(ID)}}
if(Direct==2){
MascotID.top=String(parseInt(MascotID.top)+Speed)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.top)>=Stoped){
clearTimeout(the_timeout1);
return callExternalInterface(ID)}}
}

function Jump(ID,Direct,Speed,Hight) {
var MascotID=_Mascot[ID];
var Re="Jump("+ID+","+Direct+","+Speed+","+Hight+")";	
if(Direct==1){
st[ID]=st[ID]+10;
if(st[ID]>=Hight){
MascotID.left=String(parseInt(MascotID.left)-Speed)+"px";
MascotID.top=String(parseInt(MascotID.top)+10)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.top)>=winB){
clearTimeout(the_timeout1);
st[ID]=0;
return callExternalInterface(ID)}}
else{
MascotID.left=String(parseInt(MascotID.left)-Speed)+"px";
MascotID.top=String(parseInt(MascotID.top)-10)+"px";
the_timeout1=setTimeout(Re,50);
}}

if(Direct==2){
st[ID]=st[ID]+10;
if(st[ID]>=Hight){
MascotID.left=String(parseInt(MascotID.left)+Speed)+"px";
MascotID.top=String(parseInt(MascotID.top)+10)+"px";
the_timeout1=setTimeout(Re,50);
if(parseInt(MascotID.top)>=winB){
clearTimeout(the_timeout1);
st[ID]=0;
return callExternalInterface(ID)}}
else{
MascotID.left=String(parseInt(MascotID.left)+Speed)+"px";
MascotID.top=String(parseInt(MascotID.top)-10)+"px";
the_timeout1=setTimeout(Re,50);
}}
}

function Speak(ID,Msg,rst){
var MascotID=_Mascot[ID];
var msgtext = document.getElementById("showmsg");
msgtext.style.left = String(parseInt(MascotID.left)+70)+"px";
msgtext.style.top = String(parseInt(MascotID.top)-20)+"px";
msgtext.style.visibility = "visible";
var fontColor = 'black';
msgtext.innerHTML = "<table width='202' border='0' cellspacing='0' cellpadding='0' style='font-size:12px;color:#000000'><tr><td width='200' height='69' align='center' valign='middle'><font color="+fontColor+">"+Msg+"</font></td></tr></table>";
var st = rst*400;
thisMovie("myflash0").stopat();
SetAct('talk_f_loop');
//the_timeout0=setTimeout("ClsSpeak("+ID+");",parseInt(st));
the_timeout0=setTimeout("ClsSpeak("+ID+");",5000);
}

function Imgshow(Url){	

var imgbox1 = document.getElementById("imgbox");
imgbox1.style.left ="650px";
imgbox1.style.top = "350px";
imgbox1.style.visibility = "visible";

imgbox1.innerHTML = "<img src='"+Url+"'/>";
//var st = 1*400;
//thisMovie("myflash0").stopat();
//SetAct('talk_f_loop');
//
//the_timeout0=setTimeout("ClsSpeak("+ID+");",5000);
}

function Flashshow(Url){	

var flashbox1 = document.getElementById("flashbox");
flashbox1.style.left ="650px";
flashbox1.style.top = "350px";
flashbox1.style.visibility = "visible";
flashbox1.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' id='flashbox1'><param name='movie' value='"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always'><embed src='"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' name='flashbox2' wmode='transparent' allowScriptAccess='always'></embed></object>";

//var st = 1*400;
//thisMovie("myflash0").stopat();
//SetAct('talk_f_loop');
//
//the_timeout0=setTimeout("ClsSpeak("+ID+");",5000);
}


function ClsSpeak(ID){
var msgtext = document.getElementById("showmsg").style;
msgtext.visibility = "hidden";
return callExternalInterface(ID);
}

function CallOther(ID,CALLID){
callExternalInterface(CALLID);	
return callExternalInterface(ID);
}

function Stop(ID){
return AutoConfig(ID);
}

function SetAct(Act){
//alert(Act+"_okk");
var _temp = String("myflash"+0);
thisMovie(_temp).playface(Act+".swf");
}

function AutoPlay(){
var _temp = String("myflash"+0);
thisMovie(_temp).mauto();
}

function playact(){
var ttyy = ['curve.swf','food.swf'];
var _temp = String("myflash"+0);
thisMovie(_temp).playact(ttyy,0);
}

/*function SetActPre(ID,Act,Stoped){
LoadFlash(Mascot[0],0,'swf/dog/'+Act,160,160);
the_timeout0=setTimeout("ClsSet("+ID+");",Stoped*100);
}*/

function ClsSet(){
clearTimeout(the_timeout1);
//LoadFlash(Mascot[ID],ID,"swf/dog/dog_menu.swf",160,160);
}

function MsgBox(ID,Msg,Yes,No,YesH){
var MascotID=_Mascot[ID];
var msgtext = document.getElementById("showmsg");
msgtext.style.left = String(parseInt(MascotID.left)+70)+"px";
msgtext.style.top = String(parseInt(MascotID.top)-20)+"px";
msgtext.style.visibility = "visible";
var fontColor = 'red';
msgtext.innerHTML = "<table width='100%' border='0' cellspacing='0' cellpadding='0' style='font-size:12px;color:#000000'><tr><td colspan='3' height='41' align='center'>"+Msg+"</td></tr><tr><td align='right'><b><span style='font-weight: bold; text-decoration:underline; cursor:pointer' onClick='"+YesH+";'>"+Yes+"</span></b></td><td align='center'>&nbsp;</td><td align='center'><b><span style='font-weight: bold; text-decoration:underline; cursor:pointer' onClick='ClsSpeak("+ID+");'>"+No+"</span></b></td></tr></table>";
//the_timeout0=setTimeout("ClsSpeak("+ID+");",3000);
}

function ChatBox(Url,Width,Height){
	var flashbox1 = document.getElementById("chatbox");
flashbox1.style.left ="0px";

flashbox1.style.visibility = "visible";
if(document.all) {
	flashbox1.style.top =(winHeight-Height+350)+"px";
	flashbox1.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' id='flashbox1' style='width:320px; height:300px;'><param name='movie' value='"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always'><embed id='id_self_1' src='"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'  name='flashbox2' wmode='transparent' allowScriptAccess='always'></embed></object>";	
} else {
	flashbox1.style.top =(winHeight-Height+350)+"px";
	flashbox1.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' id='flashbox1'><param name='movie' value='"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always'><embed id='id_self_1' src='"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='320' height='300' name='flashbox2' wmode='transparent' allowScriptAccess='always'></embed></object>";	
}


/*var pl = document.getElementById("chatbox");
pl.style.left = "0px";
//pl.style.top = (winHeight-Height)+"px";
pl.style.top = winHeight+"px";
//alert(pl.style.left);
pl.style.visibility = "visible";
pl.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+Width+"' height='"+Height+"' id='showbox'><param name='movie' value='"+_ServerPath2+"/"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='window' /><param name='allowScriptAccess' value='always' /><embed src='"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"' wmode='window' allowScriptAccess='always'></embed></object>";
//return BoxEffect("chatbox",1,24,1);*/
}

function BoxEffect(id,type,Height,spd){
if(type==1){
var pl = document.getElementById(id);
if(parseInt(pl.style.top)+Height>winHeight){
pl.style.top = String(parseInt(pl.style.top)-spd)+"px";
//pl.style.top = (winHeight-Height)+"px";
return setTimeout("BoxEffect('"+id+"',1,"+Height+","+spd+");",20);
}}
if(type==2){
var pl = document.getElementById(id);
if(parseInt(pl.style.top)<=winHeight){
pl.style.top = String(parseInt(pl.style.top)+spd)+"px";
//pl.style.top = (winHeight-Height)+"px";
return setTimeout("BoxEffect('"+id+"',2,"+Height+","+spd+");",20);
}else{
var pl = document.getElementById("dia");
pl.style.visibility = "hidden";
}}
}

function ShowDia(s){
//alert(s);
var pl = document.getElementById("dia");
pl.style.left = "0px";
pl.style.top = winHeight+"px";
pl.style.visibility = "visible";
pl.innerHTML = s;
return BoxEffect("dia",1,226,3);
}

function AddDia(s){
var pl = document.getElementById("dia");
pl.innerHTML = s;
}

function HideDia(){
//alert("hide ok");
return BoxEffect("dia",2,226,3);
}

function ShowBox2(ID,Type,Url,Width,Height,st){
var MascotID=_Mascot[ID];
var innertype;//Type,Url,Link
var pl = document.getElementById("showbox");
pl.style.left = String(parseInt(MascotID.left)-Width/4)+"px";
pl.style.top = String(parseInt(MascotID.top)-Height-40)+"px";
pl.style.visibility = "visible";
switch(Type){
case "image":
innertype = "<img src='"+Url+"' width='"+Width+"' height='"+Height+"' />";
break;
case "web":
innertype = "<iframe width='"+Width+"' height='"+Height+"' src='"+Url+"'></iframe>";
break;
case "flash":
innertype = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+Width+"' height='"+Height+"' id='showbox'><param name='movie' value='"+Url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always' /><embed src='"+Url+"' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"' wmode='transparent' allowScriptAccess='always'></embed></object>";
break;
}

pl.innerHTML = "<table border='0' cellspacing='0' cellpadding='0'><tr><td width='30'><img src='messagebox/tl.gif' width='30' height='22' /></td><td width='"+(Width-43)+"' background='messagebox/t.gif'>&nbsp;</td><td width='30'><img src='messagebox/tr.gif' width='30' height='22' /></td></tr><tr><td colspan='3'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='9' background='messagebox/l.gif'>&nbsp;</td><td height='"+Height+"' align='center' background='messagebox/c.gif'>"+innertype+"</td><td width='8' background='messagebox/r.gif'>&nbsp;</td></tr></table></td></tr><tr><td width='30'><img src='messagebox/bl.gif' width='30' height='67' /></td><td align='center' background='messagebox/bg.gif'><img src='messagebox/b.gif' width='80' height='67' /></td><td width='30'><img src='messagebox/br.gif' width='30' height='67' /></td></tr></table>";
var _st;
if(!st){
_st=5;
}else{
_st=st;
}
the_timeout0=setTimeout("ClsShowBox();",parseInt(_st*1000));
}

function ClsShowBox(){
	
var msgtext = document.getElementById("showbox").style;
msgtext.visibility = "hidden";
}

function HideBox(){
/*var pl = document.getElementById("chatbox");
pl.style.visibility = "hidden";
pl.innerHTML = "";*/
var pl2 = document.getElementById("dia");
pl2.style.visibility = "hidden";
pl2.innerHTML = "";
BoxEffect("chatbox",200,240,1)
//return callExternalInterface(1);
}

function drag(o){
 o.onmousedown=function(a){
  if((window.event||a).button==2){
  var d=document;if(!a)a=window.event;
  var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
  if(o.setCapture)
   o.setCapture();
  else if(window.captureEvents)
   window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);

  d.onmousemove=function(a){
   if(!a)a=window.event;
   if(!a.pageX)a.pageX=a.clientX;
   if(!a.pageY)a.pageY=a.clientY;
   var tx=a.pageX-x,ty=a.pageY-y;
   o.style.left=tx;
   o.style.top=ty;
  };

  d.onmouseup=function(){
   if(o.releaseCapture)
o.releaseCapture();
   else if(window.captureEvents)
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
   d.onmousemove=null;
   d.onmouseup=null;
  };
 };
 };
}

function getCookie(){
var getCk=document.cookie.split("; ");

for(var i=0;i<getCk.length;i++){ 
var arr=getCk[i].split("=");
if("uid"==arr[0]){ 
return arr[1]; 
break; 
} 
}
}

function CreateDiv() {	
for(i=0;i<MascotNum;i++){
document.write("<div id='Mascot"+i+"' style='position:absolute; width:160px; height:160px; left:0px; top:0px; z-index:2; visibility:visible; border: 1px none #000000;' onselectstart='return false'></div>");}
document.write("<div id='showbox' style='position:absolute; width:400px; height:300px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000;'></div>");
document.write("<div id='preload' style='position:absolute; width:400px; height:300px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000;'></div>");
document.write("<div id='chatbox' style='position:absolute;  width:320px;height:300px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000;'></div>");

document.write("<div id='imgbox' style='position:absolute; width:360px; height:200px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000;'></div>");
document.write("<div id='flashbox' style='position:absolute; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000;'></div>");

document.write("<div id='dia' style='position:absolute; background:#6699FF; width:318px; height:200px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px none #000000; border-style:solid; border-width:1px; overflow:auto; filter:alpha(opacity=60);'></div>");
document.write("<div id='showmsg' style='position:absolute; width:202px; height:69px; left:0px; top:0px; z-index:2; visibility:hidden; border: 1px #000000; background-image: url("+_ServerPath+"/"+"swf/sbg.gif);'></div>");
}

function Settings() {
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;

if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;            

if (document.documentElement  && document.documentElement.clientHeight && 
document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}

for(i=0;i<MascotNum;i++){
st[i]=0;
ft[i]=0;}

MascotT = -40;
MascotL = -40;
MascotR = winWidth-120;
MascotB = winHeight-140;

screenT = -160;
screenL = -160;
screenR = winWidth;
screenB = winHeight;

winT = -40;
winL = -60;
winR = winWidth-100;
winB = winHeight-140;
}

function sc5(){
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;

if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;            

if (document.documentElement  && document.documentElement.clientHeight && 
document.documentElement.clientWidth)
{
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}

MascotR = winWidth-120;
MascotB = winHeight-140;
screenR = winWidth;
screenB = winHeight;
winR = winWidth-100;
winB = winHeight-140;

var pl = document.getElementById("chatbox");
//pl.style.top = "0px";
pl.style.top =(winHeight-650+310)+"px";

for(i=0;i<MascotNum;i++)
_Mascot[i].top = String(winHeight-140)+"px";
}

window.onresize=sc5;
window.onload=LoadAction;CreateDiv();

jQuery.fn.floatdiv=function(location){
	//ie6要隐藏纵向滚动条
	var isIE6=false;
	if($.browser.msie && $.browser.version=="6.0"){
		$("html").css("overflow-x","auto").css("overflow-y","hidden");
		isIE6=true;
	};
	$("body").css({margin:"0px",
		border:"0px",
		height:"100%",
		overflow:"auto"
	});
	return this.each(function(){
		var loc;//层的绝对定位位置
		if(location==undefined || location.constructor == String){
			switch(location){
				case("rightbottom")://右下角
					loc={right:"0px",bottom:"0px"};
					break;
				case("leftbottom")://左下角
					loc={left:"0px",bottom:"0px"};
					break;	
				case("lefttop")://左上角
					loc={left:"0px",top:"0px"};
					break;
				case("righttop")://右上角
					loc={right:"0px",top:"0px"};
					break;
				case("middle")://居中
					var l=0;//居左
					var t=0;//居上
					var windowWidth,windowHeight;//窗口的高和宽
					//取得窗口的高和宽
					if (self.innerHeight) {
						windowWidth=self.innerWidth;
						windowHeight=self.innerHeight;
					}else if (document.documentElement&&document.documentElement.clientHeight) {
						windowWidth=document.documentElement.clientWidth;
						windowHeight=document.documentElement.clientHeight;
					} else if (document.body) {
						windowWidth=document.body.clientWidth;
						windowHeight=document.body.clientHeight;
					}
					l=windowWidth/2-$(this).width()/2;
					t=windowHeight/2-$(this).height()/2;
					loc={left:l+"px",top:t+"px"};
					break;
				default://默认为右下角
					loc={right:"0px",bottom:"0px"};
					break;
			}
		}else{
			loc=location;
		}
		$(this).css("z-index","9999").css(loc).css("position","fixed");
		if(isIE6){
			if(loc.right!=undefined){
				//2008-4-1修改：当自定义right位置时无效，这里加上一个判断
				//有值时就不设置，无值时要加18px已修正层位置
				if($(this).css("right")==null || $(this).css("right")==""){
					$(this).css("right","18px");
				} else {
					$(this).css("right","28px");
				}
			}
			$(this).css("position","absolute");
		}
	});
};
$(function() {
	$("#chatbox").floatdiv("leftbottom");
});
