﻿  
  //实际长度 ，汉字两个 长度 ，英文 一个长度
   function JHshStrLen(sString)
  {
		var sStr,iCount,i,strTemp ; 
		iCount = 0 ;
		sStr = sString.split("");
		for (i = 0 ; i < sStr.length ; i ++)
		{
			strTemp = escape(sStr[i]); 
			if (strTemp.indexOf("%u",0) == -1) 
			{ 
				iCount = iCount + 1 ;
			} 
			else 
			{
				iCount = iCount + 2 ;
			}
		}
		return iCount ;
 }
 
 
 
    
    
    
        //增加 收藏
function addBookmark(title,url)
 {
	if( document.all )
	{
		window.external.AddFavorite( url, title);
	} 
	else if (window.sidebar) 
	{
		window.sidebar.addPanel(title, url,"");
	}
    else if( window.opera && window.print ) 
    {
		return true;
	}
}




        //获取元素的纵坐标
function getTop(e)
{
    var offset=e.offsetTop;
    if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
    return offset;
}

//获取元素的横坐标
function getLeft(e)
{
    var offset=e.offsetLeft;
    if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
    return offset;
}




function all_move_logo()
{

  var x = getLeft( document.getElementById('div__main_2') );
  var top = getTop( document.getElementById('div__main_2'));// document.getElementById('div__main_2').style; 
  var xx  = (x + 60)+"px";
  var top_2 = ( top +20) + "px";
  
  document.getElementById('div__logo').style.left =xx;
  
  
  document.getElementById('div__logo').style.top =top_2;// = x;
  
   
}




function all_move_phone() 
{
    
    
    
    document.getElementById('div__phone').style.top = document.documentElement.scrollTop + 20+"px";
    var all_width = window.screen.width;
  //  alert( all_width );
    if( all_width>1025)
    {
    
    document.getElementById('div__phone').style.left = "1070px";
       document.getElementById('div__main_2').style.margin= "0 0 0 152px ";
    }
    else
    {
    
    
      document.getElementById('div__phone').style.left = "900px";
       document.getElementById('div__main_2').style.margin= "0 0 0 2px ";
    }
      
    
    all_move_logo();
    setTimeout("all_move_phone()",20 );
  
}



//增加 收藏
function addBookmark(title,url)
 {
	if( document.all )
	{
		window.external.AddFavorite( url, title);
	} 
	else if (window.sidebar) 
	{
		window.sidebar.addPanel(title, url,"");
	}
    else if( window.opera && window.print ) 
    {
		return true;
	}
}
