// JavaScript Document
/////////////////Ò³Â±Ê¾Å¥///////////////////////////
function   sly(idName)  //(id)
  {    document.getElementById(idName).style.display="none";     }  
    function   szx(idName)  //Ê¾(id)
  {    document.getElementById(idName).style.display="block";  }  
      function   himg(idName,imgsrc)//Í¼Æ¬(Í¼Æ¬id)
  {    document.getElementById(idName).src=imgsrc;  } 
  
      function   himg2(idName,imgsrc,tdid,tdwidth)//Í¼Æ¬ Ä±(Í¼Æ¬id Í¼Æ¬Â· ÒªÄ±ÈµÄµÔªid ÔªÈµ)
  {    document.getElementById(idName).src=imgsrc;
  document.getElementById(tdid).width=tdwidth;  } 
  ///////////////////////////////////
  
/////////////Ò³Ã¿6ë»»Í¼Æ?/////////////////  
  function clock(img1,img2,yc,imgp)//Í¼Æ¬1 Í¼Æ¬2idÍ¼Æ¬Ç©<img Î»Ãµid
  {
if(document.getElementById(yc).value==1)
{document.getElementById(imgp).src=img2;
document.getElementById(yc).value=2;
 document.getElementById(imgp).filters.RevealTrans.duration = 2;
 document.getElementById(imgp).filters.RevealTrans.transition=12;
 document.getElementById(imgp).filters.RevealTrans.apply(); 
document.getElementById(imgp).filters.RevealTrans.play(); return   false;}
if(document.getElementById(yc).value==2)
{document.getElementById(imgp).src=img1;
document.getElementById(yc).value=1;
document.getElementById(imgp).filters.RevealTrans.duration = 2;
 document.getElementById(imgp).filters.RevealTrans.transition=15;
 document.getElementById(imgp).filters.RevealTrans.apply(); 
document.getElementById(imgp).filters.RevealTrans.play(); return   false;}
  }
/////////////////////////////////////
  
  ///////////////×ªÒ³//////////////////////
  function thelink(theurl)
{window.location.href=theurl;


}


//--------olny reg button---------
  function thelinkreg()
{window.location.href="http://www.tingkezheng.com/Portal/OrganPortal/Login.aspx";
}
  //////////////////////////////////////////////
  
  ///////////Ö¸/////////////////
function xhand(theid)
{document.getElementById(theid).style.cursor='pointer';}
  //////////////////////////
  ///////////////////Ð¶Ö·Ç·Îª
function CheckBlank(str) {
	re=/^\s*$/;
	return (re.test(str));
}

//////////////////////////////Ä±Ç·ÎªÕµÐ£
function IsEmpty(obj,errmsg,debug)
{
	var str = obj.value;
	if (CheckBlank(str)) {
		if(errmsg) alert(errmsg);
		obj.focus();
	   	return true;
	}
    return false;
}

//////////////////////////////ç»?Ð£
 function CheckTel(Tel)
{
	var i,j,strTemp,len;
	len=Tel.length;
	if(len<9 || len>32)	return 0;
	strTemp="0123456789-()# ";
	for (i=0;i<len;i++){
		j=strTemp.indexOf(Tel.charAt(i));
		if (j==-1) return 0;
	}
	return 1;
}

  /////////////////////////////////////////////////////Ð¶EmailÖ·Ï·
function ValidString(str)
{
   for(var i=0;i<str.length;i++)
     {
       lls=str.substring(i,i+1);
       if (!( (lls>='0' && lls<='9') ||  (lls>='A' && lls<='Z') || (lls>='a' && lls<='z') || lls=='-' || lls=='_' ||  lls=='.' ))
		return false;
     }
	return true;
}
function ValidEmailChar(str)
{
    var index=str.indexOf("@");
    if (str=="" || index==-1 || index==0)
	return false;
	var user=str.substring(0,index);
	var host=str.substring(index+1);
    var index1=host.indexOf(".");
	len=host.length;
    if (index1==-1 || index1==0 || index1>len-3)
	return false;
       if(! ValidString(user))
	  return false;
       if(! ValidString(host))
	  return false;
       if(ValidIP(host))
	  return false;
	return true;
}
function ValidEmail(obj,errmsg)
{
   var str = obj.value;
  if(ValidEmailChar(str))
     return true;
  else
  {
       if(errmsg) alert(errmsg);
       obj.focus();
     return false;
  }
}
////////////////////////////////////////////////////////
//////////////////////////////////////////////
/*
Í¼Æ¬
*/
var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
	return destination;
}

