// JavaScript Document
<!--  Javascript function code -->

function MM_swapImgRestore() 
{ 
  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 MM_preloadImages() 
{ 
  	var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p=new Array();
   		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   		if (a[i].indexOf("#")!=0)	{ 	d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];	}
	}
}

function MM_findObj(n, d) 
{ 
  	var p,i,x;  if(!d) d=document; 
 if((p=n.indexOf("?"))>0&&parent.frames.length) 
{
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 	 if(!(x=d[n])&&d.all) x=d.all[n]; 
	 for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 	 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() 
{ 
  	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; 
  	for(i=0;i<(a.length-2);i+=3)
  	 if ((x=MM_findObj(a[i]))!=null)
	 {
	 	document.MM_sr[j++]=x; 
	 	if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}

<!-- Java Navigator bar function -->
function LmOver(elem, param1, param2)
{
	elem.style.color = param1
	elem.style.background = param2
	elem.style.cursor = 'hand'
}

function LmOut(elem, param1, param2)
{
	elem.style.color = param1
	elem.style.background = param2
}

function LmDown(elem, param1)
{
	elem.style.color = param1
	//elem.style.background = param2
}

function LmUp(path)
{	location.href = path;	}

<!-- Java Navigator bar function -->

<!-- Java Refresh page -->

function RedirectMain(value)
{
	parent.frames.main.location.replace(value)
}

<!-- Java Refresh page -->

<!-- Java Redirect page to destination frame -->

function RedirectMenu(value)
{
	parent.frames.menu.location.replace(value) 
}

function Redirect(value)
{
	parent.frames.parent.location.replace(value)
}

<!-- Java Redirect page to destination frame -->

<!-- Java Open new window full screen -->

function openFullscreen(page) 
{
	var yes = 1;
	var no = 0;

	var menubar = no;      // The File, Edit, View Menus
	var scrollbars = no;   // Horizontal and vertical scrollbars
	var locationbar = no;  // The location box with the site URL
	var directories = no;  // the "What's New", "What Cool" links
	var resizable = no;    // Can the window be resized?
	var statusbar = no;    // Status bar (with "Document: Done")
	var toolbar = no;      // Back, Forward, Home, Stop toolbar

	windowprops = "width=" + (screen.width-10) + ",height=" + (screen.height-50) + ",top=0,left=0";

	windowprops += (menubar ? ",menubars" : "") +
	(scrollbars ? ",scrollbars" : "") +
	(locationbar ? ",location" : "") +
	(directories ? ",directories" : "") +
	(resizable ? ",resizable" : "") +
	(statusbar ? ",status" : "") +
	(toolbar ? ",toolbar" : "");

	window.open(page, 'fullPopup', windowprops);
}
<!-- Java Open new window full screen -->

<!----------- Java Get date ------------>

function Clock()
{
  var time = new Date()
  var hour = time.getHours()
  var minute = time.getMinutes()
  var second = time.getSeconds()
  var temp = "" + ((hour < 10) ? "0" : "") + hour
  temp += ((minute < 10) ? ":0" : ":") + minute
  temp += ((second < 10) ? ":0" : ":") + second
  document.show.digits.value = temp
  id = setTimeout("Clock()",1000)
  }

function Shortdate(param1,param2,param3)
{
	now = new Date(); 
	var month = new Array ("?.?","?.?","??.?","??.?","?.?","??.?","?.?","?.?","?.?","?.?","?.?","?.?");
	
	if ((param1 != "") && (param2 != "") && (param3 != ""))
	{
		document.write("<font class=Number_Format_Bold>"+(param1)+"</font> ")
		document.write("<font class=Small_Font_Bold>"+(month[param2])+"</font> ")
		document.write("<font class=Number_Format_Bold>"+(543+param3)+"</font>")
	}
	else
	{
		document.write("<font class=Number_Format_Bold>"+(now.getDate())+"</font> ")
		document.write("<font class=Small_Font_Bold>"+(month[now.getMonth()])+"</font> ")
		document.write("<font class=Number_Format_Bold>"+(543+now.getYear())+"</font>")
	}
}

function LongdateBold()
{
	now = new Date();
	var day = new Array ("???????","??????","??????",
	"???","????????","?????","?????");
	var month = new Array 
	("??????","??????????","??????","??????",
	"???????","????????", "???????","???????",
	"???????","??????","?????????","???????");
	
	document.write("<font class=Small_Font_Bold>"+"??? "+(day[now.getDay()].fontcolor("#FEAD34"))+"  ???</font> ")
	document.write("<font class=Number_Format_Bold>"+(now.getDate())+"</font> ")
	document.write("<font class=Small_Font_Bold>"+(month[now.getMonth()])+"</font> ")
	document.write("<font class=Number_Format_Bold>"+(543+now.getYear())+"</font>")
}

function Longdate()
{
	now = new Date();
	var day = new Array ("???????","??????","??????",
	"???","????????","?????","?????");
	var month = new Array 
	("??????","??????????","??????","??????",
	"???????","????????", "???????","???????",
	"???????","??????","?????????","???????");
	
	document.write("<font class=Small_Font>"+"??? "+(day[now.getDay()].fontcolor("#FEAD34"))+"  ???</font> ")
	document.write("<font class=Number_Format>"+String(now.getDate()).fontcolor("#FEAD34")+"</font> ")
	document.write("<font class=Small_Font>"+(month[now.getMonth()])+"</font> ")
	document.write("<font class=Number_Format>"+String(543+now.getYear()).fontcolor("#FEAD34")+"</font>")
}

var imgArray = new Array()
var setTime24 = 1 

function initializeImgClock(object)
{
  var i = 0
  for(i=0; i<10; i++)
  {
    imgArray[i] = new Image(6,8)
    }
  imgArray[0].src = "images/Time/clkimg0.gif"
  imgArray[1].src = "images/Time/clkimg1.gif"
  imgArray[2].src = "images/Time/clkimg2.gif"
  imgArray[3].src = "images/Time/clkimg3.gif"
  imgArray[4].src = "images/Time/clkimg4.gif"
  imgArray[5].src = "images/Time/clkimg5.gif"
  imgArray[6].src = "images/Time/clkimg6.gif"
  imgArray[7].src = "images/Time/clkimg7.gif"
  imgArray[8].src = "images/Time/clkimg8.gif"
  imgArray[9].src = "images/Time/clkimg9.gif"
  jsImgClock24hr()
  }

function jsImgClock24hr()
{
  // Copyright 1998 - 2001 by Ray Stott
  // OK to use if this copyright is included
  // Script available at http://www.crays.com/jsc

  var time = new Date()
  var hour = time.getHours()
  var minute = time.getMinutes()
  var second = time.getSeconds()
  var sec = 0
  var sec10 = 0
  var min = 0
  var min10 = 0
  var hr = 0
  var hr10 = 0
   
  sec10 = Math.floor(second/10)
  sec = second - sec10 * 10
  document.img24Sec.src = imgArray[sec].src
  if (sec==0  || setTime24==1)
  {
    document.img24Sec10.src = imgArray[sec10].src
    min10 = Math.floor(minute/10)
    min = minute - min10 * 10
    document.img24Min.src = imgArray[min].src
    if (min==0  || setTime24==1)
	{
      document.img24Min10.src = imgArray[min10].src
    	hr10 = Math.floor(hour/10)
    	hr = hour - hr10 * 10
      document.img24Hr.src = imgArray[hr].src
      document.img24Hr10.src = imgArray[hr10].src
      setTime24 = 0
      }
    }
   id = setTimeout("jsImgClock24hr()",1000)
   }

<!----------- Java Get date ------------->

<!----------- Java Form validator -------->

function webvalid(object,param)
{
	if (document.sendmessage.username.value == "" || (document.sendmessage.message.value == "")) 
	{
		alert("?????????????????????????")
		return false
	}
	else
	{
		return true
	}
}

function loginvalid()
{
	if (login.username.value == "" || login.password.value == "")
	{
		alert("????????????????????????????????")
		return false
	}
}

function profilevalid()
{
	for(i = 0;i<edit.elements.length;i++)
	{
		if (edit.elements[i].value == "")
		{
			alert("?????????????????????????")
			edit.elements[i].focus()
			return false
		}
	}
	
	if (edit.password.value != edit.confirmpassword.value)
	{
		alert("??????????????????????????")
		edit.password.focus()
		return false
	}
	else return true
}

function regisvalid()
{
	for(i = 0;i<edit.elements.length;i++)
	{
		if (edit.elements[i].value == "")
		{
			alert("?????????????????????????")
			edit.elements[i].focus()
			return false
		}
	}
}

function guestbookvalid()
{
		if (guestpost.username.value == "" || guestpost.message.value == "")
		{
			alert("?????????????????????????")
			if (guestpost.username.value == "")
			{
				guestpost.username.focus()
			}
			else
			{
				guestpost.message.focus()
			}
			return false
		}
		else return true
}

<!----------- Java Form validator -------->

<!----------- Java Webboard ---------------->

function weblink(param, clr, chk)
{
	param.style.color = clr
	param.style.cursor = 'hand'
	
	if(chk==0)	param.style.fontWeight = 'bold'
	else param.style.fontWeight = 'normal'
}

function bgchange(param, img, type, clr)
{
		param.style.backgroundImage = img
		param.style.color = clr
				
		if(type == 0)
		{
				param.style.cursor = 'hand'
		}
}

<!----------- Java Webboard ---------------->

function makeLink(param)
{
	param.style.cursor = 'hand'
}

<!--------------------- Key checker ------------------------------->

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) 
{
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) 
	{
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
	}

	function containsElement(arr, ele) 
	{
		var found = false, index = 0;
		while(!found && index < arr.length)
			if(arr[index] == ele)
				found = true;
			else
				index++;
			return found;
	}

	function getIndex(input) 
	{
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
			if (input.form[i] == input)index = i;
		else i++;
			return index;
	}
	return true;
}

<!--------------------- Key checker ------------------------------->

<!-------------------- Button Action -------------------------------->

function ButtonAction(object, fgcolor, bgcolor, img)
{
	object.style.color = fgcolor
    object.style.backgroundColor = bgcolor
	object.style.borderColor = '#0000FF'
	object.style.cursor = img
}

<!-------------------- Button Action -------------------------------->

function Table(object)
{
	object.style.borderWidth = 5
	object.style.borderColor = '#FF0000'
}

function Delay()
{
	setTimeout("Timer()",2000)
}

function Timer()
{
	setTimeout("Delay()",2000)
}

function calender()
{
	var now = new Date()
	var imgday = new Array()
	var imgdate = new Array()
	var imgmonth = new Array()
	
	imgday[0] = "images/sunday.gif"
	imgday[1] = "images/monday.gif"
	imgday[2] = "images/tuesday.gif"	
	imgday[3] = "images/wednesday.gif"
	imgday[4] = "images/thursday.gif"
	imgday[5] = "images/friday.gif"
	imgday[6] = "images/saturday.gif"
	
	imgdate[0] = "images/Time/0.gif"
	imgdate[1] = "images/Time/1.gif"
	imgdate[2] = "images/Time/2.gif"
	imgdate[3] = "images/Time/3.gif"
	imgdate[4] = "images/Time/4.gif"
	imgdate[5] = "images/Time/5.gif"
	imgdate[6] = "images/Time/6.gif"
	imgdate[7] = "images/Time/7.gif"
	imgdate[8] = "images/Time/8.gif"
	imgdate[9] = "images/Time/9.gif"
	
	imgmonth[0] = "images/january.gif"
	imgmonth[1] = "images/february.gif"
	imgmonth[2] = "images/march.gif"
	imgmonth[3] = "images/april.gif"
	imgmonth[4] = "images/may.gif"
	imgmonth[5] = "images/june.gif"
	imgmonth[6] = "images/july.gif"
	imgmonth[7] = "images/august.gif"
	imgmonth[8] = "images/september.gif"
	imgmonth[9] = "images/october.gif"
	imgmonth[10] = "images/november.gif"
	imgmonth[11] = "images/december.gif"

	document.write("<img src="+imgday[now.getDay()]+">&nbsp;&nbsp;")

	for(var i=0; i<String(now.getDate()).length; i++)
	{
		document.write("<img src="+imgdate[parseInt(String(now.getDate()).charAt(i))]+">")	
	}
	document.write("&nbsp;&nbsp;")
	document.write("<img src="+imgmonth[now.getMonth()]+">&nbsp;&nbsp;")
	
	for(i=0; i<String(now.getYear()).length; i++)
	{
		document.write("<img src="+imgdate[parseInt(String(now.getYear()).charAt(i))]+">")	
	}

}

function webboardvalid()
{
	if (webboard.username.value == "" || webboard.posttopic.value == "" || webboard.message.value == "")
	{
		alert("?????????????????????????")
		if (webboard.username.value == "")	webboard.username.focus()
		else if (webboard.posttopic.value == "")		webboard.posttopic.focus()
		else webboard.message.focus()
		return false
	}
	else return true
}

function questionvalid()
{
	if (questedit.question.value == "" || questedit.answer.value == "")
	{
		alert("?????????????????????????")
		return false
	}
	else return true
}

function problemvalid()
{
	for(i = 0;i<problem.elements.length;i++)
	{
		if (problem.elements[i].value == "")
		{
			alert("?????????????????????????")
			problem.elements[i].focus()
			return false
		}
	}
}

function passwordvalid()
{
	for(i = 0;i<password.elements.length;i++)
	{
		if (password.elements[i].value == "")
		{
			alert("?????????????????????????")
			password.elements[i].focus()
			return false
		}
	}
}
