/**
 * @author his90
 */
var siteurl='http://www.tcrsh.com.tw/CM';
var ajax;

//顯示課程
function showCurse(view)
{
	var QString = "&view="+view;
	$('MainBox').innerHTML = "<span class=en_s3>載入中...請稍後!!</span>";
	ajax =  new Ajax.Updater('MainBox',siteurl+'/ajax.php?p=curse',{method:'post', postBody:QString, onComplete:function(){new Effect.Appear('MainBox',{duration:0.5});},asynchronous:true, evalScripts:true});		
}//end func

//顯示課程內容
function showCursrDetail(sn)
{
	var QString = "&CSN="+sn;
	
	if($('CurseBox').style.display == 'none')
	{
		new Effect.SlideDown('CurseBox',{duration:0.5});
	}//end if
	
	ajax =  new Ajax.Updater('CurseDetail',siteurl+'/ajax.php?p=curse_detail',{method:'post', postBody:QString, onComplete:function(){new Effect.Appear('CurseDetail',{duration:1,from:0,to:1});},asynchronous:true, evalScripts:true});			
	
	goTop();	
}//end func

//關閉課程視窗
function closeCurseBox()
{
	if($('CurseBox').style.display == '')
	{
		new Effect.SwitchOff('CurseBox',{duration:0.1});
	}//end if
}//end func


//關閉 RegNoteBox
function closeRegNoteBox()
{
	if($('RegNoteBox').style.display == '')
	{
		new Effect.SwitchOff('RegNoteBox',{duration:0});
	}//end if
}//end func

//展開 Mask 以及同意視窗
function showRegNote(sn)
{
	var QString = "&CSN="+sn;
	ajax =  new Ajax.Updater('Msg',siteurl+'/ajax.php?p=check_agree',{method:'post', postBody:QString, onComplete:function(){new Effect.Appear('Msg',{duration:1,from:0,to:1});},asynchronous:true, evalScripts:true});			
	$('send_csn').value = sn;
}//end func


//展開報名表單
function showRegBoxByDetail(sn)
{
	var QString = "&CSN="+sn;
	
	if($('RegBox').style.display == 'none')
	{
		//Move CurseBox ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		if($('CurseBox').style.display == '')
		{
			new Effect.Move('CurseBox',{delay:0.2, x: -220, y: 0 });
			new Effect.SlideDown('RegBox',{delay:1.2,duration:0.5});
		}else
		{
			new Effect.SlideDown('RegBox',{duration:0.2});
		}//end if	
		
	}//end if
	
	ajax =  new Ajax.Updater('RegFormBox',siteurl+'/ajax.php?p=reg_form',{method:'post', postBody:QString, onComplete:function(){new Effect.Appear('RegFormBox',{duration:1,from:0,to:1});},asynchronous:true, evalScripts:true});			
}//end func 



//繼續報名本課程表單(From send)
function showRegBoxBySend(sn,warea,dept,deptnum,aname,atel,suname,sutel)
{
	var QString = "&CSN="+sn+"&WArea="+warea+"&Dept="+dept+"&DeptNum="+deptnum+"&AName="+aname+"&ATel="+atel+"&SuName="+suname+"&SuTel="+sutel;
	new Effect.SlideDown('RegBox',{duration:0});
	ajax =  new Ajax.Updater('RegFormBox',siteurl+'/ajax.php?p=reg_form',{method:'post', postBody:QString, onComplete:function(){new Effect.Appear('RegFormBox',{duration:1,from:0,to:1});},asynchronous:true, evalScripts:true});			
}//end func 