
// Preload images
pic1= new Image(170,35); 
pic1.src="http://nyccreditrepair.com/i/evalform_buttA.png";
pic2= new Image(170,35); 
pic2.src="http://nyccreditrepair.com/i/evalform_buttB.png";
pic3= new Image(80,66); 
pic3.src="http://nyccreditrepair.com/i/chat.png";
pic4= new Image(80,66); 
pic4.src="http://nyccreditrepair.com/i/chatover.png";



// Validate Free Eval Form
var over=false;
var phok=false;
function check() {
	var name = document.forms.eval.Name.value;
	var em = document.forms.eval.Email.value;
	var pho = document.forms.eval.Phone.value;
	phoneRe = /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?/
	var at = em.indexOf('@');
	var dot = em.indexOf('.');
	if ((at > 0) && (dot > at)) em = true;
	else{
		em=false;
		document.forms.eval.Email.style.border="thin solid red";	
	}
	if (!phoneRe.test(pho)) {
		document.forms.eval.Phone.style.border="thin solid red";
	}else phok=true;
	if (!name){
		document.forms.eval.Name.style.border="thin solid red";
	}
	if ((name && em) || (name && phok)) {
		if (!em) document.forms.eval.Email.value="";
		//delete cookie
		document.cookie="captchatest=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		if (over) document.forms.eval.submit();}
}
function clearerrors(field){
	switch (field)
	{
	case "Name":
		document.forms.eval.Name.style.border="0px groove";
		break;
	case "Email":
		document.forms.eval.Email.style.border="0px groove";
		break;
	case "Phone":
		document.forms.eval.Phone.style.border="0px groove";
		break;
	default:
	
	}
	
}

//randomize testimonials

var testibody = new Array("“I found a questionable item on my credit report last year and came across NYCCR. I signed up and I am having a wonderful experience with the company. They send me updates on my status and I’m grateful” - <i>Steven Quagliata</i>","“I have a lot of NYC pride; I try to do all of my business in New York state so my roommate referred me to NYCCR. I signed up to get more info and what they sent was very useful. My credit has been improving since then.” - <i>Alicia Silverman</i>","“I just finished paying off student loans to a very expensive Ivy League college; in the process I destroyed my credit. The best part about NYCCR is I didn’t have to pay for my consultation. I’m happy they’re helping me get my life back on track.” - <i>Alexis Green</i>","“I know a good deal when I see it. Getting a free consultation is like taking a new car for a spin before you buy it. You have to know what you are going to get before you buy it.” - <i>Daniel Cascenza</i>","“I got some brilliant credit repair information. I moved from England to New York for a fresh start and I wanted to get my finances right. One of my friends from university referred me to this site. The advice helped a lot. Cheers.” - <i>Tom Angle</i>","“My company works with a PR firm in NYC. After our campaign, they referred me to NYCCR. My report isn’t bad but there’s room to improve. Three months in and I already see an improvement.” - <i>Mark Fitzgerald</i>","“With credit repair talk going around I decided to learn more information. After finding NYCCR I signed up and got some great facts on the best ways to improve credit. I learned a lot.” - <i>Natasha Rose</i>", "“I remember when the only credit cards offered to me were a gimmick, or required high fees. Since you raised my score, credit card companies are hounding me with mail and I’m turning them down!” - <i>Lisa Chiocco</i>","“My current Equifax report shows a 740!  Your analysts worked to raise my score 70 points. I am stunned! Thank you so much.” - <i>Stewart Montgomery</i>","“Since I used your services I am confident all inaccurate information has been removed. My entire report is accurate and I know how to handle my credit now.  I have recommended you to friends and am very satisfied.” - <i>Phyllis Smith</i>","“I am very happy about the service I have received. I was able to increase my credit score and got a great rate on my home loan.” - <i>Christopher DiVincenzo</i>","“I felt very comfortable working with your team.  They counseled me without expecting anything.  I called a few other places first that were very well-known, but they were after my money.  I felt like NYCCR just wanted to help; they offered me free guidance and answered all of my questions, for free, and did not harass me into anything.” - <i>Samuel Horowitz</i>");
//5 count 

tcount = testibody.length;

function testrand(){
tselector = Math.floor(Math.random() * tcount);
testtext = testibody[tselector];
if (testtext.length>88) testtext = testtext.substring(0,87);
document.getElementById("testimonialbody").innerHTML = testtext;
testilink="testimonials.htm#t" + eval(tselector + 1) ;
}

//testrand();
trand = setInterval("testrand()",13000);

/* recaptcha code */

if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf("captchatest=");
  if (c_start!=-1)
    {
    c_start=c_start + ("captchatest".length)+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    captchacheck = unescape(document.cookie.substring(c_start,c_end));
	//alert (captchacheck)
    }
  }

var RecaptchaOptions = {
   theme : 'custom',
   custom_theme_widget: 'recaptcha_widget'
};
