/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}

function isBlank(myObj) {  if(myObj.value=='' || myObj.value=='- Date -' || myObj.value=='- Month -' || myObj.value=='- Year -' || myObj.value=='Select') { return true; } return false; }
function isEmail(str) {
var supported = 0;
if (window.RegExp) {
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);
	if (tempReg.test(tempStr)) supported = 1;
}
if (!supported) 
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
return (!r1.test(str) && r2.test(str));
}
function verifycontact() {
	with(document.frmcontact) {
		
		if(isBlank(Fullname)) {	alert("Please Insert Fullname"); Fullname.focus(); return false; }
		if(isBlank(Email)) {	alert("Please Insert Email"); Email.focus(); return false; }
		if(isEmail(Email)) {	alert("Please Insert Email Format"); Email.focus(); return false; }
		//if(isBlank(country)) {	alert("Please Insert Country"); country.focus(); return false; }	
		//if(isBlank(Phone)) {	alert("Please Insert Phone"); Phone.focus(); return false; }	
		if(isBlank(captchacode)) {	alert("Please Insert Verifly Image"); captchacode.focus(); return false; }	
	
		
		//if(isBlank(txtMail)) {	alert("เธเธฃเธธเธ“เธฒเธเธดเธกเธเน e-mail"); txtMail.focus(); return false; }
		//if(!isBlank(txtMail)) { if(!isEmail(txtMail.value)) {	alert("เธฃเธนเธเนเธเธเธเธญเธ e-mail เนเธกเนเธ–เธนเธเธ•เนเธญเธเธเนเธฐ !!"); txtMail.focus(); return false; } }
		}
	return true;
}

