// Copyright(c) 2003 Leadware Co., Ltd. All Rights Reserved.

function com_main() {
	top_main();
	}

// top.html
var top_demos= 12;
var top_maininitialized= false;
var top_indemofunc= false;
var top_timedemo;

function top_timedemonext() {
	if(top_maininitialized) {
		if(!top_indemofunc) {
			top_indemofunc= true;
			if(top_timedemo) clearTimeout(top_timedemo);
			if(++top_pdemono>= top_demos) top_pdemono= 0;
			switch(jvsRunway()) {
				case 1:
					top_pdemo.src= top_pdemos[top_pdemono].src;
					break;

				case 2:
					top_pdemo.filters.blendTrans.Apply();
					top_pdemo.src= top_pdemos[top_pdemono].src;
					top_pdemo.filters.blendTrans.Play();
					break;
				}

			top_timedemo= setTimeout("top_timedemonext()", 10000);
			top_indemofunc= false;
			}
		}
	}

function top_main() {
	var u;

	top_pdemono= 1;
	top_pdemo= document["top_idemo"];
	u= top_pdemo.src.replace(/^(.*?\/)?(\w*\.(jpg|gif|png))$/, "$1");

	top_pdemos= new Array();
	for(i=0; i<top_demos; i++) {
		top_pdemos[i]= new Image();
		top_pdemos[i].src= u+ "topdemo"+ (i+1)+ ".jpg";
		}
	top_maininitialized= true;

	top_timedemo= setTimeout("top_timedemonext()", 5000);
	}



// general library
function iddisplay(n, t) {
	var i;

	if(t== null) return (eval(n+ ".style.display")== "");
	else {
		eval(n).style.display= (t ? "":"none");
		}
	}

function ShowUpdate(d) {	// func
	document.write("Last updated "+ d)
	}

function ShowUpdateDoc() {	// func
	ShowUpdate(cDateDoc())
	}

function cStrZ2(n) {	// func
	var s;

	s= ""+ n;
	if(s.length< 2) {
		s= zeroletters.substring(0, 2-s.length)+ s;
		}

	return s;
	}

function cROCDate(dt) {	// func
	var y;

	y= dt.getFullYear();
	return cStrZ2(((y<2000) ? (y+2000- 1911):(y- 1911)))+ "/"+ cStrZ2(dt.getMonth()+1)+ "/"+ cStrZ2(dt.getDate());
	}

function cDate(dt) {	// func
	var y;

	y= dt.getFullYear();
	return "JanFebMarAprMayJunJulAugSepOctNovDec".substr(dt.getMonth()* 3, 3)+ " "+ cStrZ2(dt.getDate()+ ", "+ cStrZ2(((y<2000) ? (y+2000):(y))));
	}

function cROCDateDoc() {	// func
	return cROCDate(new Date(document.lastModified));
	}

function cDateDoc() {	// func
	return cDate(new Date(document.lastModified));
	}

function replacebasego(sn) {	// func
	var publicbase= "http://hsinwuhr2.leadware.com";
	var securebase= jvsdocsubcookie2("hsinwuhr", "securebase");
	var targeturl;

	if(sn== null) sn= ".asp";
	targeturl= ((securebase== "") ? publicbase:securebase)+ document.location.pathname.replace(/.html$/, sn)+ document.location.search;
//	alert("Âà´«ºô°ì: "+ targeturl);
	window.location.replace(targeturl);
	}
