eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('a 1R(S){5.u="24 1Y 1J 17 1o V 16 1h 14 5 15, 18 21 1a 1Z 1b 1X 1d 1e 1f 1T V 1j 1k.\\n";5.m=S;5.h="E";5.9="";5.T=t;5.12=1N;5.Q=a(){};5.U=a(){};5.X=a(){};5.F=a(){};5.O=a(){v{5.7=o 11("1m.J")}y(e){v{5.7=o 11("1K.J")}y(1q){5.7=1H}}8(!5.7&&1s I!="1u")5.7=o I();8(!5.7){5.L=t}};5.W=a(k,b){8(5.9.w<3){5.9=k+"="+b}d{5.9+="&"+k+"="+b}};5.N=a(k,b){g G=P(k)+"="+P(b);M G};5.C=a(R){l=R.H(\'&\');1z(i=0;i<l.w;i++){c=l[i].H(\'=\');8(c[0].K(\'1A;\')!=-1){c[0]=c[0].1B(4)}l[i]=5.N(c[0],c[1])}M l.1E(\'&\')};5.D=a(){1F(5.q)};5.1G=a(r){5.z=o 1L(2);8(5.L&&5.u){1O(5.u)}d{8(r){8(5.9.w){5.9=5.9+"&"+r}d{5.9=r}}8(5.T){g B=o 1S().1U();5.9=5.C(5.9);5.W("1V",B)}8(5.10){5.j=1W.20(5.10)}8(5.7){g 6=5;8(5.h=="E"){8(5.m.K(\'?\')==-1){g A=5.m+"?"+5.9}d g A=5.m+"&"+5.9;5.7.Y(5.h,A,t)}d{5.7.Y(5.h,5.m,t)}8(5.h=="1i"){v{5.7.1l(\'1n-1p\',\'1r/x-1v-1x-1y\')}y(e){}}5.7.1C(5.9);5.7.1D=a(){1I(6.7.1M){s 1:6.Q();p;s 2:6.U();p;s 3:6.X();p;s 4:6.q=6.7.13;6.Z=6.7.Z;6.z[0]=6.7.1g;6.z[1]=6.7.1t;6.F();8(6.12){6.D()}8(6.j){g f=6.j.1P;f.1Q();8(f=="22"||f=="19"||f=="1c"||f=="1w"){6.j.b=6.q}d{6.j.23=6.q}}6.9="";p}}}}};5.O()}',62,129,'|||||this|self|xmlhttp|if|URLString|function|value|urlVars|else||elemNodeName|var|method||elementObj|name|varArray|requestFile||new|break|response|urlstring|case|true|AjaxFailedAlert|try|length||catch|responseStatus|totalurlstring|timeval|encodeURLString|runResponse|GET|onCompletion|varString|split|XMLHttpRequest|XMLHTTP|indexOf|failed|return|encVar|createAJAX|encodeURIComponent|onLoading|string|file|encodeURIString|onLoaded|the|setVar|onInteractive|open|responseXML|element|ActiveXObject|execute|responseText|of|website|enhanced|not|and|select|you|have|option|experience|that|differs|status|functionality|POST|intended|one|setRequestHeader|Msxml2|Content|support|Type|err|application|typeof|statusText|undefined|www|textarea|form|urlencoded|for|amp|substring|send|onreadystatechange|join|eval|runAJAX|null|switch|does|Microsoft|Array|readyState|false|alert|nodeName|toLowerCase|sack|Date|from|getTime|rndval|document|an|browser|will|getElementById|therefore|input|innerHTML|Your'.split('|'),0,{}))

