﻿
function search(type) {
  if(type=='ajax') {

    if(document.searchform.q.value !=='') {
	     document.searchform.submit();
    } else {
        alert(" Nhập nội nội dung cần tìm kiếm !       ");
	document.searchform.q.focus();
    	return false;
    }


  } else {

    if(document.searchf.q.value !=='') {
	     document.searchf.submit();
    } else {
        alert(" Nhập nội nội dung cần tìm kiếm !       ");
	document.searchf.q.focus();
    	return false;
    }

  }


}



function download(url) {
   dlwd = window.open (url,"Help","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=10,height=10");
   setTimeout('dlwd.close()', 8000);
}

    function AddBackContent(cid){
	old_cont[occount] = document.getElementById(cid).innerHTML;
	occount ++;
  }


  function GoToBack(){

   occount --;
   if(old_cont[occount]) {
     document.getElementById(out_id).innerHTML = old_cont[occount];
   } else {
     history.back(1);
   }

  }

  function GoToFoward(){

   occount ++;
   if(old_cont[occount]) {
     document.getElementById(out_id).innerHTML = old_cont[occount];
   } else {
     history.foward(1);
   }

  }

  function CloseTab(cid) {
   document.getElementById(cid).innerHTML = '';
  }

 
function ChangeTheme(themename) {
  scroll(0,0);
  document.cookie = "theme=" + themename;
  var date = new Date();
  date.setMonth(date.getMonth()+1);
  document.cookie += ("; expires=" + date.toUTCString()); 
  setTimeout("window.location='" + page_domain + "?theme=" + themename + "'",100);

}