var flashvars = {};
var flashparams = { wmode:"transparent",bgcolor:"#000000"};
var flashattributes = {};
if($('DivFlashImg')!=null)
{
    if($('SZDivTL')!=null)
    {
        swfobject.embedSWF("/img/sz.swf", "DivFlashImg", "807", "181", "7.0.0","expressInstall.swf", flashvars, flashparams, flashattributes);
	    set_right_l();
	}
	else if($('DivTL')!=null)
    {
        swfobject.embedSWF("/img/gz.swf", "DivFlashImg", "807", "181", "7.0.0","expressInstall.swf", flashvars, flashparams, flashattributes);
	    set_right_l();
	}
}
window.onresize=function(){set_right_l();};
function set_right_l()
{
    if ($('DivRightLong') != null) {
        if (document.body.clientWidth - 960 > 20)
            $('DivRightLong').style.width = (document.body.clientWidth - 960) + 'px';
        else
            $('DivRightLong').style.width = '20px';
    }
}
	var menu_num=4;
	function hit_menu(left,id)
	{
		if($('TopMenu'+id).className=='TopMenuParent2')
			return;
		
		for(i=1;i<=menu_num;i++)
		{
			if(i!=id)
			{
				$('TopMenu'+i).className='TopMenuParent';
				$('menu'+i).style.visibility='hidden';
			}
		}
		

					
		$('menu'+id).style.visibility='visible';
		$('menu'+id).style.left=355+21+left-$('menu'+id).clientWidth/2 + 50 +'px';
		$('menu'+id).style.top='94px';
		
		$('DivMenuMark').style.left=$('menu'+id).style.left;
		$('DivMenuMark').style.top=$('menu'+id).style.top;
		$('DivMenuMark').style.visibility='visible';
		$('DivMenuMark').innerHTML=	$('menu'+id).innerHTML;
		
		$('TopMenu'+id).className='TopMenuParent2';	
		

	}
	
	
	function hide_menu()
	{
		for(i=1;i<=menu_num;i++)
		{
			$('TopMenu'+i).className='TopMenuParent';
			$('menu'+i).style.visibility='hidden';
		}
		$('DivMenuMark').style.visibility='hidden';
	}


		
		var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 ));
		
		if(activex)
			setTimeout("after_load();",1000);
		else
		{
			setTimeout("set_height();",1000);
			setTimeout("set_height();",3000);
			setTimeout("set_height();",5000);
			setTimeout("set_height();",30000);
		}

		function after_load()
		{
			if(document.readyState=='complete')
				set_height();
			else
				setTimeout("after_load()",3000);
		}
		
		function set_height()
		{

		    if ($('DivR') != null) {
		        if ($('DivR').offsetHeight > $('DivL').offsetHeight) {
		            $('DivL').style.height = $('DivR').offsetHeight + 'px';
		             
		        }
		        else {
	                $('DivR').style.height = $('DivL').offsetHeight + 'px';
	            }

	            if ((navigator.userAgent.indexOf('MSIE 6.0') != -1)) {
	                $('DivRightLong').style.height = $('DivR').offsetHeight + $('DivTR_index').offsetHeight + $('DivBottom').offsetHeight +4+'px';
	                $('DivRightLongTable').style.height = $('DivRightLong').style.height;
	            }
	            else {
	                $('DivRightLong').style.height = $('DivR').offsetHeight + $('DivTR_index').offsetHeight + $('DivBottom').offsetHeight + 'px';
	                $('DivRightLongTable').style.height = $('DivRightLong').style.height;
	            }
		    }
		}
		
function get_messenger(emailID)
{
// Test #1: Launch with no email variable value causing the user to have to select another user to interact with.
	var msn_obj=CheckMessenger();
	if(msn_obj==null)
		return true;
	else
	{
		location='msnim:chat?contact='+emailID;
		//LaunchMSN(msn_obj, emailID);
		return false;
	}
}

function LaunchMSN(obj, emailID)
{
if (obj != null)
{
obj.LaunchApp('', emailID);
}
}
function CheckMessenger()
{
eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch"); } catch (e) {obj = null;}');
if (obj == null)
	return null;
else
	return obj;
} 

function showpresence(presence)
   {
      var innerFrame = document.getElementById('innerFrame');
      var statusIcon = document.createElement('img');
      statusIcon.style.border = 'none';
      statusIcon.algin='absmiddle';
      statusIcon.src = presence.icon.url;
      statusIcon.width = presence.icon.width;
      statusIcon.height = presence.icon.height;
      //statusIcon.alt = presence.statusText;
      //statusIcon.title = presence.statusText;

      var displayName = document.createElement('span');
      //displayName.style.fontFamily = 'Tahoma, Verdana, sans-serif';
      displayName.style.fontSize = '9pt';
      displayName.style.color = 'orange';
      displayName.title =presence.displayName;
      
      var statusText = document.createElement('span');
      //statusText.style.fontFamily = 'Tahoma, Verdana, sans-serif';
      statusText.style.fontSize = '9pt';
      //statusText.title =presence.statusText;
      if(presence.statusText!='Offline')
      {
      	statusText.style.color='green';
      	statusText.style.fontweight='bold';
      }
      else
      	statusText.style.color='gray';
      	
     
      
      if ((displayName.innerText !== undefined)&&(statusText.innerText !== undefined))
      {
         
         //displayName.innerText = presence.displayName;
      	 //statusText.innerText ='('+ presence.statusText+')';
      	 if(presence.statusText!='Offline')
      	 {
      	 		displayName.innerText ='金蜘蛛客服' ;
      	 		statusText.innerText ='(在线)';
      	 	}
      	 	else
      	 	{
      	 		displayName.innerText ='金蜘蛛客服' ;
      	 		statusText.innerText ='(离线)';
      	 	}
      	 	
      }
      else if ((displayName.textContent != undefined)&&(statusText.textContent !== undefined))
      {
         //displayName.textContent == presence.displayName;
         //statusText.textContent =='('+ presence.statusText+')';
          if(presence.statusText!='Offline')
      	 {
      	 		displayName.textContent ='金蜘蛛客服' ;
      	 		statusText.textContent ='(在线)';
      	 	}
      	 	else
      	 	{
      	 		displayName.textContent ='金蜘蛛客服' ;
      	 		statusText.textContent ='(离线)';
      	 	}
      }
      
      var br = document.createElement('br');
      
      innerFrame.appendChild(statusIcon);
      //innerFrame.appendChild(br);
      innerFrame.appendChild(displayName);
      //innerFrame.appendChild(br);
      innerFrame.appendChild(statusText);
   }
		