function call_login()
{	
	username = document.login.username.value;
	passwd = document.login.passwd.value;
	
	
	if(username=='')
	{
		alert('Xin nhập tên đăng nhập');
		return false;
	}
	if(passwd=='')
	{
		alert('Xin nhập mật khẩu');
		return false;
	}
	

	var ajax = new sack();
	ajax.setVar("option", 'com_user'); 
	ajax.setVar("task", 'action_login');
	ajax.setVar("username", username); 
	ajax.setVar("passwd", passwd); 
	ajax.requestFile = "index.php";
	ajax.method = 'POST';
	ajax.onCompletion = function(){
							if(ajax.response!=null&&ajax.response!='')
							{
								if(ajax.response=='error')
								{
									document.login.username.value = '';
									document.login.passwd.value = '';
									document.getElementById('tb_error').style.display = 'block';
									document.getElementById('include_login').style.display = 'none';
									idTimerLogin = 30;
									direct_formLogin();
								}
								else
								{
									document.getElementById('tb_error').style.display = 'none';
									document.getElementById('include_login').style.display = 'block';
									document.getElementById('include_login').innerHTML = ajax.response;
								}
							}
																																			
						};
	ajax.runAJAX();

}

var idTimerLogin;
function direct_formLogin()
{
	if(idTimerLogin>0)
	{
		
		if(document.getElementById('count_login'))
		{
			idTimerLogin = idTimerLogin -1;
			document.getElementById('count_login').innerHTML = idTimerLogin;
			setTimeout("direct_formLogin()", 1000);
		}		
	}
	else
		show_formLogin();
}
function show_formLogin(){
	document.getElementById('tb_error').style.display = 'none';
	document.getElementById('include_login').style.display = 'block';				
}


function call_logout()
{	

	var ajax = new sack();
	ajax.setVar("option", 'com_user'); 
	ajax.setVar("task", 'action_logout');
	ajax.requestFile = "index.php";
	ajax.method = 'POST';
	ajax.onCompletion = function(){
							if(ajax.response!=null&&ajax.response!='')
							{
									document.getElementById('tb_error').style.display = 'none';
								document.getElementById('include_login').style.display = 'block';
								document.getElementById('include_login').innerHTML = ajax.response;
							}
																																			
						};
	ajax.runAJAX();

}

function download_film()
{	
	id = 0;
	if(document.getElementById('download_id'))
		id = document.getElementById('download_id').value;
	
	var ajax = new sack();
	ajax.setVar("option", 'com_films'); 
	ajax.setVar("view", 'film'); 
	ajax.setVar("film", id);
	ajax.requestFile = "index.php";
	ajax.method = 'POST';
	ajax.onCompletion = function(){
							if(ajax.response!=null&&ajax.response!='')
							{
									if(ajax.response=='error')
										alert('Bạn phải đăng nhập để download');
									else
										window.open(ajax.response);
							}
																																			
						};
	ajax.runAJAX();
}

var idTimer;
		
		function down_scroll()
		{
			obj_menu = document.getElementById('arrowlistmenu');			
			if(obj_menu.offsetHeight>346)
			{
				if(obj_menu.offsetTop<=-3)			
				{
					obj_menu.style.top = (obj_menu.offsetTop + 3) + 'px';
					idTimer = setTimeout("down_scroll()", 0);
				}
				else
				{
					clearTimeout(idTimer);
					idTimer = null;
					return false;
				}
			}			
		}
				
		function call_up_scroll()
		{			
			obj_menu = document.getElementById('arrowlistmenu');	
			//pos_menuCalendard = (parseInt(obj_menu.offsetTop) + parseInt(obj_menu.offsetHeight));			
			obj_leftMenuContent = document.getElementById('leftMenuContent');				
			
			
			pos_obj_menu = 0 - (parseInt(obj_menu.offsetHeight) - parseInt(obj_leftMenuContent.offsetHeight)) + 20;			
			up_scroll(obj_menu, pos_obj_menu);
		}
		
		function up_scroll(obj_menu, pos_obj_menu)
		{
			if(obj_menu.offsetHeight>346)
			{
				if(obj_menu.offsetTop>=pos_obj_menu)			
				{
					obj_menu.style.top = (obj_menu.offsetTop - 3) + 'px';						
					idTimer = setTimeout("up_scroll(obj_menu, pos_obj_menu)", 0);
				}
				else
				{
					clearTimeout(idTimer);
					idTimer = null;
					return false;
				}
			}
		}
		
