function SetFontSize(Size){
   var Obj=$("content")
   switch (Size){
      case "S":
		  Obj.style.fontSize="12px";
	      break;
      case "M":
		  Obj.style.fontSize="14px";
	      break;
      case "L":
		  Obj.style.fontSize="16px";	     
	      break;
   }
}

function SetFontColor(Color)
{	
	var Obj=$("content")
	Obj.style.color = Color;
}


function ScrollImgLeft(){
var speed=20
var scroll_begin = document.getElementById("scroll_begin");
var scroll_end = document.getElementById("scroll_end");
var scroll_div = document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML
  function Marquee(){
    if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
      scroll_div.scrollLeft-=scroll_begin.offsetWidth
    else
      scroll_div.scrollLeft++
  }
var MyMar=setInterval(Marquee,speed)
  scroll_div.onmouseover=function() {clearInterval(MyMar)}
  scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}


function AddFavorite(sURL, sTitle)
{

		try
        {
            window.external.addFavorite(sURL, sTitle);
        }
        catch (e)
        {
            try
            {
                window.sidebar.addPanel(sTitle, sURL, "");
            }
            catch (e)
            {
                alert("加入收藏失败，请使用Ctrl+D进行添加");
            }
        }
}



function SetHome(obj,vrl)
    {
        try
        {
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                        } 
                        catch (e) { 
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
    }
	

function swf(src,w,h){
	html = '';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">';
	html += '<param name="allowScriptAccess" value="sameDomain" />';
	html += '<param name="movie" value="'+src+'" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<embed src="'+src+'" quality="high" bgcolor="#cc6600" width="'+w+'" height="'+h+'" name="main" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	html += '<\/object>';
	document.write(html);
}


function SwfFlvPlayer(texts,files,swf_width,swf_height) {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="http://file.txysyy.com/html/flash/swfFlvPlayer.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name="allowFullScreen" value="true" />');
document.write('<param name="FlashVars" value="IsAutoPlay=0&IsContinue=0&IsShowBar=1&vcastr_file='+files+'&vcastr_title='+texts+'">');
document.write('<embed src="http://file.txysyy.com/html/flash/swfFlvPlayer.swf" allowFullScreen="true" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'" menu="false" IsShowBar=1 IsContinue=1 quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
}

function FlvPlayer(texts,files,swf_width,swf_height) {
		document.write("<span id='view'></span>");
		var s1 = new SWFObject('http://file.txysyy.com/html/flash/player.4.2.88.swf','player',swf_width,swf_height,'9'); 
		s1.addParam('allowfullscreen','true'); 
		s1.addParam('allowscriptaccess','always'); 
		s1.addParam('wmode','transparent');
		s1.addParam('flashvars','file='+ files +''); 
		s1.write('view'); 
}

function divChg2(nu,gr) {
//	alert([nu,gr])
	switch(nu){
		case '1':  
		  document.getElementById(gr+'1').style.display='';
		  document.getElementById(gr+'2').style.display='none';
		  document.getElementById(gr+'3').style.display='none';

		  break
		case '2': 		 
		  document.getElementById(gr+'1').style.display='none';
		  document.getElementById(gr+'2').style.display='';
		  document.getElementById(gr+'3').style.display='none';

		  break
		case '3': 		 
		  document.getElementById(gr+'1').style.display='none';
		  document.getElementById(gr+'2').style.display='none';
		  document.getElementById(gr+'3').style.display='';

		  break
  
		  
	}

};

function checkSearch()
{
	
	return true;
	
}


/*AJAX部分*/
function getDoctorList(ksid)
{
	if(ksid == 0)
	{
		return true;
	}
	
	//$("doctorlist").innerHTML = "数据读取中...";
	
	var param = "KSID="+ksid;
	var myAjax = new Ajax.Request(
        "http://www.txysyy.com/crm/index.php?c=init&d=getDoctorList",
        {
            method:"post",       //表单提交方式 
            parameters:param,   //提交的表单数据
            setRequestHeader:{"If-Modified-Since":"0"},     //禁止读取缓存数据
            onComplete:function(x){    //提交成功回调 
                    //alert(x.responseText);
					$("doctorlist").innerHTML = x.responseText;
					return false;
            },
            onError:function(x){          //提交失败回调
                    alert(x.statusText);
					return false;
            } 
        } 
   ); 
	
}



function SendYuYue()
{

	return true;
	   	//获取科室文本
		for(i=0;i<$("KsId").options.length;i++){
			
			if($("KsId").options[i].value==$("KsId").value){
			 var ksName = $("KsId").options[i].innerHTML;
			}
	   }
	   	
		//获取医生姓名
		for(i=0;i<$("DoctorID").options.length;i++){
			
			if($("DoctorID").options[i].value==$("DoctorID").value){
			 var DoctorName = $("DoctorID").options[i].innerHTML;
			}
	   }
	  
	   var param = "&ksname="+ $E(ksName) +"&doctorname="+ $E(DoctorName) + "&"+ $.Form("YueYu").serialize({ regTime:new Date().toGMTString()} );

	   var myAjax = new Ajax.Request(
        "http://www.txysyy.com/crm/index.php?c=init&d=YuYue",
        {
            method:"post",       //表单提交方式 
            parameters:param,   //提交的表单数据
            setRequestHeader:{"If-Modified-Since":"0"},     //禁止读取缓存数据
            onComplete:function(x){    //提交成功回调 
					if(x.responseText == 1)
					{
						$("YuYue").innerHTML = "<div class='YuYue_result'><b><FONT color=red>您的预约已经提交，请等待我们联系您！</FONT></b><br><font color='#ff9900'><b>温馨提示：</b></font>网上预约<FONT color=red>免</FONT>挂号费、<FONT color=red>免</FONT>专家咨询费等，可优先通过绿色通道就诊，无需排队等候！</div>";
					}
					else
					{
						 alert(x.responseText);
					}
                   
					
					return false;
            },
            onError:function(x){          //提交失败回调
                    alert(x.statusText);
					return false;
            } 
        } 
   ); 
 return false;
	   
}


function ChangTID(index,flag){

if(index ==0)
{
	$("Conntent_0").style.display = '';
	$("Conntent_1").style.display = 'none';
	$("TID_0").className = "ask_nore";
	$("TID_1").className = "ask_re";
}
else 
{
	$("Conntent_0").style.display = 'none';
	$("Conntent_1").style.display = '';
	$("TID_0").className = "ask_re1";
	$("TID_1").className = "ask_nore";
}

/*
	for(var i=0;i<4;i++){
		if($("Conntent_"+i)&&$("TID_"+i)){
			$("Conntent_"+i).style.display = 'none';
			$("TID_"+i).className = "ask_re1";
		}
	}
	if($("Conntent_"+index)&&$("TID_"+index)){
		$("Conntent_"+index).style.display = 'inline';
		$("TID_"+index).className = "ask_nore";
	}
	*/
}
	
