document.onmouseover=itemOver;
document.onmouseout=itemOut;

function itemOver(){
var eSrc=window.event.srcElement;
if(eSrc.className=="main_button"){
eSrc.className="main_button_over";
}
if(eSrc.className=="del"){
eSrc.className="delovr";
}
if(eSrc.className=="packing"){
eSrc.className="packingovr";
}
if(eSrc.className=="payment"){
eSrc.className="paymentovr";
}
if(eSrc.className=="special"){
eSrc.className="specialovr";
}
if(eSrc.className=="service"){
eSrc.className="serviceovr";
}
if(eSrc.className=="auction"){
eSrc.className="auctionovr";
}
if(eSrc.className=="order"){
eSrc.className="orderovr";
}
if(eSrc.className=="normalpic"){
eSrc.className="overpic";
}
if(eSrc.className=="gtext1"){
eSrc.className="gtext1ovr";
}
}

function itemOut(){
var eSrc=window.event.srcElement;
if(eSrc.className=="main_button_over"){
eSrc.className="main_button";
}
if(eSrc.className=="delovr"){
eSrc.className="del";
}
if(eSrc.className=="packingovr"){
eSrc.className="packing";
}
if(eSrc.className=="paymentovr"){
eSrc.className="payment";
}
if(eSrc.className=="specialovr"){
eSrc.className="special";
}
if(eSrc.className=="serviceovr"){
eSrc.className="service";
}
if(eSrc.className=="auctionovr"){
eSrc.className="auction";
}
if(eSrc.className=="orderovr"){
eSrc.className="order";
}
if(eSrc.className=="overpic"){
eSrc.className="normalpic";
}
if(eSrc.className=="gtext1ovr"){
eSrc.className="gtext1";
}
}

function isActive(){
var eSrc=window.event.srcElement;
if(eSrc.className=="text_normal"){
eSrc.className="text_active";
}else if(eSrc.className=="general_text_normal"){
eSrc.className="general_text_active";
}else if(eSrc.className=="login_text_normal"){
eSrc.className="login_text_active";
}
else if(eSrc.className=="text_normal1"){
eSrc.className="text_active1";
}else if(eSrc.className=="nor"){
eSrc.className="fos";
}
}

function isNormal(){
var eSrc=window.event.srcElement;
if(eSrc.className=="text_active"){
eSrc.className="text_normal";
}else if(eSrc.className=="general_text_active"){
eSrc.className="general_text_normal";
}else if(eSrc.className=="login_text_active"){
eSrc.className="login_text_normal";
}
else if(eSrc.className=="text_active1"){
eSrc.className="text_normal1";
}else if(eSrc.className=="fos"){
eSrc.className="nor";
}
}
function ttt(loc,tgt,lvl){
 	if(tgt==null){
	  window.location.href=loc;
	}else{
	  parent.frames[tgt].location.href=loc;
	}
  }



function forDate(Location){
if(Location.value.length==2 || Location.value.length==5){
Location.value=Location.value+'/';
}
}

function curDate()
{
var today;
var dd, mm, yy;
today = new Date();
dd=today.getDate() + "/";
mm=today.getMonth()+1+"/";
yy=today.getFullYear();
return dd+mm+yy;
}


var Message="Corporate Ves";
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollOut()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
   }
}
function scrollOut() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);
   }
}

function validateNum(obj)
	{
	  
		if (isNaN(obj.value)){
			alert("Sorry! " + obj.name + " must be only number.");
			obj.focus();
			obj.select();
			return false;
		}
		return true
}

function validateNum1(obj){//aungzk//
	if (isNaN(obj.value)){
		alert("Sorry! It must be only number.")
		obj.focus();
		obj.select();
		return false;
	}
	return true
}

function GoBlank(objText){//aungzk//
	if ((objText.value)==""){
		objText.focus();
	}
}

function validateString(obj){//aungzk//
	if ((isNaN(obj.value))==false){
		alert("Sorry! It must be only string.")
		obj.focus();
		obj.select();
		return false;
	}
	return true
}

