<!--

//---OAS config ---

//configuration
OAS_url = 'http://halo.date.com/RealMedia/ads/';
OAS_sitepage = 'info.date.com/';
OAS_listpos = '';
pathname = window.location.pathname.toLowerCase();
OAS_query = '';
OAS_target = '_top';
//end of configuration

OAS_version = 10;
OAS_rn = '001234567890'; OAS_rns = '1234567890';
OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);

function OAS_NORMAL(pos) {}
function OAS_RICH(pos){}
function OAS_AD(pos) {}
function INFO_OAS_AD_728_90() {}
function INFO_OAS_AD_160_600() {}

//---OAS config end ---


popup = null;
function winpop(loc,w,h,scroll) {
    if(popup) { popup.close() };
	popup = window.open(loc,'gallery','width='+w+', height='+h+', location=no, directories=no, menubar=no, scrollbars='+scroll+', resizable=no, status=no, toolbar=no');
}
function advertise() {
  winpop('http://www.date.com/advertising/index.jsp','640','375','yes');
}
function checkMail(){
  if (document.emailist.email.value.length < 1){
      alert("Please input your email address");
      document.emailist.email.focus();
      return;
  }else{
        email = document.emailist.email.value;
        if(!isValidEmail(email)){
                alert("Please enter a valid email address.");
                document.emailist.email.focus();
                return;
        }else if(email.indexOf('date.com')>0){
		alert("You can't use your date.com email.");
	}else{
  		document.emailist.submit();
	}
  }
}
function validateEmail(form, field) {
	email = document.forms[form][field].value;
	if (email.length < 1){
		alert("Please input your email address");
		document.forms[form][field].focus();
		return;
	}else{
		if(!isValidEmail(email)){
			alert("Please enter a valid email address.");
			document.forms[form][field].focus();
			return;
		}else{
			document.forms[form].submit();
		}
	}
}
function validateFeedBack(){
        var contactEmail = document.feedback.email.value;
        if(contactEmail == "")
        {
                alert("A contact email, your Username, name and phone number are required!");
                document.feedback.email.focus();
                return;
        }
        if(!isValidEmail(contactEmail)){
                alert("Please enter a valid email address.");
                document.feedback.email.focus();
                return;
        }
        var username = document.feedback.username.value;
        if(username == "")
        {
                alert("Your Username is required !");
                document.feedback.username.focus();
                return;
        }

        var name = document.feedback.name.value;
        if(name == "") {
                alert("Please input your name and phone number!");
                document.feedback.name.focus();
                return;
        }
        var phone = document.feedback.phonenumber.value;
        if(phone == "") {
                alert("Your phone number is needed!");
                document.feedback.phonenumber.focus();
                return;
        }
        var story = document.feedback.story.value;
        if(story == "")
        {
                alert("Please do not forget your story!");
                document.feedback.story.focus();
                return;
        }
        document.feedback.submit();
}
/**
 * Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
 * http://javascript.internet.com
 */
function isValidEmail(emailStr) {
   if (emailStr.length == 0) {
       return true;
   }
   var emailPat=/^(.+)@(.+)$/;
   var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]!%";
   var validChars="\[^\\s" + specialChars + "\]";
   var quotedUser="(\"[^\"]*\")";
   var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
   var atom=validChars + '+';
   var word="(" + atom + "|" + quotedUser + ")";
   var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
   var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
   var matchArray=emailStr.match(emailPat);
   if (matchArray == null) {
       return false;
   }
   var user=matchArray[1];
   var domain=matchArray[2];
   if (user.match(userPat) == null) {
       return false;
   }
   var IPArray = domain.match(ipDomainPat);
   if (IPArray != null) {
       for (var i = 1; i <= 4; i++) {
          if (IPArray[i] > 255) {
             return false;
          }
       }
       return true;
   }
   var domainArray=domain.match(domainPat);
   if (domainArray == null) {
       return false;
   }
   var atomPat=new RegExp(atom,"g");
   var domArr=domain.match(atomPat);
   var len=domArr.length;
   if ((domArr[domArr.length-1].length < 2) ||
       (domArr[domArr.length-1].length > 3)) {
       return false;
   }
   if (len < 2) {
       return false;
   }
   return true;
}

function dateBrowse(){
   var leftPos = 200;
   var topPos = 100;
   var country = document.f1.country.value;
   var rel = document.f1.rel.value;
   var age = document.f1.age.value;
   var action = document.f1.action;
   window.open(action+'?country='+country+'&rel='+rel+'&age='+age, '', 'width=800,height=600,scrollbars=yes,resizable=yes,titlebar=yes,status=yes, location=yes, menubar=yes, toolbar=yes, top=' + topPos + ',left=' + leftPos); 

}
function getById(tag)
{
  if (document.getElementById) //  Netscape, Mozilla, etc. 
  {
    return document.getElementById(tag);
  }
  else if (document.all)      //  IE, Konqueror, etc.
  {
	return document.all[tag];
  }
}
//-->

