<!--
var win= null;
function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 				 window.open(theURL,winName,features);
}
//-->

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//-->

function checkprovince() {

				     if(document.form1.province.value==1) {

					   document.form1.district.disabled=false;}

					   else{

					   document.form1.district.disabled=true;

						;}
}

function check_number(ch){  // Check number
		var len, digit;
		if(ch == " "){
		len=0;
		}else{
		len = ch.length;
		}
			for(var i=0 ; i<len ; i++)
			{
				digit = ch.charAt(i)
				if(( (digit >="0" && digit <="9") )){
				;
				chk_value = 0;
				}else{
				chk_value = 1;
				break;
				}
			}

		if(chk_value == 1) return false; else return true;

}

function formSubmit(elm){
	if(elm){
		document.getElementById(elm).submit();
	}
}
/*
function chkInt(obj)
{
	var digit;
	digit=obj.value
	for (var i=0;i<digit.length;i++)
	{
		if (!(digit.charAt(i)>="0" &&digit.charAt(i)<="9"))
		{ 
			return false;
			break;
		}
	}
}
*/
function check_thai(ch){ // Check thai lang.
		var len, digit;
		if(ch == " "){
		len=0;
		}else{
		len = ch.length;
		}
		for(var i=0 ; i<len ; i++)
		{
			digit = ch.charAt(i)
			if(!((digit >= "a" && digit <= "z") || (digit >="0" && digit <="9") || (digit >="A" && digit <="Z"))){
			;
				return false;
				break;
			}
		}
//return true;
}


// JavaScript Document
//alert('aaaaaaaaaaaaa');
//CreateBox();

function CreateBox(){
	var str = '';
	var ran = Math.random(1000);
	var iddiv = CheckDivid(0);
	document.write('<div id="flashbox'+iddiv+'" style="visibility:hidden; position:absolute; top:0; left:0; width:100%; height:100%;" >');
	var txt1 = ShowFlash('http://www.inpros.info/flashshow/tt/test2','&movid=test'+ran+'&pdiv=flashbox'+iddiv,'test2','transparent');
	//document.write(txt1);
	document.write('</div>');
	
	var iddiv2 = CheckDivid(iddiv);
	document.write('<div id="flashbox'+iddiv2+'" style=" width:200px; height:200px;" >');
	var txt2 = ShowFlash('http://www.inpros.info/flashshow/tt/test','&movid=test'+ran+'&pdiv=flashbox'+iddiv+'&ppdiv=flashbox'+iddiv2+'','test1','transparent');
	//document.write(txt2);
	document.write('</div>');
	//var divfocus = document.getElementById("flashbox"+iddiv2+"");
	//divfocus.focus = true;
}


function showdivv(divid,nn){
	//alert('zzb');
	var dd = document.getElementById(divid);
	if(nn == 1){
	dd.style.visibility="visible";

	document["test2"].PlayMovie();
	//fmov.PlayMovie();
	}else{
	dd.style.visibility="hidden";
	document["test2"].StopMovie();
	
	}
	//alert(bb);
}

function ShowFlash(flashname,fvar,id,wm){	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'" width="800" height="600" align="left" >');	
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="wmode" value="'+wm+'" />');
	document.write('<param name="scale" value="exactFit" />');	
	document.write('<param name="movie" value="'+flashname+'.swf?'+fvar+'" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="'+flashname+'.swf?'+fvar+'" quality="high" bgcolor="#FFFFFF" width="800" height="600" swLiveConnect=true id="'+id+'" name="'+id+'" wmode="'+wm+'"  align="left"scale="exactFit" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');	
}


function CheckDivid(nn){
	var st = 0;
	do{
		st++;
		var chk = document.getElementById("flashbox"+st);
	}while(chk != null || st == nn);
	return st;
}