function checkNumber(obj){
	for (var i=0; i < obj.value.length; i++)
	{
		var ch=obj.value.substring(i,i+1)
		if (ch < "0" || ch > "9" || obj.value.length == null)
		{
			alert("Sorry! Please  make sure, " + obj.name + " must be only numeric.");
			obj.focus();
			obj.select();
			return false
		}
	}
	return true
}

function checkNum(obj){
	for (var i=0; i < obj.length; i++)
	{
		var ch=obj.substring(i,i+1)
		if (ch < "1" || ch > "9" || obj.length == null)
		{
			alert("Sorry! Invalid value. Quantity may be zero or string.");
			//obj.focus();
			//obj.select();
			return false
		}
	}
	return true
}

function m_over(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.background="#DCEBFE";
   x.event.srcElement.style.color = "F20134";
   x.event.srcElement.style.cursor = "hand";
}

function m_out(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.background="#7198CC";
   x.event.srcElement.style.color = "ffcc66";
   x.event.srcElement.style.cursor = "default";
}

function m_overtit(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.color = "6F7600";
   x.event.srcElement.style.cursor = "hand";
}

function m_outh(x)
{
   if(x == null)
      x= window;
    x.event.srcElement.style.color = "BE3C02";
   x.event.srcElement.style.cursor = "hand";
}

function m_out1(x)
{
   if(x == null)
      x= window;
   
   x.event.srcElement.style.color = "BD6C04";
   x.event.srcElement.style.cursor = "default";
}
function m_click(dest)
{
	window.location =dest;
}
function mo_over1(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.color = "#336600";
   x.event.srcElement.style.cursor = "hand";
}

function mo_over(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.color = "#9CC4DA";
   x.event.srcElement.style.cursor = "hand";
}

function mo_out(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.color = "#1BAAF8";
   x.event.srcElement.style.cursor = "default";
}

function m_hand(x)
{
   if(x == null)
      x= window;
   x.event.srcElement.style.cursor = "hand";
}

function getKeyCode(){return window.event.keyCode;}//aungzk//
function setFocus(obj){
	if(getKeyCode()==13){obj.focus();obj.select();window.event.keyCode=0;}
	return true
}

function getKeyCode(){return window.event.keyCode;}//aungzk//
function findURL(obj){
	if(getKeyCode()==13){
		obj.focus();
		obj.select();
		window.event.keyCode=0;
	}
	return true
}
 function itemLink(Link,Target)
 {
            if(Target==null)
            {
                  window.location.href=Link;
            }
            else
            {
                  parent.frames[Target].location.href=Link;
            }
      }
      function GetCalendar(CalForm,CalObj){
      	//alert("sfsf");
      	openCalendarWindow('calendar.asp?rform=' +CalForm + '&rObject=' + CalObj,230,215,'false');
}
function openCalendarWindow (sURL, iWidth, iHeight, sScrollbars) {
		var sWindowAttributes;
		var newWindow;
		var iTop;
		var iLeft;
		var sWindowName;
   
		// default screen dimensions...
		var iScreenWidth  = 800; 
		var iScreenHeight = 600;
   
		if ( window.screen ) {
		   // IE4+ and NS4+ provide actual screen dimensions...
		   iScreenWidth  = window.screen.width;  
		   iScreenHeight = window.screen.height;
		}

		// Determine proper location of the new window
		iTop  = ( iScreenHeight / 2 ) -  ( iHeight / 2 );
		iLeft = ( iScreenWidth / 2 )  -  ( iWidth / 2 );
   
		sWindowAttributes = sScrollbars + ',resizable,' + 
		                    'top=' + iTop + ',' + 
		                    'left=' + iLeft + ',' +
		                    'width=' + iWidth + ',' +
		                    'height=' + iHeight;
   
	//	sWindowName = new Date();
	//	sWindowName = sWindowName.getMilliseconds();
	//	sWindowName = sWindowName.toString();
		sWindowName = "MITCalendar";
		newWindow = window.open(sURL, sWindowName, sWindowAttributes);
		newWindow.focus();
}
function numKey(){
	var kc=getKeyCode();
	if(57>=kc&&kc>=48)
	return true;
	return false;
	}