window.defaultStatus="Earn money by filling out top paying surveys!";

if (document.all) {
	document.onmouseover = showLink;
}

function showLink() {
if (window.event.srcElement.tagName == "A") {
if (window.event.srcElement.innerText != "") {
	window.status = window.event.srcElement.innerText; return true;
	}
}
if (window.event.srcElement.tagName == "img" && window.event.srcElement.parentElement.tagName =="A" ) 	{
		window.status = window.event.srcElement.alt; return true;
	}
}
var testmonialtext1 = "Check this out. It provides valuable info in making money taking online surveys. Check out the info on the right of the home page for tips in preventing yourself from being scammed.";
var testmonialname1 = "Curtis Swartz";
var testmonialtext2 = "i just wanted you to try this it never hurts to be able to get extra money. Here is a list of free survey sites that are most popular. And the best part is they are available in your area";
var testmonialname2 = "Michelle Haynes";





var isPopUp = true;

//******************************************************************
// Validates content of fields
//******************************************************************
function checkfield(fieldlabel,fieldname,acceptonly){
var s= new String();
	characters = new RegExp ("[^A-Za-z ]","i");
	numbers = new RegExp ("[^0-9]","i");
	numchar = new RegExp ("[^0-9-^A-Za-z ]","i");
	s = document.form1[fieldname].value;2/2/2006
	result = s.search(eval(acceptonly));
	if (result != -1){
		if (acceptonly == "numchar")
		{
			msg = fieldlabel + " can only contain numbers and characters" + ".";
		}
		else if  (acceptonly == "numbers")
		{
			msg = fieldlabel + " can only contain numbers" + ".";
		}
		else
		{
			msg = fieldlabel + " can only contain characters" + ".";
		}
		document.form1[fieldname].value = ""
		alert(msg);
		document.form1[fieldname].focus();
		return false;
	}
}
//----------------------------------------------------------	
function isFirstNameOK(){
	var field_val=document.form1.firstname.value.replace(/[ ]/g, "");
	if (field_val.length==0){
		alert('Please type your first name');
		document.form1.firstname.value=""
		document.form1.firstname.focus();
		return false;
		}
	return true;
}

function isLastNameOK(){
	var field_val=document.form1.lastname.value.replace(/[ ]/g, "");
	if (field_val.length==0){
		alert('Please type your last name');
		document.form1.lastname.value=""
		document.form1.lastname.focus();
		return false;
		}
	return true;
}

function isGenderOK(){
	var field_val=document.form1.gender.value.replace(/[ ]/g, "");
	if (field_val.length==0){
		alert('Please select your gender.');
		document.form1.gender.focus();
		return false;
	}
return true;
}

function isAgeOK(){
	var field_val=document.form1.age.value.replace(/[ ]/g, "");
	if (field_val.length==0){
		alert('Please select your Age group.');
		document.form1.age.focus();
		return false;
	}
return true;
}

function isZipOK(){
	var field_val=document.form1.zip.value.replace(/[ ]/g, "");
	if (field_val.length<5){
		alert('Please type your postal Zip Code.');
		document.form1.zip.value=""
		document.form1.zip.focus();
		return false;
		}
	return true;
}