var CurrentStyle = function(element){
	return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}

var Bind = function(object, fun) {
	var args = Array.prototype.slice.call(arguments).slice(2);
	return function() {
		return fun.apply(object, args.concat(Array.prototype.slice.call(arguments)));
	}
}

var Tween = {
	Quart: {
		easeOut: function(t,b,c,d){
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		}
	},
	Back: {
		easeOut: function(t,b,c,d,s){
			if (s == undefined) s = 1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		}
	},
	Bounce: {
		easeOut: function(t,b,c,d){
			if ((t/=d) < (1/2.75)) {
				return c*(7.5625*t*t) + b;
			} else if (t < (2/2.75)) {
				return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
			} else {
				return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
			}
		}
	}
}


//,,Ð»
var SlideTrans = function(container, slider, count, options) {
	this._slider = $(slider);
	this._container = $(container);//
	this._timer = null;//Ê±
	this._count = Math.abs(count);//Ð»
	this._target = 0;//Ä¿Öµ
	this._t = this._b = this._c = 0;//tween
	
	this.Index = 0;//Ç°
	
	this.SetOptions(options);
	
	this.Auto = !!this.options.Auto;
	this.Duration = Math.abs(this.options.Duration);
	this.Time = Math.abs(this.options.Time);
	this.Pause = Math.abs(this.options.Pause);
	this.Tween = this.options.Tween;
	this.onStart = this.options.onStart;
	this.onFinish = this.options.onFinish;
	
	var bVertical = !!this.options.Vertical;
	this._css = bVertical ? "top" : "left";//
	
	//Ê½
	var p = CurrentStyle(this._container).position;
	p == "relative" || p == "absolute" || (this._container.style.position = "relative");
	this._container.style.overflow = "hidden";
	this._slider.style.position = "absolute";
	
	this.Change = this.options.Change ? this.options.Change :
		this._slider[bVertical ? "offsetHeight" : "offsetWidth"] / this._count;
};
SlideTrans.prototype = {
  //Ä¬
  SetOptions: function(options) {
	this.options = {//Ä¬Öµ
		Vertical:	true,//Ç·Ö±ò£¨·Ü¸Ä£
		Auto:		true,//Ç·Ô¶
		Change:		0,//Ä±
		Duration:	50,//Ê±
		Time:		5,//Ê±
		Pause:		6000,//Í£Ê±(AutoÎªtrueÊ±Ð§)
		onStart:	function(){},//Ê¼×ªÊ±Ö´
		onFinish:	function(){},//×ªÊ±Ö´
		Tween:		Tween.Quart.easeOut//tween
	};
	Extend(this.options, options || {});
  },
  //Ê¼Ð»
  Run: function(index) {
	//index
	index == undefined && (index = this.Index);
	index < 0 && (index = this._count - 1) || index >= this._count && (index = 0);
	//Ã²
	this._target = -Math.abs(this.Change) * (this.Index = index);
	this._t = 0;
	this._b = parseInt(CurrentStyle(this._slider)[this.options.Vertical ? "top" : "left"]);
	this._c = this._target - this._b;
	
	this.onStart();
	this.Move();
  },
  //Æ¶
  Move: function() {
	clearTimeout(this._timer);
	//Î´Ä¿Æ¶Ò»Î»
	if (this._c && this._t < this.Duration) {
		this.MoveTo(Math.round(this.Tween(this._t++, this._b, this._c, this.Duration)));
		this._timer = setTimeout(Bind(this, this.Move), this.Time);
	}else{
		this.MoveTo(this._target);
		this.Auto && (this._timer = setTimeout(Bind(this, this.Next), this.Pause));
	}
  },
  //Æ¶
  MoveTo: function(i) {
	this._slider.style[this._css] = i + "px";
  },
  //Ò»
  Next: function() {
	this.Run(++this.Index);
  },
  //Ò»
  Previous: function() {
	this.Run(--this.Index);
  },

  //Í£Ö¹
  Stop: function() {
	clearTimeout(this._timer); this.MoveTo(this._target);
  }
};
///////////////////////////////////////////
///////////////////////////////////////////////////////////////////