function exit()
{
var answer = confirm("Are you sure? Click OK to Exit. All unsaved details may lost !");
if (answer)

window.location="transact-user.php?action=Logout";
}


function check_empty()
{
	if(document.searchFrm.keyword.value == "")
	{
		alert("Please enter the Keyword you want to search.");
		return false;
		document.searchFrm.keyword.focus();
	}
	return true;
}
    

if (document.images) {
	smile = new Image
	nosmile = new Image

	smile.src = "images/hot2.png"
	nosmile.src = "images/hot1.png"
	
	ch = new Image
	chout = new Image

	ch.src = "images/hot4.png"
	chout.src = "images/hot3.png"
	
	
	ho3in = new Image
	ho3out = new Image

	ho3in.src = "images/hot6.png"
	ho3out.src = "images/hot5.png"
	
}


function swapImage(thisImage,newImage) {
	if (document.images) {
		document[thisImage].src = eval(newImage + ".src")
	}
}



function submitenterkey(myfield,e)
{

var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13)
{
validateForm2();
return false;
}
else
return true;
}

function validateForm2() 
{
 var okSoFar=true
 with (document.form2)
 {
 
  if (email.value=="")
  {
     okSoFar=false
 	alert ("Please Enter E-mail .")
	email.focus()
   }	
   else if(!check_form())
	 {
	 	okSoFar=false;
	 }
   else
	 {
	 	okSoFar=true;
	 }
	 
	 
    if (okSoFar==true)  submit();
	}}



function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}	
} 

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two))
{
return (-1);		
} 

}

}


function check_form() {

// check the first email address ( the exclamation means "not" )
if(!check_email(form2.email.value)){
alert("Please enter valid email address here");
form2.email.focus(); 
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
//form2.email.style.background = "yellow";
}
// make sure the form is not submitted
return false;
}
return true;
}

