function highlightBackground(id_One, idTwo) 
{	
	document.getElementById('subject_section').style.backgroundColor='#FFFFFF';
	document.getElementById('email_section').style.backgroundColor='#FFFFFF';
	document.getElementById('name_section').style.backgroundColor='#FFFFFF';
	document.getElementById('phoneNumber_section').style.backgroundColor='#FFFFFF';
	document.getElementById('message_section').style.backgroundColor='#FFFFFF';
	document.getElementById(id_One).style.backgroundColor='#ffe4b5';
	
	document.getElementById('name_section_right').style.display='none';
	document.getElementById('phonenumber_section_right').style.display='none';
	document.getElementById('message_section_right').style.display='none';
	document.getElementById('email_section_right').style.display='none';
	if ( idTwo != '' )
	{
		document.getElementById(idTwo).style.display='block';
	}
	if ( idTwo == 'email_section_right' )
	{
		document.getElementById('logo_right').style.display='none';
	}
	else
	{
		document.getElementById('logo_right').style.display='block';
	}
}
function roll( img_name, img_src )
{
	document[img_name].src = img_src;
}
function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}
function validateAccountSettings(emailOne, emailTwo)
{	
	//alert("Email One: " + emailOne);
	//alert("Email Two: " + emailTwo);
	
	if ( emailOne == "" && emailTwo == "" )
	{
		document.userSettingsForm.accountSettingsRefresh.value = rand ( 1000 );
		return true;
	}
	
	if( emailOne != emailTwo )
	{
		alert( "Email addresses Entered DO NOT Match\n\nPlease Re-enter your Email Address!" );
		document.getElementById('email').select();
		return false;
	}
	
	if( emailCheck( emailOne ) == false )
	{
		alert( "INVALID Email address FORMAT!\n\nPlease Re-Enter with Correct Format!" );
		document.getElementById('email').select();
		return false;
	}
	
	if( emailCheck( emailTwo ) == false )
	{
		alert( "INVALID Email address FORMAT!\n\nPlease Re-Enter with Correct Format!" );
		document.getElementById('email').select();
		return false;
	}
	
	document.userSettingsForm.accountSettingsRefresh.value = rand ( 1000 );
	return true;
}
function validatePhoneNumberCodeForm(code,password,repassword)
{
	if(code.length==0 || code=="Enter Validation Code")
	{
		alert("You Must Enter Your Validation Code!\n\nThe Validation Code is Received to the Phone Number You are attampting to 'Claim' Via 'Text Message' or an 'Automated Phone Call'!");
		document.validateYourNumber.validationCode.style.borderColor='#FF0000';
		document.validateYourNumber.validationCode.style.border.width='15';
		document.validateYourNumber.validationCode.style.color='#122F5C';
		document.validateYourNumber.validationCode.value="";
		document.validateYourNumber.validationCode.focus();
		return false;
	}
	else if(code.length!=6)
	{
		alert("Your Validation Code Must be 6 Charactors in Length!\n\nThe Validation Code is Received to the Phone Number You are attampting to 'Claim' Via 'Text Message' or an 'Automated Phone Call'!");
		document.validateYourNumber.validationCode.style.borderColor='#FF0000';
		document.validateYourNumber.validationCode.style.border.width='15';
		document.validateYourNumber.validationCode.value="";
		document.validateYourNumber.validationCode.focus();
		return false;
	}
	else
	{
		ref="0123456789";
		result=1;
		
		for(count=0;count < code.length; count++)
		{
			chr=code.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=code.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Validation Code Contains an Invalid Charactor '" +chr+ "' at Offset "+offset+"!";
			alert(errorMsg);
			document.validateYourNumber.validationCode.style.borderColor='#FF0000';
			document.validateYourNumber.validationCode.style.border.width='15';
			document.validateYourNumber.validationCode.value='';
			document.validateYourNumber.validationCode.focus();
			return false;
		}
		else
		{
			document.validateYourNumber.validationCode.style.borderColor='#000000';
			document.validateYourNumber.validationCode.style.border.width='0';
		}
	}
	if (password==repassword)
	{
		if(password.length==0)
		{
			alert("You Must Enter A Password for Your New Called.com Account!");
			document.validateYourNumber.password.style.borderColor='#FF0000';
			document.validateYourNumber.password.style.border.width='15';
			document.validateYourNumber.password.style.color='#122F5C';
			document.validateYourNumber.password.value="";
			document.validateYourNumber.repassword.value="";
			document.validateYourNumber.password.focus();
			return false;
		}
		else if(password.length<7)
		{
			alert("A Valid Password Must be at Least 7 Charactors in Length!\n\nPlease Enter a Valid Password!");
			document.validateYourNumber.password.style.borderColor='#FF0000';
			document.validateYourNumber.password.style.border.width='15';
			document.validateYourNumber.password.value="";
			document.validateYourNumber.repassword.value="";
			document.validateYourNumber.password.focus();
			return false;
		}
		else if(password.length>14)
		{
			alert("A Valid Password CANNOT exceed 14 Charactors in Length!\n\nPlease Enter a Valid Password!");
			document.validateYourNumber.password.style.borderColor='#FF0000';
			document.validateYourNumber.password.style.border.width='15';
			document.validateYourNumber.password.value="";
			document.validateYourNumber.repassword.value="";
			document.validateYourNumber.password.focus();
			return false;
		}
		else
		{
			ref="!@-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
			result=1;
			
			for(count=0;count < password.length; count++)
			{
				chr=password.substring(count,count+1);
			
				if(ref.indexOf(chr)<0)
				{
					result=0;
					offset=count+1;
					count=password.length;
				}
			}
			if(result==0)
			{
				var errorMsg="Password Contains an Invalid Charactor '" +chr+ "' at Offset "+offset+"!\n\nPasswords May Contain Letters, Numbers and ONLY these '!@-_' Special Charactors!";
				alert(errorMsg);
				document.validateYourNumber.password.style.borderColor='#FF0000';
				document.validateYourNumber.password.style.border.width='15';
				document.validateYourNumber.password.value='';
				document.validateYourNumber.repassword.value='';
				document.validateYourNumber.password.focus();
				return false;
			}
			else
			{
				document.validateYourNumber.password.style.borderColor='#000000';
				document.validateYourNumber.password.style.border.width='0';
			}
		}
	}
	else
	{	
		alert("Passwords DO NOT MATCH!\n\nPlease Try Again!");
		document.validateYourNumber.password.style.borderColor='#FF0000';
		document.validateYourNumber.password.style.border.width='15';
		document.validateYourNumber.password.style.color='#122F5C';
		document.validateYourNumber.password.value="";
		document.validateYourNumber.password.focus();
		
		document.validateYourNumber.repassword.value="";
		return false;	
	}
	
	document.validateYourNumber.validateCodeRefresh.value = rand ( 1000 );
	return true;	
}
function formValidation()
{if(document.getElementById('author').value=='')
{alert("You must add your name or alias in the \"name\" field to submit your comment!");document.getElementById('author').style.borderColor='#FF0000';document.getElementById('author').focus();return false;}
if(document.getElementById('callerType').selectedIndex==0)
{alert("A \"Caller Type\" must be Identified!\n\nPlease choose from the dropdown menu!");document.getElementById('callerType').style.borderColor='#FF0000';document.getElementById('author').style.borderColor='#26508C';return false;}
if(document.getElementById('comment').value=='')
{alert("The \"Call Comment\" field must be filled in!\n\nPlease include all your comments!");document.getElementById('comment').style.borderColor='#FF0000';document.getElementById('comment').focus();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';return false;}
if(document.getElementById('captcha_code').value=='')
{alert("The \"Validation Code\" field must be properly filled in!\n\nMust use all CAPITAL letters!");document.getElementById('captcha_code').style.borderColor='#FF0000';document.getElementById('captcha_code').focus();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';document.getElementById('captcha_code').style.borderColor='#26508C';return false;}
return true;}

function myTempOne()
{
	document.commentform.refresh.value = rand ( 1000 );
	return true;
}

function myTempTwo()
{
	if(document.getElementById('captcha_code').value=='' || document.getElementById('captcha_code').value.length<6 || document.getElementById('captcha_code').value.length>6)
	{alert("The \"Validation Code\" field must be properly filled in to submit your comment!");document.getElementById('captcha_code').style.borderColor='#FF0000';document.getElementById('captcha_code').focus();document.getElementById('captcha_code').select();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';return false;}
	
	document.commentform.refresh.value = rand ( 1000 );
	return true;
}
function newCommentFormValidationOne()
{if(document.getElementById('author').value=='')
{alert("You must add your name or alias in the \"name\" field to submit your comment!");document.getElementById('author').style.borderColor='#FF0000';document.getElementById('author').focus();return false;}
else{
	var count=0;
	var ref=" 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('author').value.length;count++)
	{
		chr=document.getElementById('author').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('author').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Name\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors are allowed (letters a-z and number 0-9)!";
		alert(errorMsg);
		document.getElementById('author').style.borderColor='#FF0000';
		document.getElementById('author').focus();
		document.getElementById('author').select();
		return false;
	}
	else
	{
		document.getElementById('author').style.borderColor='#26508C';
	}
}
if(document.getElementById('callerType').selectedIndex==0)
{alert("A \"Caller Type\" must be Identified!\n\nPlease choose from the dropdown menu!");document.getElementById('callerType').style.borderColor='#FF0000';document.getElementById('author').style.borderColor='#26508C';return false;}
if(document.getElementById('comment').value=='')
{alert("The \"Call Comment\" field must be filled in!\n\nPlease include all your comments!");document.getElementById('comment').style.borderColor='#FF0000';document.getElementById('comment').focus();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';return false;}
else{
	var count=0;
	var ref=" .,!?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('comment').value.length;count++)
	{
		chr=document.getElementById('comment').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('comment').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Comment\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors (letters a-z and number 0-9) and punctuation charactors (. , ! ?) are allowed!";
		alert(errorMsg);
		document.getElementById('comment').style.borderColor='#FF0000';
		document.getElementById('comment').focus();
		document.getElementById('comment').select();
		return false;
	}
	else
	{
		document.getElementById('comment').style.borderColor='#26508C';
	}
}
if(document.getElementById('captcha_code').value=='' || document.getElementById('captcha_code').value.length<6 || document.getElementById('captcha_code').value.length>6)
{alert("The \"Validation Code\" field must be properly filled in to submit your comment!");document.getElementById('captcha_code').style.borderColor='#FF0000';document.getElementById('captcha_code').focus();document.getElementById('captcha_code').select();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';return false;}
document.commentform.refresh.value = rand ( 1000 );
return true;}
function newCommentFormValidationTwo()
{if(document.getElementById('author').value=='')
{alert("You must add your name or alias in the \"name\" field to submit your comment!");document.getElementById('author').style.borderColor='#FF0000';document.getElementById('author').focus();return false;}
else{
	var count=0;
	var ref=" 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('author').value.length;count++)
	{
		chr=document.getElementById('author').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('author').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Name\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors are allowed (letters a-z and number 0-9)!";
		alert(errorMsg);
		document.getElementById('author').style.borderColor='#FF0000';
		document.getElementById('author').focus();
		document.getElementById('author').select();
		return false;
	}
	else
	{
		document.getElementById('author').style.borderColor='#26508C';
	}
}
if(document.getElementById('callerType').selectedIndex==0)
{alert("A \"Caller Type\" must be Identified!\n\nPlease choose from the dropdown menu!");document.getElementById('callerType').style.borderColor='#FF0000';document.getElementById('author').style.borderColor='#26508C';return false;}
if(document.getElementById('comment').value=='')
{alert("The \"Call Comment\" field must be filled in!\n\nPlease include all your comments!");document.getElementById('comment').style.borderColor='#FF0000';document.getElementById('comment').focus();document.getElementById('callerType').style.borderColor='#26508C';document.getElementById('author').style.borderColor='#26508C';return false;}
else{
	var count=0;
	var ref=" .,!?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('comment').value.length;count++)
	{
		chr=document.getElementById('comment').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('comment').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Comment\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors (letters a-z and number 0-9) and punctuation charactors (. , ! ?) are allowed!";
		alert(errorMsg);
		document.getElementById('comment').style.borderColor='#FF0000';
		document.getElementById('comment').focus();
		document.getElementById('comment').select();
		return false;
	}
	else
	{
		document.getElementById('comment').style.borderColor='#26508C';
	}
}
document.commentform.refresh.value = rand ( 1000 );
return true;}
function findPhoneFormValidationOne()
{if(document.getElementById('author').value=='')
{alert("You must add your name or alias in the \"name\" field to submit your comment!");document.getElementById('author').style.borderColor='#FF0000';document.getElementById('author').focus();return false;}
else{
	var count=0;
	var ref=" 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('author').value.length;count++)
	{
		chr=document.getElementById('author').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('author').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Name\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors are allowed (letters a-z and number 0-9)!";
		alert(errorMsg);
		document.getElementById('author').style.borderColor='#FF0000';
		document.getElementById('author').focus();
		document.getElementById('author').select();
		return false;
	}
	else
	{
		document.getElementById('author').style.borderColor='#26508C';
	}
}
if(document.getElementById('comment').value=='')
{alert("The \"Call Comment\" field must be filled in!\n\nPlease include all your comments!");document.getElementById('comment').style.borderColor='#FF0000';document.getElementById('comment').focus();document.getElementById('author').style.borderColor='#26508C';return false;}
else{
	var count=0;
	var ref=" .,!?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('comment').value.length;count++)
	{
		chr=document.getElementById('comment').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('comment').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Comment\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors (letters a-z and number 0-9) and punctuation charactors (. , ! ?) are allowed!";
		alert(errorMsg);
		document.getElementById('comment').style.borderColor='#FF0000';
		document.getElementById('comment').focus();
		document.getElementById('comment').select();
		return false;
	}
	else
	{
		document.getElementById('comment').style.borderColor='#26508C';
	}
}
if(document.getElementById('captcha_code').value=='' || document.getElementById('captcha_code').value.length<6 || document.getElementById('captcha_code').value.length>6)
{alert("The \"Validation Code\" field must be properly filled in to submit your comment!");document.getElementById('captcha_code').style.borderColor='#FF0000';document.getElementById('captcha_code').focus();document.getElementById('captcha_code').select();document.getElementById('author').style.borderColor='#26508C';return false;}
document.getElementById('commentRefresh').value = rand ( 1000 );
return true;}
function findPhoneFormValidationTwo()
{if(document.getElementById('author').value=='')
{alert("You must add your name or alias in the \"name\" field to submit your comment!");document.getElementById('author').style.borderColor='#FF0000';document.getElementById('author').focus();return false;}
else{
	var count=0;
	var ref=" 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('author').value.length;count++)
	{
		chr=document.getElementById('author').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('author').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Name\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors are allowed (letters a-z and number 0-9)!";
		alert(errorMsg);
		document.getElementById('author').style.borderColor='#FF0000';
		document.getElementById('author').focus();
		document.getElementById('author').select();
		return false;
	}
	else
	{
		document.getElementById('author').style.borderColor='#26508C';
	}
}
if(document.getElementById('comment').value=='')
{alert("The \"Call Comment\" field must be filled in!\n\nPlease include all your comments!");document.getElementById('comment').style.borderColor='#FF0000';document.getElementById('comment').focus();document.getElementById('author').style.borderColor='#26508C';return false;}
else{
	var count=0;
	var ref=" .,!?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'";
	var result=1;
	var chr="";
	var offset=0;
		
	for(count=0;count<document.getElementById('comment').value.length;count++)
	{
		chr=document.getElementById('comment').value.substring(count,count+1);
			
		if(ref.indexOf(chr)<0)
		{
			result=0;
			offset=count+1;
			count=document.getElementById('comment').value.length;
		}
	}
	if(result==0)
	{
		var errorMsg="\"Comment\" field contains an invalid charactor '"+chr+"' at offset "+offset+"!\n\nOnly alphanumerical charactors (letters a-z and number 0-9) and punctuation charactors (. , ! ?) are allowed!";
		alert(errorMsg);
		document.getElementById('comment').style.borderColor='#FF0000';
		document.getElementById('comment').focus();
		document.getElementById('comment').select();
		return false;
	}
	else
	{
		document.getElementById('comment').style.borderColor='#26508C';
	}
}
document.getElementById('commentRefresh').value = rand ( 1000 );
return true;}
function searchTop(number)
{	
	if(number.length==0)
	{
		alert("Type in a phone number and press enter!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else if(number.length<13)
	{
		alert("A Valid US Phone Number must contain 10 digits!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else if(number.length>13)
	{
		alert("A Valid US Phone Number CANNOT exceed 10 digits in Length!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else
	{
		ref="()-0123456789";
		result=1;
		
		for(count=0;count < number.length; count++)
		{
			chr=number.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=number.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Search Field contains an invalid charactor at offset "+offset+"!\n\nOnly NUMERICAL CHARACTORS 0 - 9 are allowed!";
			alert(errorMsg);
			document.searchformtop.s.style.borderColor='#FF0000';
			document.searchformtop.s.style.border.width='15';
			document.searchformtop.s.value='';
			document.searchformtop.s.focus();
			return false;
		}
		else
		{
			document.searchformtop.s.style.borderColor='#000000';
			document.searchformtop.s.style.border.width='0';
		}
	}
	return true;
}
function validatePhoneNumber(number)
{	
	if(number.length==0)
	{
		alert("Type in a phone number and press enter!");
		document.claimyournumber.phoneNumber.style.borderColor='#FF0000';
		document.claimyournumber.phoneNumber.style.border.width='15';
		document.claimyournumber.phoneNumber.value="";
		document.claimyournumber.phoneNumber.focus();
		return false;
	}
	else if(number.length<13)
	{
		alert("A Valid US Phone Number must contain 10 digits!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.claimyournumber.phoneNumber.style.borderColor='#FF0000';
		document.claimyournumber.phoneNumber.style.border.width='15';
		document.claimyournumber.phoneNumber.value="";
		document.claimyournumber.phoneNumber.focus();
		return false;
	}
	else if(number.length>13)
	{
		alert("A Valid US Phone Number CANNOT exceed 10 digits in Length!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.claimyournumber.phoneNumber.style.borderColor='#FF0000';
		document.claimyournumber.phoneNumber.style.border.width='15';
		document.claimyournumber.phoneNumber.value="";
		document.claimyournumber.phoneNumber.focus();
		return false;
	}
	else
	{
		ref="()-0123456789";
		result=1;
		
		for(count=0;count < number.length; count++)
		{
			chr=number.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=number.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Search Field contains an invalid charactor at offset "+offset+"!\n\nOnly NUMERICAL CHARACTORS 0 - 9 are allowed!";
			alert(errorMsg);
			document.claimyournumber.phoneNumber.style.borderColor='#FF0000';
			document.claimyournumber.phoneNumber.style.border.width='15';
			document.claimyournumber.phoneNumber.value='';
			document.claimyournumber.phoneNumber.focus();
			return false;
		}
		else
		{
			document.claimyournumber.phoneNumber.style.borderColor='#000000';
			document.claimyournumber.phoneNumber.style.border.width='0';
		}
	}
	document.getElementById('claimPhoneNumRefresh').value = rand ( 1000 );
	return true;
}
function findPhoneVerify(number)
{	
	if(number.length==0)
	{
		alert("Type in a phone number and press enter!");
		document.searchfindphone.findphone.style.borderColor='#FF0000';
		document.searchfindphone.findphone.style.border.width='15';
		document.searchfindphone.findphone.value="";
		document.searchfindphone.findphone.focus();
		return false;
	}
	else if(number.length<13)
	{
		alert("A Valid US Phone Number must contain 10 digits!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchfindphone.findphone.style.borderColor='#FF0000';
		document.searchfindphone.findphone.style.border.width='15';
		document.searchfindphone.findphone.value="";
		document.searchfindphone.findphone.focus();
		return false;
	}
	else if(number.length>13)
	{
		alert("A Valid US Phone Number CANNOT exceed 10 digits in Length!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchfindphone.findphone.style.borderColor='#FF0000';
		document.searchfindphone.findphone.style.border.width='15';
		document.searchfindphone.findphone.value="";
		document.searchfindphone.findphone.focus();
		return false;
	}
	else
	{
		ref="()-0123456789";
		result=1;
		
		for(count=0;count < number.length; count++)
		{
			chr=number.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=number.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Search Field contains an invalid charactor at offset "+offset+"!\n\nOnly NUMERICAL CHARACTORS 0 - 9 are allowed!";
			alert(errorMsg);
			document.searchfindphone.findphone.style.borderColor='#FF0000';
			document.searchfindphone.findphone.style.border.width='15';
			document.searchfindphone.findphone.value='';
			document.searchfindphone.findphone.focus();
			return false;
		}
		else
		{
			document.searchfindphone.findphone.style.borderColor='#000000';
			document.searchfindphone.findphone.style.border.width='0';
		}
	}
	document.searchfindphone.findPhoneRefresh.value = rand ( 1000 );
	return true;
}
function searchBottom(number)
{	
	var returnValue = true;
	
	if( number.length == 0 )
	{
		alert("Type in a phone number and press enter!");
		document.searchformbottom.s.style.borderColor='#FF0000';
		document.searchformbottom.s.style.border.width='15';
		document.searchformbottom.s.value="";
		document.searchformbottom.s.focus();
		returnValue = false;
	}
	else if( number.length < 13 )
	{
		alert("A Valid US Phone Number must contain 10 digits!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformbottom.s.style.borderColor='#FF0000';
		document.searchformbottom.s.style.border.width='15';
		document.searchformbottom.s.value="";
		document.searchformbottom.s.focus();
		returnValue = false;
	}
	else if( number.length > 13 )
	{
		alert("A Valid US Phone Number CANNOT exceed 10 digits in Length!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformbottom.s.style.borderColor='#FF0000';
		document.searchformbottom.s.style.border.width='15';
		document.searchformbottom.s.value="";
		document.searchformbottom.s.focus();
		returnValue = false;
	}
	return returnValue;
}
function searchareacodeBottom(number)
{	
	var returnValue = true;
	
	if( number.length == 0 )
	{
		alert("Type in a phone number and press enter!");
		document.searchformbottom.z.style.borderColor='#FF0000';
		document.searchformbottom.z.style.border.width='15';
		document.searchformbottom.z.value="";
		document.searchformbottom.z.focus();
		returnValue = false;
	}
	else if( number.length < 13 )
	{
		alert("A Valid US Phone Number must contain 10 digits!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformbottom.z.style.borderColor='#FF0000';
		document.searchformbottom.z.style.border.width='15';
		document.searchformbottom.z.value="";
		document.searchformbottom.z.focus();
		returnValue = false;
	}
	else if( number.length > 13 )
	{
		alert("A Valid US Phone Number CANNOT exceed 10 digits in Length!\n\nPlease Enter a 10 digit Valid Phone Number!\n\nInternational Number Formats Coming soon to Called.com");
		document.searchformbottom.z.style.borderColor='#FF0000';
		document.searchformbottom.z.style.border.width='15';
		document.searchformbottom.z.value="";
		document.searchformbottom.z.focus();
		returnValue = false;
	}
	return returnValue;
}
function validateEmailInfo()
{
var errorMsg="";if((document.mailform.fromemail.value==null)||(document.mailform.fromemail.value==""))
{errorMsg="Email Address Field Must be Filled In!\n\n";document.mailform.fromemail.focus();alert(errorMsg);return false;}
else if(emailCheck(document.mailform.fromemail.value)==false)
{document.mailform.fromemail.value=""
document.mailform.fromemail.focus();errorMsg+="INVALID Email address FORMAT!";alert(errorMsg);return false;}
if(document.mailform.firstname.value=="")
{document.mailform.firstname.focus();errorMsg+="First Name Field Must be Filled In!";alert(errorMsg);return false;}
if(document.mailform.lastname.value=="")
{document.mailform.lastname.focus();errorMsg+="Last Name Field Must be Filled In!";alert(errorMsg);return false;}
if(document.mailform.areacode.value=="")
{document.mailform.areacode.focus();errorMsg+="Area Code Field Must be Filled In!";alert(errorMsg);return false;}
if(document.mailform.exchange.value=="")
{document.mailform.exchange.focus();errorMsg+="Phone Number Field Must be Completely Filled In!";alert(errorMsg);return false;}
if(document.mailform.lastfour.value=="")
{document.mailform.lastfour.focus();errorMsg+="Phone Number Field Must be Completely Filled In!";alert(errorMsg);return false;}
if(document.mailform.message.value=="")
{errorMsg+="You Must Enter Information Into the Body of the Email!";alert(errorMsg);return false;}
document.getElementById('emailRefresh').value = rand ( 1000 );
}
function emailCheck(str)
{var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length-1;var ldot=str.indexOf(dot);if(str.indexOf(at)==-1)
{return false;}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)
{return false;}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr)
{return false;}
if(str.indexOf(at,(lat+1))!=-1){return false;}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)
{return false;}
if(str.indexOf(dot,(lat+2))==-1)
{return false;}
if(str.indexOf(" ")!=-1)
{return false;}
return true;}
function validateSMS()
{
	var errorMsg="";

	if((document.mailform.fromemail.value==null)||(document.mailform.fromemail.value==""))
	{
		errorMsg="Email Address Field Must be Filled In!\n\n";
		document.mailform.fromemail.focus();
	}
	else if(emailCheck(document.mailform.fromemail.value)==false)
	{
		document.mailform.fromemail.value=""
		document.mailform.fromemail.focus();
		errorMsg+="INVALID Email address FORMAT!\n\n";
	}

	if(document.mailform.toEmail.value=="")
	{
		errorMsg+="SMS Email Address Field Must be Filled In!\n\n";
	}

	if(document.mailform.subject.value=="")
	{
		if ( errorMsg == "" )
		{
			document.mailform.subject.focus();	
		}

		errorMsg+="Subject Field Must be Filled In!\n\n";
	}

	if(document.mailform.firstname.value=="")
	{
		if ( errorMsg == "" )
		{
			document.mailform.firstname.focus();	
		}
		errorMsg+="First Name Field Must be Filled In!\n\n";
	}

	if(document.mailform.lastname.value=="")
	{
		if ( errorMsg == "" )
		{
			document.mailform.lastname.focus();	
		}

		errorMsg+="Last Name Field Must be Filled In!\n\n";
	}

	if(document.mailform.areacode.value=="")
	{
		errorMsg+="Area Code Field Must be Filled In!\n\n";
	}

	if(document.mailform.exchange.value=="")
	{
		errorMsg+="Exchange Field Must be Filled In!\n\n";
	}

	if(document.mailform.lastfour.value=="")
	{
		errorMsg+="Last Four Field Must be Filled In!\n\n";
	}

	if(document.mailform.message.value=="")
	{
		if ( errorMsg == "" )
		{
			document.mailform.message.focus();	
		}

		errorMsg+="Cannot send an empty/blank SMS text message! Enter SMS text message to send\n\n";
	}
	
	if(errorMsg!="")
	{
		alert(errorMsg);
		return false;
	}	
}
function getScreenWidth() {
	var result = 2000;

	if (window.innerWidth) {
		// all except Explorer
		result = parseInt(window.innerWidth);
	} else if (document.documentElement && document.documentElement.clientWidth) {
		// Explorer 6 Strict Mode
		result = parseInt(document.documentElement.clientWidth);
	} else if (document.body) {
		// other Explorers
		result = parseInt(document.body.clientWidth);
	}
	if (isNaN(result)) {
		result = 2000;
	}
	return result;
}
function getScreenHeight() {
	var result = 2000;

	if (window.innerHeight) {
		// all except Explorer
		result = parseInt(window.innerHeight);
	} else if (document.documentElement && document.documentElement.clientHeight) {
		// Explorer 6 Strict Mode
		result = parseInt(document.documentElement.clientHeight);
	} else if (document.body) {
		// other Explorers
		result = parseInt(document.body.clientHeight);
	}
	if (isNaN(result)) {
		result = 2000;
	}
	return result;
}
function getScreenOffsetX() {
	var result = 2000;

	if (window.pageXOffset) {
		// all except Explorer
		result = parseInt(window.pageXOffset);
	} else if (document.documentElement && document.documentElement.scrollLeft) {
		// Explorer 6 Strict Mode
		result = parseInt(document.documentElement.scrollLeft);
	} else if (document.body) {
		// other Explorers
		result = parseInt(document.body.scrollLeft);
	}
	if (isNaN(result)) {
		result = 2000;
	}
	return result;
}
function getScreenOffsetY() {
	var result = 2000;

	if (window.innerHeight) {
		// all except Explorer
		result = parseInt(window.pageYOffset);
	} else if (document.documentElement && document.documentElement.scrollTop) {
		// Explorer 6 Strict Mode
		result = parseInt(document.documentElement.scrollTop);
	} else if (document.body) {
		// other Explorers
		result = parseInt(document.body.scrollTop);
	}
	if (isNaN(result)) {
		result = 2000;
	}
	return result;
}
function TogglePreloader(fl) {	
	var x,y;
	x = getScreenWidth();
	y = getScreenHeight();
	var table=document.getElementById('preloader_table');
	var td=document.getElementById('preloader_td');
	var el=document.getElementById('div_desktop');
	
	if(null!=el) {
		el.style.visibility = (fl==1)?'visible':'hidden';
		el.style.display = (fl==1)?'block':'none';
		el.style.width = x + "px";
		el.style.height = y + "px";
		el.style.zIndex = 1;
	}

	var el=document.getElementById('loader');
	if(null!=el) 
	{
		var top = (y/2) - 50;
		var left = (x/2) - 200;
		if( left<=0 ) left = 10;
		td.style.width = (getScreenWidth() + getScreenOffsetX()) + "px";
		td.style.height = (getScreenHeight() + getScreenOffsetY()) + "px";
		top += getScreenOffsetY();
		left += getScreenOffsetX(); 
		table.style.display=(fl==1)?'block':'none';
		el.style.visibility = (fl==1)?'visible':'hidden';
		el.style.display = (fl==1)?'block':'none';
		el.style.left = left + "px"
		el.style.top = top + "px";
	}
}
function ShowTogglePreloaderDelayed(delay) {
	setTimeout("TogglePreloader(1)", delay);
}
function HideTogglePreloaderDelayed(delay) {
	setTimeout("TogglePreloader(0)", delay);
}

var zChar = new Array(' ', '(', ')', '-', '.');
var maxphonelength = 13;
var phonevalue1;
var phonevalue2;
var cursorposition;

function ParseForNumber1(object)
{
	phonevalue1 = ParseChar(object.value, zChar);
}
function ParseForNumber2(object)
{
	phonevalue2 = ParseChar(object.value, zChar);
}
function backspacerUP(object,e) 
{
	var keycode;

	if(e)
	{
		e = e
	} 
	else
	{
		e = window.event
	}
	if(e.which)
	{
		keycode = e.which
	} 
	else
	{
		keycode = e.keyCode
	}

	ParseForNumber1(object)

	if(keycode >= 48)
	{
		ValidatePhone(object)
	}
}
function backspacerDOWN(object,e) {
if(e){
e = e
} else {
e = window.event
}
if(e.which){
var keycode = e.which
} else {
var keycode = e.keyCode
}
ParseForNumber2(object)
}
function GetCursorPosition(){

var t1 = phonevalue1;
var t2 = phonevalue2;
var bool = false
for (i=0; i < t1.length; i++)
{
if (t1.substring(i,1) != t2.substring(i,1)) {
if(!bool) {
cursorposition=i
bool=true
}
}
}
}
function ValidatePhone(object){

var p = phonevalue1

p = p.replace(/[^\d]*/gi,"")

if (p.length < 3) {
object.value=p
} else if(p.length==3){
pp=p;
d4=p.indexOf('(')
d5=p.indexOf(')')
if(d4==-1){
pp="("+pp;
}
if(d5==-1){
pp=pp+")";
}
object.value = pp;
} else if(p.length>3 && p.length < 7){
p ="(" + p;
l30=p.length;
p30=p.substring(0,4);
p30=p30+")"

p31=p.substring(4,l30);
pp=p30+p31;

object.value = pp;

} else if(p.length >= 7){
p ="(" + p;
l30=p.length;
p30=p.substring(0,4);
p30=p30+")"

p31=p.substring(4,l30);
pp=p30+p31;

l40 = pp.length;
p40 = pp.substring(0,8);
p40 = p40 + "-"

p41 = pp.substring(8,l40);
ppp = p40 + p41;

object.value = ppp.substring(0, maxphonelength);
}

GetCursorPosition()

if(cursorposition >= 0){
if (cursorposition == 0) {
cursorposition = 2
} else if (cursorposition <= 2) {
cursorposition = cursorposition + 1
} else if (cursorposition <= 5) {
cursorposition = cursorposition + 2
} else if (cursorposition == 6) {
cursorposition = cursorposition + 2
} else if (cursorposition == 7) {
cursorposition = cursorposition + 4
e1=object.value.indexOf(')')
e2=object.value.indexOf('-')
if (e1>-1 && e2>-1){
if (e2-e1 == 4) {
cursorposition = cursorposition - 1
}
}
} else if (cursorposition < 11) {
cursorposition = cursorposition + 3
} else if (cursorposition == 11) {
cursorposition = cursorposition + 1
} else if (cursorposition >= 12) {
cursorposition = cursorposition
}

var txtRange = object.createTextRange();
txtRange.moveStart( "character", cursorposition);
txtRange.moveEnd( "character", cursorposition - object.value.length);
txtRange.select();
}

}
function ParseChar(sStr, sChar)
{
	if (sChar.length == null)
	{
		zChar = new Array(sChar);
	}
	else 
	{
		zChar = sChar;
	}

	for (i=0; i<zChar.length; i++)
	{
		sNewStr = "";

		var iStart = 0;
		var iEnd = sStr.indexOf(sChar[i]);

		while (iEnd != -1)
		{
			sNewStr += sStr.substring(iStart, iEnd);
			iStart = iEnd + 1;
			iEnd = sStr.indexOf(sChar[i], iStart);
		}
		sNewStr += sStr.substring(sStr.lastIndexOf(sChar[i]) + 1, sStr.length);

		sStr = sNewStr;
	}
	return sNewStr;
}
function moveOnMax(field,nextFieldID)
{
  if(field.value.length >= field.maxLength)
  {
    document.getElementById(nextFieldID).focus();
  }
}
function initialize( lat_switch, long_switch, lat_city, long_city, city, state, company, fullnumber, formatNumber, isUsersLocation ) 
{	  
	//alert(fullnumber);
	
	//if ( fullnumber == '6024059540' )
	//{
	//	alert( fullnumber );
	//}
	
	if ( company == '' )
	{
	   company = 'Unknown';
  	}

	var geocoder;
	var mainLatLong;

  	if ( lat_switch != 0 && long_switch != 0 )
	{
		mainLatLong = new google.maps.LatLng(lat_switch, long_switch);
	}
	else if ( lat_city != 0 && long_city != 0 )
	{
		mainLatLong = new google.maps.LatLng(lat_city, long_city);	
	}

	var myOptions = { zoom: 12,center: mainLatLong,mapTypeId: google.maps.MapTypeId.ROADMAP };
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

	var tempSwitch = '';
	var switchContentString = '';

	if ( isUsersLocation )
	{
		switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>-- Your Approximate Loaction is -- </b><br /><b>Latitude: </b>',lat_switch,', <b>Longitude: </b>',long_switch,'<br /><b>Your Name & Address: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /><b>Address: </b>place.address</div>');	
	}
	else
	{
		if ( city == '' && state == '' )
		{
  			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>Latitude: </b>',lat_switch,', <b>Longitude: </b>',long_switch,'<br /><b>Phone Company: </b>',company,'<br /><b>Owner Information: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /></div>');
  			switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>Latitude: </b>',lat_switch,', <b>Longitude: </b>',long_switch,'<br /><b>Owner Information: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" target="blank" rel="nofollow">On File - Click Here</a><br /></div>');
		}
		else
		{
			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,', <b>Longitude: </b>',long_city,'<br /><b>Phone Company: </b>',company,'<br /><b>	Owner Information: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /></div>');
			switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,', <b>Longitude: </b>',long_city,'<br /><b>	Owner Information: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" target="blank" rel="nofollow">On File - Click Here</a><br /></div>');	
		}
	}

	var switchInfowindow = new google.maps.InfoWindow({content: switchContentString});
	var marker_switch = new google.maps.Marker({position: mainLatLong,map: map,title:"Switch Location", icon: "http://www.called.com/images/green-marker-icon.png"});
	switchInfowindow.open(map,marker_switch);
	google.maps.event.addListener(marker_switch, 'click', function() {switchInfowindow.open(map,marker_switch);});
  
  	if ( lat_city != 0 || long_city != 0 )
	{	
		tempCity = '';
		var cityContentString = tempCity.concat('<div id="gmap_tag_city"><b>Location of nearest city for: </b>',fullnumber,'<br /><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,', <b>Longitude: </b>',long_city,'<br /><b>Phone Company: </b>',company,'<br /><b>Owner Information: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /></div>');
	
		var cityLatLong = new google.maps.LatLng(lat_city, long_city);
		var cityInfowindow = new google.maps.InfoWindow({content: cityContentString});
		var marker_city = new google.maps.Marker({position: cityLatLong,map: map,title:"City Location", icon: "http://www.called.com/images/blue-marker-icon.png"});
		google.maps.event.addListener(marker_city, 'click', function() {cityInfowindow.open(map,marker_city);});
	}
}
function initializeGoogleMap( lat_switch, long_switch, lat_city, long_city, city, state, company, fullnumber, formatNumber, isUsersLocation ) 
{	  
	//if ( fullnumber == '6024059540' )
	//{
	//	alert( fullnumber );
	//}
	
	if ( company == '' )
	{
	   company = 'Unknown';
  	}

	var geocoder;
	var mainLatLong;
	var citymap = {};
	var cityCircle;
	var map;
	
  	if ( lat_switch != 0 && long_switch != 0 )
	{
		mainLatLong = new google.maps.LatLng(lat_switch, long_switch);
		citymap['myCity'] = {center: new google.maps.LatLng(lat_switch, long_switch), population: 10000};
	}
	else if ( lat_city != 0 && long_city != 0 )
	{
		mainLatLong = new google.maps.LatLng(lat_city, long_city);
		citymap['myCity'] = {center: new google.maps.LatLng(lat_city, long_city), population: 10000};	
	}
	else
	{
		mainLatLong = new google.maps.LatLng(39.809, -98.555);
		citymap['myCity'] = {center: new google.maps.LatLng(lat_city, long_city), population: 10000};
	}

	var myOptions = { zoom: 15,center: mainLatLong,mapTypeId: google.maps.MapTypeId.ROADMAP };
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	
	for (var city in citymap) 
	{
    	// Construct the circle for each value in citymap. We scale population by 20.
    	var populationOptions = {
      		strokeColor: "#122F5C",
      		strokeOpacity: 0.8,
      		strokeWeight: 2,
      		fillColor: "#A8B9D5",
      		fillOpacity: 0.35,
      		map: map,
      		center: citymap[city].center,
      		radius: citymap[city].population / 40
    	};
    	cityCircle = new google.maps.Circle(populationOptions);
  	}
	
	var tempSwitch = '';
	var switchContentString = '';

	if ( isUsersLocation )
	{
		switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>-- Your Approximate Loaction is -- </b><br /><b>Latitude: </b>',lat_switch,', <b>Longitude: </b>',long_switch,'<br /><b>Your Name & Address: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /><b>Address: </b>place.address</div>');	
	}
	else
	{
		if ( city == '' && state == '' )
		{
  			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>Latitude: </b>',lat_switch,', <b>Longitude: </b>',long_switch,'<br /><b>Phone Company: </b>',company,'<br /><b>Owner Information: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /></div>');
  			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Switch Location: </b>',formatNumber,'<br /><b>Latitude: </b>',lat_switch,'<br /><b>Longitude: </b>',long_switch,'<br /><b>Owner Info: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" target="blank" rel="nofollow">On File - Click Here</a></div>');
  			switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Switch Location: </b>',formatNumber,'<br /><b>Owner Info: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" rel="nofollow">On File - Click Here</a></div>');
		}
		else
		{
			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Location of switch for: </b>',formatNumber,'<br /><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,', <b>Longitude: </b>',long_city,'<br /><b>Phone Company: </b>',company,'<br /><b>	Owner Information: </b>Coming Soon to <a href="http://www.called.com">Called.com</a><br /></div>');
			//switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Switch Location: </b>',formatNumber,'<br /><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,'<br /><b>Longitude: </b>',long_city,'<br /><b>	Owner Info: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" target="blank" rel="nofollow">On File - Click Here</a></div>');
			switchContentString = tempSwitch.concat('<div id="gmap_tag_switch"><b>Switch Location: </b>',formatNumber,'<br /><b>	Owner Info: </b><a href="http://www.intelius.com/redir.php?refer=5038&adword=reverse+phone&qp=[',fullnumber,']" title="Get Detailed Phone Number Info" rel="nofollow">On File - Click Here</a></div>');	
		}
	}

	var switchInfowindow = new google.maps.InfoWindow({content: switchContentString});
	var marker_switch = new google.maps.Marker({position: mainLatLong,map: map,title:"Switch Location", icon: "http://www.called.com/images/blue-marker-icon.png"});
	//switchInfowindow.open(map,marker_switch);
	google.maps.event.addListener(marker_switch, 'click', function() {switchInfowindow.open(map,marker_switch);});
  
  	//if ( lat_city != 0 || long_city != 0 )
	//{	
	//	tempCity = '';
	//	var cityContentString = tempCity.concat('<div id="gmap_tag_city"><b>City &amp; State: </b>',city,', ',state,'<br /><b>Latitude: </b>',lat_city,', <b>Longitude: </b>',long_city,'<br /><b>Phone Company: </b>',company,'</div>');
	//	var cityLatLong = new google.maps.LatLng(lat_city, long_city);
	//	var cityInfowindow = new google.maps.InfoWindow({content: cityContentString});
	//	var marker_city = new google.maps.Marker({position: cityLatLong,map: map,title:"City Location", icon: "http://www.called.com/images/blue-marker-icon.png"});
	//	google.maps.event.addListener(marker_city, 'click', function() {cityInfowindow.open(map,marker_city);});
	//}
}
function setLastCommentDateTime(theDate, theTime)
{
	document.getElementById('myDate').innerHTML = theDate;
	document.getElementById('myTime').innerHTML = theTime;
}
function show_help(show_id) 
{
	document.getElementById('why_file_complaint_help').style.display='none';
	document.getElementById('name_nickname_help').style.display='none';
	document.getElementById('caller_type_help').style.display='none';
	document.getElementById('comments_complaint_help').style.display='none';
	document.getElementById('captcha_help').style.display='none';
	document.getElementById(show_id).style.display='block';
}
function searchIP( reference, myevent )
{
	var returnValue = '';
	var number = reference.value;

	if ( myevent != '' && myevent.keyCode == 8 )
	{
		return true;
	}

	if( number.split("..").length > 1 )
	{
		var newNum = number.substr( 0, ( number.length - 1 ) );
		reference.value = newNum;	
		return false;
	}

	var ip_array=number.split(".");
	
	if ( ip_array[0] <= 0 )
	{
		reference.value = '';
		return false;
	}

	if ( number.split(".").length === 4 )
	{	
		var octetFourCount = number.length - number.lastIndexOf( "." ) - 1;

		if ( octetFourCount > 3 )
		{
			var newNum = number.substr( 0, ( number.length - 1 ) );
			reference.value = newNum;
			return false;
		}
	}
 
	for( count = 0; count < ip_array.length; count++ )
	{
		ip_array[count] = parseFloat( ip_array[count] );
 
	  	if ( ip_array[count] == 0 )
	  	{
	  		ip_array[count] = 0;
	  	}
	  	else if ( isNaN( ip_array[count] ) || ip_array[count] == '' )
		{
			ip_array[count] = '';
		}
	  	else if ( ip_array[count] > 255 )
		{
	   		ip_array[count] = 255;
		}
	  	else if ( ip_array[count] <= 0 )
		{
	    		ip_array[count] = 0;
		}
		
	 	returnValue = '' + returnValue + ip_array[count];
 
	  	if ( ( ( count == ( ip_array.length - 1 ) ) && ( ip_array[count] > 99 ) ) || ( count < ip_array.length - 1 ) )
	  	{		
	  		if ( count < 3) 
			{
				returnValue = '' + returnValue + ".";
	      	}
	  	}
	}
	reference.value = returnValue;
}
function searchSubmit( reference, myevent )
{	
	var returnValue = false;
	var myDataArray = reference.value.split(".");
	
	if ( myDataArray.length === 4 )
	{
		var lastOctet = reference.value.substr( ( reference.value.lastIndexOf( "." ) ) );
		
		if ( lastOctet.length > 1 )
		{
			//alert( "IP Address: " + reference.value );
			returnValue = searchIP( reference, myevent );
			if ( returnValue )
			{
				returnValue = submitIPAddress( reference.value );	
			}
		}	
	}
	else if ( ( reference.value.indexOf( "(" ) !== -1 ) && ( reference.value.indexOf( ")" ) !== -1 ) && ( reference.value.indexOf( "-" ) !== -1 ) )
	{
		//alert( "Phone Number: " + reference.value );
		returnValue = searchTop( reference.value );
	}

	if ( returnValue == false )
	{
		alert("A Valid IP Address must be in the format: (www.xxx.yyy.zzz)!\n\nPlease Enter a Valid IP Address!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();	
	}
	return returnValue;
}
function submitIPAddress( ip )
{	
	if ( ip.split(".").length !== 4 )
	{
		alert("A Valid IP Address must contain at least 7 digits in the format: (X.X.X.X)!\n\nPlease Enter a Valid IP Address!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else if( ip.length == 0 )
	{
		alert("Type in a IP Address and press enter!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else if( ip.length < 8 )
	{
		alert("A Valid IP Address must contain at least 7 digits in the format: (X.X.X.X)!\n\nPlease Enter a Valid IP Address!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else if( ip.length > 16 )
	{
		alert("A Valid IP Address CANNOT exceed 15 digits in Length and must be in the format:(XXX.XXX.XXX.XXX)!\n\nPlease Enter a valid IP Address!");
		document.searchformtop.s.style.borderColor='#FF0000';
		document.searchformtop.s.style.border.width='15';
		document.searchformtop.s.value="";
		document.searchformtop.s.focus();
		return false;
	}
	else
	{
		ref=".0123456789";
		result=1;
		
		for(count=0;count < ip.length;count++)
		{
			chr=ip.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=ip.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Search Field contains an invalid charactor at offset "+offset+"!\n\nOnly NUMERICAL CHARACTORS \"0 - 9\" and \".\" are allowed!";
			alert(errorMsg);
			document.searchformtop.s.style.borderColor='#FF0000';
			document.searchformtop.s.style.border.width='15';
			document.searchformtop.s.value='';
			document.searchformtop.s.focus();
			return false;
		}
		else
		{
			document.searchformtop.s.style.borderColor='#000000';
			document.searchformtop.s.style.border.width='0';
		}
	}
	return true;
}
function IsNumeric( sText )
{
   	var ValidChars = "0123456789";
   	var IsNumber=true;
   	var Char;

   	for (i = 0; i < sText.length && IsNumber == true; i++) 
   	{ 
      	Char = sText.charAt( i ); 
      	if (ValidChars.indexOf( Char ) == -1) 
      	{
         		IsNumber = false;
      	}
   	}
	return IsNumber;
}
function searchBarProcessing( reference, event )
{
	var number = reference.value;

	if ( number.length > 15 )
	{
		var newNum = number.substr( 0, 15 );
		reference.value = newNum;
		return false;	
	}

	switch( number.length )
	{
		case 1:
  			if ( IsNumeric( number[0] ) == false )
			{
				reference.value = '';
				return false;		
			}
  			break;
		case 2:
			if ( number.indexOf( "." ) != -1 )
			{
				searchIP( reference, event );
			}
			else if ( IsNumeric( number[1] ) == false )
			{
				reference.value = number[0];
				return false;		
			}
			break;
		case 3:
  			if ( number.indexOf( "." ) != -1 )
			{
				searchIP( reference, event );
			}
			else if ( IsNumeric( number[2] ) == false )
			{
				reference.value = number[0] + number[1];
				return false;		
			}
  			break;
		case 4:
			if ( number.indexOf( "." ) != -1 )
			{
				searchIP( reference, event );
			}
			else
			{
				backspacerUP( reference, event );	
			}
  			break;
		default:
			if ( number.indexOf( "(" ) != -1 && number.indexOf( ")" ) != -1 )
			{	
				backspacerUP( reference, event );
			}
			else
			{
				searchIP( reference, event );		
			}
			break;
	}
}
function enforcechar(what,limit)
{
	if ( event.keyCode == 8 )
	{
		if ( what.value.length == 0 )
		{
			document.getElementById('max_chars').style.backgroundColor= '#FFFFFF';
			document.getElementById('max_chars').value = limit;
			return false;
		}
		else
		{
			document.getElementById('max_chars').style.backgroundColor= '#FFFFFF';
			document.getElementById('max_chars').value = ( limit - ( what.value.length - 1 ) );	
			return true;
		}
	}
	else
	{
		if ( what.value.length >= limit )
		{
			document.getElementById('max_chars').value = 0;
			document.getElementById('max_chars').style.backgroundColor= '#FF0000';
			what.value = what.value.substring(0, (limit-1));
			return false;
		}
		else
		{
			document.getElementById('max_chars').style.backgroundColor= '#FFFFFF';
			document.getElementById('max_chars').value = limit - ( what.value.length + 1 );
			return true;
		}
	}
}
function enforcecharKeyup(what,limit)
{
	if ( what.value.length >= limit )
	{
		document.getElementById('max_chars').value = 0;
		document.getElementById('max_chars').style.backgroundColor= '#FF0000';
		what.value = what.value.substring(0, (limit-1));
		return false;
	}
}
function reportSpam( id ) 
{
	document.getElementById('spam_'+id).style.display = 'none';
	document.getElementById('reported_'+id).innerHTML = 'Thank you. We will look into this.';
}
function changeButton( id ) 
{
	document.getElementById('image_'+id).src='http://www.called.com/images/spam-button_onclick.jpg';
}
function validateLogin(username,password)
{	
	if(username.length==0 || username=="Enter Phone Number")
	{
		alert("You must enter a Username!\n\nThis is Typically Your 10 Digit Phone Number!");
		document.calledLoginForm.loginUsername.style.borderColor='#FF0000';
		document.calledLoginForm.loginUsername.style.border.width='15';
		document.calledLoginForm.loginUsername.style.color='#122F5C';
		document.calledLoginForm.loginUsername.value="";
		document.calledLoginForm.loginUsername.focus();
		return false;
	}
	else if(username.length<10)
	{
		alert("A Valid Username CANNOT be less than 10 Charactors in Length!\n\nPlease Enter a Valid Username\n\nThis is Typically Your 10 Digit Phone Number!");
		document.calledLoginForm.loginUsername.style.borderColor='#FF0000';
		document.calledLoginForm.loginUsername.style.border.width='15';
		document.calledLoginForm.loginUsername.value="";
		document.calledLoginForm.loginUsername.focus();
		return false;
	}
	else if(username.length>10)
	{
		alert("A Valid Phone Number CANNOT exceed 10 Charactors in Length!\n\nPlease Enter a Valid Username\n\nThis is Typically Your 10 Digit Phone Number!");
		document.calledLoginForm.loginUsername.style.borderColor='#FF0000';
		document.calledLoginForm.loginUsername.style.border.width='15';
		document.calledLoginForm.loginUsername.value="";
		document.calledLoginForm.loginUsername.focus();
		return false;
	}
	else
	{
		ref=".,!?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-'";
		result=1;
		
		for(count=0;count < username.length; count++)
		{
			chr=username.substring(count,count+1);
			
			if(ref.indexOf(chr)<0)
			{
				result=0;
				offset=count+1;
				count=username.length;
			}
		}
		if(result==0)
		{
			var errorMsg="Username Contains an Invalid Charactor '" +chr+ "' at Offset "+offset+"!";
			alert(errorMsg);
			document.calledLoginForm.loginUsername.style.borderColor='#FF0000';
			document.calledLoginForm.loginUsername.style.border.width='15';
			document.calledLoginForm.loginUsername.value='';
			document.calledLoginForm.loginUsername.focus();
			return false;
		}
		else
		{
			document.calledLoginForm.loginUsername.style.borderColor='#000000';
			document.calledLoginForm.loginUsername.style.border.width='0';
		}
	}
	
	if ( password != "text me" && password != "call me" && password != "textme" && password != "callme" )
	{
		if(password.length==0)
		{
			alert("You must enter a Password!");
			document.calledLoginForm.loginPassword.style.borderColor='#FF0000';
			document.calledLoginForm.loginPassword.style.border.width='15';
			document.calledLoginForm.loginPassword.value="";
			document.calledLoginForm.loginPassword.focus();
			return false;
		}
		else if(password.length<7)
		{
			alert("A Valid Password CANNOT be less than 7 Charactors in Length!\n\nPlease Enter a Valid Password!");
			document.calledLoginForm.loginPassword.style.borderColor='#FF0000';
			document.calledLoginForm.loginPassword.style.border.width='15';
			document.calledLoginForm.loginPassword.value="";
			document.calledLoginForm.loginPassword.focus();
			return false;
		}
		else if(password.length>14)
		{
			alert("A Valid Password CANNOT exceed 14 Charactors in Length!\n\nPlease Enter a Valid Password!");
			document.calledLoginForm.loginPassword.style.borderColor='#FF0000';
			document.calledLoginForm.loginPassword.style.border.width='15';
			document.calledLoginForm.loginPassword.value="";
			document.calledLoginForm.loginPassword.focus();
			return false;
		}
		else
		{
			ref="!@-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
			result=1;
		
			for(count=0;count < password.length; count++)
			{
				chr=password.substring(count,count+1);
			
				if(ref.indexOf(chr)<0)
				{
					result=0;
					offset=count+1;
					count=password.length;
				}
			}
			if(result==0)
			{
				var errorMsg="Password Contains an Invalid Charactor '" +chr+ "' at Offset "+offset+"!\n\nPasswords May Contain Letters, Numbers and ONLY these '!@-_' Special Charactors!";
				alert(errorMsg);
				document.calledLoginForm.loginPassword.style.borderColor='#FF0000';
				document.calledLoginForm.loginPassword.style.border.width='15';
				document.calledLoginForm.loginPassword.value='';
				document.calledLoginForm.loginPassword.focus();
				return false;
			}
			else
			{
				document.calledLoginForm.loginPassword.style.borderColor='#000000';
				document.calledLoginForm.loginPassword.style.border.width='0';
			}
		}
	}
	
	var value = rand ( 1000 );
	//alert(value);
	document.getElementById('loginRefresh').value = value;
	return true;
}
//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupCommentStatus = 0;
var popupCommentResultStatus = 0;
var popupLoginStatus = 0;
var popupLoginError = 0;

//loading popup with jQuery magic!
function loadCommentPopup(){
	//alert("Got Here!");
	//loads popup only if it is disabled
	if(popupCommentStatus==0){
		//centering with css
		centerCommentPopup();
	
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupContact").fadeIn("slow");
		popupCommentStatus = 1;
	}
}
//disabling popup with jQuery magic!
function disableCommentPopup(){
	//disables popup only if it is enabled
	if(popupCommentStatus==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popupContact").fadeOut("slow");
		popupCommentStatus = 0;
	}
}
//centering popup
function centerCommentPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupContact").height();
	var popupWidth = $("#popupContact").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	//centering
	$("#popupContact").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
	//only need force for IE6
	
	$("#backgroundPopup").css({
		"height": windowHeight
	});
	
}
//loading popup with jQuery magic!
function loadCommentResultPopup(){
	//loads popup only if it is disabled
	if(popupCommentResultStatus==0){
		//alert("Got Here!");
		centerCommentResultPopup();
		$("#commentResultBackgroundPopup").css({
			"opacity": "0.7"
		});
		$("#commentResultBackgroundPopup").fadeIn("slow");
		$("#popupCommentResult").fadeIn("slow");
		popupCommentResultStatus = 1;
	}
}
//disabling popup with jQuery magic!
function disableCommentResultPopup(){
	//disables popup only if it is enabled
	if(popupCommentResultStatus==1){
		$("#commentResultBackgroundPopup").fadeOut("slow");
		$("#popupCommentResult").fadeOut("slow");
		popupCommentResultStatus = 0;
	}
}
//centering popup
function centerCommentResultPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupCommentResult").height();
	var popupWidth = $("#popupCommentResult").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	//centering
	$("#popupCommentResult").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
	//only need force for IE6
	
	$("#commentResultBackgroundPopup").css({
		"height": windowHeight
	});
}
//loading popup with jQuery magic!
function loadLoginPopup(){
	//loads popup only if it is disabled
	if(popupLoginStatus==0){
		//alert("Got Here!");
		centerLoginPopup();
		$("#loginBackgroundPopup").css({
			"opacity": "0.7"
		});
		$("#loginBackgroundPopup").fadeIn("slow");
		$("#popupLogin").fadeIn("slow");
		popupLoginStatus = 1;
	}
}
//disabling popup with jQuery magic!
function disableLoginPopup(){
	//disables popup only if it is enabled
	if(popupLoginStatus==1){
		$("#loginBackgroundPopup").fadeOut("slow");
		$("#popupLogin").fadeOut("slow");
		popupLoginStatus = 0;
	}
}
//centering popup
function centerLoginPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupLogin").height();
	var popupWidth = $("#popupLogin").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	//centering
	$("#popupLogin").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
	//only need force for IE6
	
	$("#loginBackgroundPopup").css({
		"height": windowHeight
	});
}
//loading popup with jQuery magic!
function loadLoginPopupError(){
	//loads popup only if it is disabled
	if(popupLoginError==0){
		//alert("Got Here!");
		centerLoginPopupError();
		$("#loginBackgroundPopupError").css({
			"opacity": "0.7"
		});
		$("#loginBackgroundPopupError").fadeIn("slow");
		$("#popupLoginError").fadeIn("slow");
		popupLoginError = 1;
	}
}
//disabling popup with jQuery magic!
function disableLoginPopupError(){
	//disables popup only if it is enabled
	if(popupLoginError==1){
		$("#loginBackgroundPopupError").fadeOut("slow");
		$("#popupLoginError").fadeOut("slow");
		popupLoginError = 0;
	}
}
//centering popup
function centerLoginPopupError(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupLoginError").height();
	var popupWidth = $("#popupLoginError").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	//centering
	$("#popupLoginError").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
	//only need force for IE6
	$("#loginBackgroundPopupError").css({
		"height": windowHeight
	});
}

///////////////////////////////////////////////////////////////////
//0 means disabled; 1 means enabled;
var popupSampleReportStatus = 0;

//loading popup with jQuery magic!
function loadPopup(){
	//loads popup only if it is disabled
	if(popupSampleReportStatus==0)
	{		
		centerPopup();
		$("#backgroundViewSampleReportPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundViewSampleReportPopup").fadeIn("slow");
		$("#popupSampleReport").fadeIn("slow");
		popupSampleReportStatus = 1;
	}
}
//disabling popup with jQuery magic!
function disablePopup()
{
	//disables popup only if it is enabled
	if(popupSampleReportStatus==1)
	{	
		$("#backgroundViewSampleReportPopup").fadeOut("slow");
		$("#popupSampleReport").fadeOut("slow");
		popupSampleReportStatus = 0;
	}
}
//centering popup
function centerPopup()
{
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupSampleReport").height();
	var popupWidth = $("#popupSampleReport").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	//centering
	$("#popupSampleReport").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
}
////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupHowToVideoStatus = 0;
var timeOut = 0;

//loading popup with jQuery magic!
function loadPopupVideo(){
	//loads popup only if it is disabled
	if(popupHowToVideoStatus==0)
	{
		//var newHTML = "<iframe width='640' height='390' src='http://www.youtube.com/embed/DEjVo1gN5-g?rel=0&fs=0&autoplay=1&modestbranding=1&showinfo=0&start=0' frameborder='0'></iframe>";
		var newHTML = "<iframe width='640' height='390' src='http://www.youtube.com/embed/B6dhB6c4Wxg?rel=0&fs=0&autoplay=1&modestbranding=1&showinfo=0&start=0' frameborder='0'></iframe>";
		document.getElementById("videoIframe").innerHTML=newHTML;
		
		centerPopupVideo();
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popupHowToVideo").fadeIn("slow");
		popupHowToVideoStatus = 1;
		// Disable popup after video has finished playing, for this video 56 seconds
		timeOut = setTimeout('disablePopup()',57000);
	}
}
//disabling popup with jQuery magic!
function disablePopupVideo()
{
	//disables popup only if it is enabled
	if(popupHowToVideoStatus==1)
	{
		var newHTML = "";
		document.getElementById("videoIframe").innerHTML=newHTML;
	
		$("#backgroundPopup").fadeOut("slow");
		$("#popupHowToVideo").fadeOut("slow");
		popupHowToVideoStatus = 0;
		// Clears Video length timeout set in loadPopup()
		clearTimeout( timeOut );
	}
}
//centering popup
function centerPopupVideo()
{
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupHowToVideo").height();
	var popupWidth = $("#popupHowToVideo").width();
	
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	
	//centering
	$("#popupHowToVideo").css({
		"position": "absolute",
		"top": (windowHeight/2-popupHeight/2)+scrOfY,
		"left": (windowWidth/2-popupWidth/2)+scrOfX
	});
}
///////////////////////////////////////////////////////////////////////////////

//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){
	
	//LOADING POPUP
	//Click the button event!
	$("#showPopup").click(function(){
		//load popup
		loadCommentPopup();
		if ( document.getElementById('author') != null )
		{
			document.getElementById('author').focus();
		}
	});	
	//LOADING POPUP
	//Click the button event!
	$("#showPopup2").click(function(){
		//load popup
		loadCommentPopup();
		if ( document.getElementById('author') != null )
		{
			document.getElementById('author').focus();
		}
	});			
	//CLOSING POPUP
	//Click the x event!
	$("#popupContactClose").click(function(){
		disableCommentPopup();
	});
	//Click the from cancel button!
	$("#popupContactCancel").click(function(){
		disableCommentPopup();
	});
	//LOADING POPUP
	//Click the button event!
	$("#showCommentResult").click(function(){
		//load popup
		loadCommentResultPopup();
	});
	//CLOSING POPUP
	//Click the x event!
	$("#commentResultPopupClose").click(function(){
		disableCommentResultPopup();
	});
	$("#commentResultViewAll").click(function(){
		disableCommentResultPopup();
	});
	$("#commentResultPopupHelp").click(function(){
		disableCommentResultPopup();
	});
	//Click out event!
	$("#commentResultBackgroundPopup").click(function(){
		disableCommentResultPopup();
	});
	//LOADING POPUP
	//Click the button event!
	$("#showLoginPopup").click(function(){
		//load popup
		loadLoginPopup();
		document.getElementById('loginUsername').focus();
	});	
	$("#showLoginPopupTwo").click(function(){
		//load popup
		loadLoginPopup();
		document.getElementById('loginUsername').focus();
	});
	//CLOSING POPUP
	//Click the x event!
	$("#showLoginClose").click(function(){
		disableLoginPopup();
	});
	//Click the from cancel button!
	$("#showLoginCancel").click(function(){
		disableLoginPopup();
	});	
	//CLOSING POPUP
	//Click the x event!
	$("#popupLoginErrorClose").click(function(){
		disableLoginPopupError();
	});
	$("#popupLoginErrorDisable").click(function(){
		disableLoginPopupError();
	});
	$("#popupLoginErrorDisableTwo").click(function(){
		disableLoginPopupError();
	});
	//Click out event!
	$("#loginBackgroundPopupError").click(function(){
		disableLoginPopupError();
	});
	
	
	//LOADING SAMPLE REPORT POPUP
	//Click the button event!
	$("#showSampleReport").click(function(){
		loadPopup();
	});	
	//Click the x event!
	$("#showSampleReportClose").click(function(){
		disablePopup();
	});
	//Click out event!
	$("#backgroundViewSampleReportPopup").click(function(){
		disablePopup();
	});
	
	//LOADING SHOW VIDEO POPUP
	//Click the button event!
	$("#showHowToVideo").click(function(){
		loadPopupVideo();
	});	
	//Click the x event!
	$("#showHowToVideoClose").click(function(){
		disablePopupVideo();
	});
	//Click out event!
	$("#backgroundPopup").click(function(){
		disablePopupVideo();
	});
});
