var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function alphaImage(strPath, intWidth, intHeight) 
{ 
	if (isIE)
	{
	   document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" /></div>');
	}
	else
	{
	   document.write('<img src="'+strPath+'.png" border="0" height='+intHeight+' width='+intWidth+' />');
	}
}

function validatComment()
{
   var a = 1;
   
   if(!document.contact.name.value) 
   {
	  a = 0;
   }
   if(!document.contact.comment.value) 
   {
	  a = 0;
   }
   if(invalidEmail(document.contact.email.value)) 
   {
	  a = 0;
   }
   if(a == 0)
   {
      alert("Please fill out all question.");
   }
   
   if(a == 1)
   {
      document.contact.submit();
   }
}

function validateSurvey()
{
   var a = 1;
   
   if(!document.survey.comment.value) 
   {
	  a = 0;
   }
   if(invalidEmail(document.survey.email.value)) 
   {
	  a = 0;
   }
   if(!document.survey.service[0].checked && !document.survey.service[1].checked && !document.survey.service[2].checked && !document.survey.service[3].checked && !document.survey.service[4].checked)
   {
	  a = 0;
   }
   if(!document.survey.speed[0].checked && !document.survey.speed[1].checked && !document.survey.speed[2].checked && !document.survey.speed[3].checked && !document.survey.speed[4].checked)
   {
	  a = 0;
   }
   if(!document.survey.value[0].checked && !document.survey.value[1].checked && !document.survey.value[2].checked && !document.survey.value[3].checked && !document.survey.value[4].checked)
   {
	  a = 0;
   }
   if(a == 0)
   {
      alert("Please fill out all question.");
   }
   
   if(a == 1)
   {
      document.survey.submit();
   }
}

function invalidEmail( email ) {
		if( email == "" ) {
			return true;
		}
		atPos = email.indexOf("@");
		if( atPos == -1 ) {
			return true;
		}
		if(email.indexOf(".", atPos) == -1 ) {
			return true;
		}    
		return false;  
}