function Blank(cboName,text,value){
var oOption = document.createElement("OPTION") ;
cboName.options.add(oOption) ;
oOption.text = text;
oOption.value = value;
}//----------------------------------------------------

function ReNul(cboName){
for (var i=cboName.options.length;i>=0;i--) 
cboName.options[i]=null;
}//----------------------------------------------------

function FillHuyen(){
var cHuyen=fTam.cHuyen;

ReNul(cHuyen);
Blank(cHuyen,"Tỉnh Bình Thuận",Huyen[0]);

for (j=1; j<136;j++){
if (Xa[j]=="") Blank(cHuyen,Ten[j],Huyen[j]);
}

var cXa=fTam.cXa; 
Blank(cXa,"",Xa[0]);
//document.write('<select id="cXa" onchange="FillPhieu()"><option value="99" selected></option></select>');

var cPhieu=fTam.cPhieu; 
Blank(cPhieu,"Vui lòng chọn Thông tin muốn xem !",0);

for (j=1; j<7;j++) Blank(cPhieu,TenPhieu[j],iPhieu[j]);

var cBieu=fTam.cBieu; 
Blank(cBieu,"Vui lòng chọn Biểu muốn xem !",0);
//document.write('<select id="cBieu" onchange="ShowText()"><option value="0" selected>Vui lòng chọn Biểu muốn xem !</option></select>');
}//----------------------------------------------------

function FillXa(){
var cHuyen=fTam.cHuyen;
var cXa=fTam.cXa;
var cPhieu=fTam.cPhieu;
var cBieu=fTam.cBieu;

ReNul(cXa);ReNul(cPhieu);ReNul(cBieu);

var val=cHuyen.options(cHuyen.selectedIndex).value;

Blank(cXa,"",Xa[0]);

for ( x = 1 ; x < Huyen.length ; x++ ){
if ( Huyen[x] == val && Xa[x] !="") Blank(cXa,Ten[x],Xa[x]);
}

FillPhieu();
}
//----------------------------------------------------
function FillPhieu(){

var cHuyen=fTam.cHuyen;
var cXa=fTam.cXa;
var cPhieu=fTam.cPhieu;
var cBieu=fTam.cBieu;
var hval=cHuyen.options(cHuyen.selectedIndex).value;
var val=cXa.options(cXa.selectedIndex).value;

ReNul(cPhieu);ReNul(cBieu);
//=====
Blank(cPhieu,"",0);
//=====

if (hval=="99") {//99
for (j=1; j<7;j++) Blank(cPhieu,TenPhieu[j],iPhieu[j]);
}
else {
if ((hval!="") && (val=="99")){//99
for (j=1; j<6;j++) Blank(cPhieu,TenPhieu[j],iPhieu[j]);
}
else{
Blank(cPhieu,TenPhieu[1],iPhieu[7]);
}
}
//alert(hval + ':::'+ val);
}//----------------------------------------------------
function FillBieu(){

var cBieu=fTam.cBieu;
var cPhieu=fTam.cPhieu;
var val=cPhieu.options(cPhieu.selectedIndex).value;

ReNul(cBieu);
//=====
Blank(cBieu,"",0);
//=====
//If  (val="0") Blank(cBieu,"Vui lòng chọn Biểu muốn xem !",0);
//=====else{
for ( x = 1 ; x < TenBieu.length ; x++ ){
if ( Phieu[x] == cPhieu.value) {
var oOption = document.createElement("OPTION") ;
cBieu.options.add(oOption) ;
oOption.text = Bieu[x]+" - "+TenBieu[x];
oOption.value = Bieu[x];
}}
//Blank(cBieu,TenBieu[x] ,Bieu[x]);
//}
}//----------------------------------------------------
function OutBieu(){
document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><LINK href="pages/ms.css" rel=stylesheet type=text/css><script language=javascript SRC="pages/danhmuc.js"></script><script language=javascript SRC="pages/function.js"></script>');
document.write('<bgsound src="que-em-mien-trung-du.mid" loop="-1"><body background="../images/nen3.gif"><br>');
document.write('<p align=center><font face="Arial" size=4>Danh mục biểu tổng hợp ');

document.write('<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1"><tr><td width="4%" align="center"><b><font size="2" color="#008080">STT</font></b></td><td width="12%" align="center"><b><font size="2" color="#008080">Biểu</font></b></td><td width="84%" align="center"><b><font size="2" color="#008080">Tên Biểu</font></b></td></tr>');

//var count=1;
for ( x = 1 ; x < 60; x++ ){
//if ( Phieu[x] ==i) {
document.write("<tr><td width='4%' align='center'><font size=2>"+x+"</font></td><td width='12%' align='center'><font color=#000080><font size=2>"+Bieu[x]+"</font></td><td width='84%'><font size=2><a href=javascript:loadgt('solieu/b"+x+".htm',750,500)>"+TenBieu[x]+"</font></td></tr>");
//count++;
}//}

document.write('</table></body>');
}//----------------------------------------------------
function Bieudo(pPage) {
 
 stats="toolbar=no,location=no,scrollbars=no,directories=no,status=no,menubar=no,width=600,height=430,top=100,left=100,resizable=no";
 popUpWin = window.open('','popWin',stats);

 zhtm= '<HTML><HEAD><TITLE>Bieu do minh hoa so ' + pPage + '</TITLE>';
 zhtm += '</head>';
 zhtm += '<bgsound src="que-em-mien-trung-du.mid" loop="-1"><body background="../images/Line3.gif">';
 zhtm += '<p align="center"><FONT face=Arial color=#008080 size=4>Biểu đồ minh hoạ<BR></FONT><FONT face=Arial color=#008000 size=2>Kết quả Tổng điều tra Nông thôn, nông nghiệp và thuỷ sản năm 2001</FONT><br><br>';
 zhtm += '<a href="javascript:window.close();" ><IMG SRC="../images/bieudo/bdo' + pPage + '.gif" border=0></a>';
 zhtm += '<br><br><font face="Arial" size="2" color="#008080">Cục Thống kê Tỉnh Bình Thuận</p>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
}//----------------------------------------------------
function loadgt(trang,rong,cao) {
	window.open(trang,"","toolbar=0,location=0,scrollbars=1,status=0,menubar=0,resizable=0,width=rong,height=cao")
}//----------------------------------------------------

