function ecatalog(docu, kd, dir){
	if(screen.width < 800){
		alert("The screen resolution should be over 800*600");
		return;
	}

	if(kd == "fixed"){ x = 1024; y = 768; wname = "fixed_ecatalog"; }
	else if(screen.width > 1280 || screen.height > 1024){ x = 1280; y = 1024; wname = "ecatalog"; }
	else{ x = screen.width; y = screen.height; wname = "ecatalog"; }

	x = x - 10;
	y = y - 58;

	property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,";
	property += "width=" + x + ",height=" + y + ",left=" + 0 + ",top=" + 0;
	docu = docu + "/ecatalog.php?Dir=" + dir;

	ecawin = window.open(docu, wname, property);
}

function newWindow(winSet,docu,width,height,left,top,winname){
	if(winSet == 1)
	    property = "toolbar=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,scrollbars=yes,copyhistory=no,";
	else if(winSet == 2)
		property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,";
	else if(winSet == 3)
		property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,copyhistory=no,";

	property += "width=" + width +",height=" + height + ",left=" + left + ",top=" + top;
	window.open(docu,winname,property);
}

function TrmObj(Object,message){
	if(Object.value == "" || trimVal(Object.value) == ""){
		if(message != "") alert(message);
		Object.focus();
		return false;
	}
	else
		return true;
}
function trimVal(Tempo){
	Tstring = "";

	for(var i = 0;i < Tempo.length;i++){
		Temp = Tempo.substring(i,i+1);
		if(Temp != ' ' && Temp != '\n' && Temp != '\r')
			Tstring += Temp;
	}

	return Tstring;
}

function isNotnum(string){
	for(var i = 0;i < string.length;i++){
		Jstr = string.charAt(i);
		if(Jstr < "0" || Jstr > "9") return false;
	}
	return true;
}

function SeColor(tr,n){
	tr.style.backgroundColor = n;
}

function showeMenu(n){
	DivArray = new Array("","tgeneral","tskin","tlink","tfile");
	
	for(var i = 1;i < DivArray.length;i++){
		if(i == n) document.all[DivArray[i]].style.visibility = "visible";
		else document.all[DivArray[i]].style.visibility = "hidden";
	}
}

function newLink(winSet, width, height, docu){
	if(winSet == 1) property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,";
	else property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,copyhistory=no,";

	property += "width=" + width +", height=" + height + ", left=1, top=1";
	window.open(docu, 'ln', property);
}

function cataview(w, h, dir, param){
	divflash.innerHTML = "<table border=0 cellpadding=0 cellspacing=0 width=1280><tr><td nowrap>"
	+ "<embed src=\"main.swf?w=" + w + "&h=" + h + "&Dir=" + dir + "\" flashVars=\"" + param + "\" quality=high allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=1280 height=1024>"
	+ "</embed></td></tr></table>";
}

function flashview(w, h, fname, param){
	document.writeln("<embed src=\"" + fname + "\" flashVars=\"" + param + "\" quality=high pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=" + w + " height=" + h + ">");
}

