﻿function PageDate()
{                                                
	currentDate = new Date();
	with (currentDate) {                                                
		day=getDay();
		month=getMonth()+1;
		this.document.write('Time: '+month+'/'+getDate()+'/'+getFullYear());
	}
	if (day==1){document.write(' Monday');}
	if (day==2){document.write(' Tuesday');}
	if (day==3){document.write(' Wednesday');}
	if (day==4){document.write(' Thursday');}
	if (day==5){document.write(' Friday');}
	if (day==6){document.write(' Saturday');}
	if (day==0){document.write(' Sunday');}
	document.write('');
}

function PageDate1()
{
	currentDate = new Date();
	with (currentDate) {
		day = getDay();
		month = getMonth()+1;
		this.document.write(getDate() + '/' + month + '/' + getFullYear()); 
	}
}

function check_user_pwd(theForm)
{
	if (theForm.username.value.length < 3) {
		alert("User name must have 3 or more chars !");
		theForm.username.focus();theForm.username.select();return false;
	}
	if (theForm.password.value.length < 3) {
		alert("Password must have 3 or more chars !");
		theForm.password.focus();theForm.password.select();return false;
	}
}

function check_search_value(theForm)
{
	var temp='';
	var theString = theForm.byvalue.value.toString();
	var pos = theString.indexOf("%");
	for(var i=0; i<theForm.byvalue.value.length; i++) {
		if (theString.charAt(i) != " ")
			temp += theString.charAt(i);
	}
	if (pos > -1 || temp.length < 1) {
		alert("Search value must be at least 3 chars except space and without char \'%\' !");
		theForm.byvalue.focus();theForm.byvalue.select();return false;
	}
}

function show_menu(iObj, x, y, jObj)
{
	var Bdy = document.body;
	jObj.style.display = 'block';
	jObj.style.pixelTop =  iObj.getBoundingClientRect().top + iObj.offsetHeight + Bdy.scrollTop - x;
	jObj.style.pixelLeft = iObj.getBoundingClientRect().left + Bdy.scrollLeft - y;
}

function vOver(vObj)
{
	vObj.style.display='block';
}

function vOut(vObj)
{
	vObj.style.display='none';
}

var subWin = null;
function sameWin(surl, sWidth, sHeight)
{
	if (subWin) subWin.close();
	subWin = window.open(surl, "subWin", "width="+sWidth+", height="+sHeight+",left="+(screen.width - sWidth)/2+",top="+(screen.height - sHeight)/2+",directories=no,location=0,channelmode=0,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function popWin(surl, sWidth, sHeight, sNo)
{
	if (subWin) subWin.close();
	subWin = window.open(surl, "subWin", "width="+sWidth+", height="+sHeight+",left="+(screen.width - sWidth)/2+",top="+(screen.height - sHeight)/2+",directories=no,location=0,channelmode=0,status=no,scrollbars="+sNo+",resizable=no,menubar=no");
}

var glb_Help_Online_Call_Lable = "You could not click the dial plan in one minute again !";