message = "  Hy vong CD.ROM nay se mang lai cho ban nhieu thong tin bo ich, moi van de co lien quan vui long lien he: ^" +
                "...Dia chi : Cuc Thong Ke Binh Thuan - 05 Nguyen Trai - Thanh pho Phan Thiet - Tinh Binh Thuan...^" +
                "...Dien thoai : 062.822008 - Mobile : 0913.883220 - Fax: 84.62.824108 - Email : cucthongke@binhthuan.gov.vn^" +
                "^"
scrollSpeed = 25
lineDelay   = 1500
txt         = ""

function scrollText(pos) {
    if (message.charAt(pos) != '^') {
      txt    = txt + message.charAt(pos)
      status = txt
      pauze  = scrollSpeed
    }
    else {
      pauze = lineDelay
      txt   = ""
      if (pos == message.length-1) pos = -1
    }
    pos++
    setTimeout("scrollText('"+pos+"')",pauze)
}//----------------------------------------------------
//----------------------------------------------------
function ImageLoad(value)
{
TheDate = new Date();                     
Month = TheDate.getMonth();              
Day = TheDate.getDate();                 
Year = TheDate.getYear();
if (Year< 1000)
Year+=1900
Hour = TheDate.getHours();
Minute = TheDate.getMinutes();
Second = TheDate.getSeconds(); 
return 'tl'+value+Second%5;
}
//------------------------------ Thay doi hinh ----------------------

var aSize = new Array (310,310), iDisplay =3000, oTimer = null, iCurrent = 0, sSource = ""

function doDisplay() {
	clearTimeout(oTimer)
	if (sSource!="") {
	if (document.images.slideShow.filters) {
	document.images.slideShow.filters[0].Stop()
	document.images.slideShow.filters[0].Apply()
	document.images.slideShow.filters.revealTrans.transition=23
	}
	document.images.slideShow.src = sSource
	if (document.images.slideShow.filters)
	document.images.slideShow.filters[0].Play()
	}
}
function doReadyImage() {
	sSource = this.src
	if (oTimer==null) doDisplay()
}
function doErrorDisplay() {
	clearTimeout(oTimer)
	doLoad()
}
function doLoad() {
	clearTimeout(oTimer)
	var img = new Image()
	img.onload = doReadyImage
	img.onerror = doErrorDisplay 
	sSource = ""
	iCurrent++
	if (iCurrent==24) iCurrent=0
	oTimer = setTimeout("oTimer=null;doDisplay()",iDisplay)
	img.src = "images/ho"+iCurrent+".gif"
}
function quickNextLoad() {
	clearTimeout(oTimer)
	oTimer=null
	var img = new Image()
	img.onload = doReadyImage
	img.onerror = doErrorDisplay 	
	img.src = "images/ho"+iCurrent+".gif"
}
function quickPrevLoad() {
	clearTimeout(oTimer)
	oTimer=null
	var img = new Image()
	img.onload = doReadyImage
	img.onerror = doErrorDisplay 
	iCurrent-=1
	if (iCurrent<0) iCurrent=23
	iCurrent-=1
	if (iCurrent<0) iCurrent=23
	img.src = "images/ho"+iCurrent+".gif"
}
//---------------------------