function isEMailOK(){
	var emstr;  // e-mail string
	var emstr_confirm;  // e-mail string
	var sht;    // '@' position in e-mail
	var dot;    // '.' position in e-mail
	var Wrongsim='"' + " :*'!%+=;,/#";
	
	emstr=document.form1.email.value.toLowerCase();

	sht=emstr.indexOf('@');
	dot=emstr.indexOf('.');

	if(sht==-1 || dot==-1)
		{
		alert("Invalid E-mail!\nPlease Type Again.");
		document.form1.email.value="";
		document.form1.email.focus();
		return false;
		}
	if(sht==0||dot==0)
		{
		alert("Invalid E-mail!\nPlease Type Again.");
		document.form1.email.value="";
		document.form1.email.focus();
		return false;
		}
	if(emstr.charAt(emstr.length-1)=='@'||emstr.charAt(emstr.length-1)=='.')
		{
		alert("Invalid E-mail!\nPlease Type Again.");
		document.form1.email.value="";
		document.form1.email.focus();
		return false;
		}
	if(emstr.split('@').length!=2)
		{
		alert("Invalid E-mail!\nPlease Type Again.");
		document.form1.email.value="";
		document.form1.email.focus();
		return false;
		}
	if(emstr.split('@')[1].indexOf('.')==-1||emstr.split('@')[1].indexOf('.')==0)
		{
		alert("Invalid E-mail!\nPlease Type Again.");
		document.form1.email.value="";
		document.form1.email.focus();
		return false;
		}
	for(i=0;i<emstr.length;i++)
		{
		if(Wrongsim.indexOf(emstr.charAt(i))!=-1)
			{
			alert("Invalid E-mail!\nPlease Type Again.");
			document.form1.email.value="";
			document.form1.email.focus();
			return false;
			}
		}
	return true;
}

function changeObjectVisibility(objectId, newVisibility, newDisplay) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
        styleObject.display = newDisplay;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
}

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject


function hideDiv(objectId){
  changeObjectVisibility(objectId,'hidden','none');
}
function showDiv(objectId){
  changeObjectVisibility(objectId,'visible','block');
}


function unhide(divID) {
 var item = document.getElementById(divID);
 if (item) {
 item.className=(item.className=='hidden')?'unhidden':'hidden';
 }
 }









function doSubmitStep(){
var isFormOk = false
isIncomplete = false;
if(true)
{	if (isGenderOK() &&  isAgeOK() && isZipOK() && isFirstNameOK() && isLastNameOK() && isEMailOK())
	{	isFormOk = true;
	}
	else
	{	return false;
	}
}
	if(isFormOk){
		document.form1.submit();
	}
}
function doSubmitStepAll(){
var isFormOk = false
isIncomplete = false;
if(true){
 if (isGenderOK() &&  isAgeOK() && isZipOK() && isFirstNameOK() && isLastNameOK() && isEMailOK())
 {
	isFormOk = true;
 }else{
	return false;
	}
 }
 if(isFormOk){
	var i;
	for (i=0; i < document.form1.elements.length; i++) 
	{
		if (document.form1.elements[i].type == 'checkbox' && document.form1.elements[i].name!="SelectAllCheckBox") {
		 document.form1.elements[i].checked = true;
	}
	}
	document.form1.submit();
	}
}

function referfriendvalidate()
{
	var status=false;
	if(isBlank(document.form1.friendsname.value) || !isChar(document.form1.friendsname.value)) 
	{
		alert("Please Enter your Friends Name");
		document.form1.friendsname.select();
		status =  false;
	}
	else if(isBlank(document.form1.friendsemail.value) || !emailCheck(document.form1.friendsemail.value)) 
	{	alert("Please enter Friends Email Address");
		document.form1.friendsemail.select();
		status =  false;
	}
	else
	{
		status=true;
		document.form1.submit();
	}
	return status;
}
function showHide(){
	if (document.getElementById) {
	path2 = document.getElementById('partneroffers').style;
    }
	else if (document.all) {
	path2 = document.all.partneroffers.style;
	}
	if (document.forms['form1'].elements['lastname'].selectedIndex != 0) {
	path2.display = "block";
	}
}

function validateunsubscribeform(){
var isFormOk = false
isIncomplete = false;
if(true){
 if (isEMailOK())
 {
	isFormOk = true;
 }else{
	return false;
	}
 }
 if(isFormOk){
		document.form1.submit();
	}
}

function addfav () {
var bookmarkurl="http://www.SurveyJobOpportunities.com"
var bookmarktitle="Best Online Paid Survey Jobs | Legitimate Paid Survey Sites | Get Paid to take Online Survey"
if (document.all) {
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
}
