
var _fc_cDOMtype = '';
if (document.getElementById)
{
	_fc_cDOMtype = "std";
}
else if (document.all)
{
	_fc_cDOMtype = "ie4";
}
else if (document.layers)
{
	_fc_cDOMtype = "ns4";
}

//随滚动条滚动
var fc_INIT_TOP = 0;
var fc_INIT_LEFT = 0;

function fc_scrollImg(){ 
    var posX,posY; 
    if (window.innerHeight) { 
        //posX = window.pageXOffset; 
        posY = window.pageYOffset; 
    } 
    else if (document.documentElement && document.documentElement.scrollTop) { 
       // posX = document.documentElement.scrollLeft; 
        posY = document.documentElement.scrollTop; 
    } 
    else if (document.body) { 
        //posX = document.body.scrollLeft; 
        posY = document.body.scrollTop; 
    } 
    var ad=document.getElementById("_callfloat"); 
    ad.style.top=(posY+fc_INIT_TOP)+"px"; 
    //ad.style.left=(posX+50)+"px"; 
    setTimeout("fc_scrollImg()",100); 
} 

//漂浮
var fc_yPos = 0; 
var fc_step = 1;
var fc_delay = 30; 
var fc_height = 0;
var fc_Hoffset = 0;
var fc_Woffset = 0;
var fc_yon = 0;
var fc_xon = 0;
var fc_pause = true;
var fc_interval;
//img1.style.top = fc_yPos;
function fc_changePos() 
{
	width = document.body.clientWidth;
	fc_height = document.body.clientHeight;
	fc_Hoffset = $("_callfloat").offsetHeight;
	fc_Woffset = $("_callfloat").offsetWidth;
	$("_callfloat").style.left = fc_INIT_TOP + document.body.scrollLeft;
	$("_callfloat").style.top = fc_yPos + document.body.scrollTop;
	if (fc_yon) 
		{fc_yPos = fc_yPos + fc_step;}
	else 
		{fc_yPos = fc_yPos - fc_step;}
	if (fc_yPos < 0) 
		{fc_yon = 1;fc_yPos = 0;}
	if (fc_yPos >= (fc_height - fc_Hoffset)) 
		{fc_yon = 0;fc_yPos = (fc_height - fc_Hoffset);}
	if (fc_xon) 
		{fc_INIT_TOP = fc_INIT_TOP + fc_step;}
	else 
		{fc_INIT_TOP = fc_INIT_TOP - fc_step;}
	if (fc_INIT_TOP < 0) 
		{fc_xon = 1;fc_INIT_TOP = 0;}
	if (fc_INIT_TOP >= (width - fc_Woffset)) 
		{fc_xon = 0;fc_INIT_TOP = (width - fc_Woffset);   }
	}
	
	function fc_start()
	 {
	 	$("_callfloat").visibility = "visible";
		fc_interval = setInterval('fc_changePos()', fc_delay);
	}
	function pause_resume() 
	{
		if(fc_pause) 
		{
			clearInterval(fc_interval);
			fc_pause = false;}
		else 
		{
			fc_interval = setInterval('fc_changePos()',fc_delay);
			fc_pause = true; 
		}
	}
	

function $(obj){
		switch (_fc_cDOMtype)
		{
			case "std":
			{
				return document.getElementById(obj);
			}
			break;

			case "ie4":
			{
				return document.all[obj];
			}
			break;

			case "ns4":
			{
				return document.layers[obj];
			}
			break;
		}

}


//var _callcenter_imgs = "/images/logo/081204_69075417.gif";
//var _callcenter_postion = 4;
//var _callcenter_type = 2;
//左上方:1   右上方:2   左中方:3   右中方:4 

function _callcenter_init(){
   if($("_callfloat")==null){
    var _callfloat = document.createElement("div");
    _callfloat.id = "_callfloat";
    _callfloat.style.position = "absolute";
    document.body.appendChild(_callfloat);
    _callfloat.innerHTML = "<a href=\"http://freecall.400online.com.cn/Home.aspx?cid="+_callcenter_cid+"\" target=\"_blank\"><img src=\"http://freecall.400online.com.cn"+_callcenter_imgs+"\" border=\"0\" /></a>";
    switch(_callcenter_postion){
        case 1:
            fc_INIT_TOP = 10;
            _callfloat.style.top = "10px"
            _callfloat.style.left = "10px";
        
        break;
        
        case 2:
            fc_INIT_TOP = 10;
            _callfloat.style.top = "10px"
            _callfloat.style.right = "10px";
        
        break;
        
        case 3:
            fc_INIT_TOP = 300;
            _callfloat.style.top = "300px"
            _callfloat.style.left = "10px";
        
        break;
        
        case 4:
            fc_INIT_TOP = 300;
            _callfloat.style.top = "300px"
            _callfloat.style.right = "10px";
        
        break;
    
    }
    
    if(_callcenter_type==1){
        fc_scrollImg(); 
    }else if(_callcenter_type==2){
        fc_start();
    
    }else{
        // do nothing
    }
    
    
   } 

}







