﻿function MouseHover(id,imagePath)
{
	document.getElementById(id).src=imagePath;
	document.getElementById(id).style.cursor="hand";
}
function MouseOut(id,imagePath)
{
	document.getElementById(id).src=imagePath;
	document.getElementById(id).style.cursor="default";
}



function SearchClick(inputID)
{
	var keyword = document.getElementById(inputID).value;
	window.location="SearchEngine.aspx?key="+ keyword +'&lookingfor=title';
}
function enterButton(btnID)
{
	document.getElementById(btnID).focus();
}
function onClearTextBoxWhenFocus(id)
{
	document.getElementById(id).value='';
}
function onResetTextBoxWhenBlur(id,text)
{
	if(document.getElementById(id).value =="")
	{
		document.getElementById(id).value=text;
	}
}
function Numeric(myid,Value,lang)
{
  this.id=document.getElementById(myid);
  this.currentValue=Value;	
  this.changeValue=this.id.value;	
  this.re= new RegExp('^[0-9]*$'); 
  this.lang=lang;
}
Numeric.prototype.checkNumeric=function()
{
	if (this.changeValue !='' && this.changeValue > 0 && this.changeValue.match(this.re)) 
	{
		var a;
	} 
	else 
	{
		this.id.value=this.currentValue;
		if(this.lang=='vi-VN')
		{
			alert('Giá trị nhập vào phải là số nguyên và > 0');
		}
		else
		{
			alert('This value is entered incorrect, it must be rather than zero');
		}			
		this.id.focus();
	}  
}
function isNumeric(myid,Value,lang)
{
	var obj = new Numeric(myid,Value,lang);
	obj.checkNumeric();
}