// JavaScript Document




$(function() {
	var marcieLong = "I have astigmatism and have worn glasses since 6th grade.  As I have aged and my vision has changed, the glasses I have worn were becoming less and less perfect.  My progressives, for example, have a very narrow space to look through in each field of correction and it has been difficult to coordinate the correction for both my eyes.   Parts of the day that should be relaxing, like reading or watching TV in bed, became frustrating when using my progressives. The constant lack of focus in my vision would give me headaches and even make me nauseous.  And going down the stairs in progressives was downright dangerous.  When I put my TruFocals on the first time, I could feel the relief in my brain.  It was truly a calming effect to be able to move my eyes anywhere &#8722; up, down, to the sides &#8722; without having to move my head to see everything in focus.  I am over the moon, ecstatic.  I really love them.  For the most part, I wear them all the time now.  Whether driving my car or a golf ball, I have found a focus length on my TruFocals that gives me just the right correction.   I recently took a trip to Hawaii and packed regular glasses, choosing to 'look good' instead of 'seeing well'.  I couldn't wait to get home to use my TruFocals again.  I do find that people often ask me about my 'interesting' glasses or ask me what I am doing when I adjust the slider.  I am always happy to tell them.  There are a few times during the day when I don't use them, like when knitting on the couch with the TV on or when cooking a meal.  In both these cases, it is just too much of a hassle to keep adjusting the slider, plus my hands are both occupied (or covered with food).  I can also say that, while they look good on some people, I don't love the way the TruFocals look on me.  That is far outweighed by the relief they have given me.";	   


var jeffLong = "I used to use bifocals, initially for reading, but then nearly all the time.  I can remember having to lean back at my desk to work on the computer, but even then the focus was not quite right.  But, worse than that was walking down the stairs in my bifocals &#8722; it was disconcerting to have the stairs in front of me be completely out of focus.  I was extremely anxious to give TruFocals a try to see if they could help me out.  I have not been disappointed.  I am a bit of a 'gear freak', so I appreciate when things are well thought&#8722;out, designed and constructed.  With TruFocals, this is clearly the case.  They do the job incredibly well for me.  I am very pleased with these glasses.  They are so much more convenient than my bifocals or switching glasses.  I absolutely love them.  Adjusting the focus has already become second nature, so that is a non&#8722;issue.  I now wear them everywhere, from driving the car to reading a book at lunch. I bought the photochromic lenses so I don't have to worry about switching to sunglasses either.  One of the few times I don't wear them is when riding my motorcycle, as they don't feel comfortable underneath my helmet.  I sure wish I could, though.  I have gotten to like the way they look on me, and they have certainly been a conversation piece with many friends.  Any concern I had about the way they look was far outweighed by their function.  I am not sure if they are for everyone, but I think they are just the greatest.  I hope many more people can feel the relief that TruFocals have provided for me.  Honestly, I think most people over 40 in America would want to have a pair.";

var michaelLong = "I am a photographer, so my vision (and my vision correction) are critical for me. I can't wear progressives because they give me problems in my peripheral vision and I don't like to have to 'aim' my head to see things properly. So, I ended up wearing single correction glasses to help me see near objects (my distance vision is quite good). This solution worked fine in some situations, like reading, but definitely not when I was taking pictures. While I could see fine through the viewfinder of my camera without glasses, I couldn't read the information on the camera's display without them. I was going moderately insane taking my glasses off, on, off, on. I learned about TruFocals in a New York Times article, read about them on the website, and bought a pair. I now use them all the time. I did have one problem &#8722; I broke a pair and they needed to be repaired. But, the customer service process was virtually painless. I have talked to many people about my TruFocals, including my eye care doctors. I suppose it's like any new technology, because one doctor thought they were 'cool' and the other thought they were 'weird.' As for me, I just think they work. They do what they said they would do and solved my problem. ";

var krisLong = "As a scientific instrument maker, I spend large parts of my day looking close&#8722;up at complex equipment.  But, I must be able to quickly change from close&#8722;up to distant focus (when talking to someone across the room) and these glasses give me back that ability.  In fact, for close&#8722;up work they are better than the strongest bifocal I had before and they give me that correction over my whole field of view. I've had my TruFocals glasses for a few months now and I really love them.   I view them as an important tool for my job &#8722; a vital part of my tool kit &#8722; and should I ever lose them or break them, I would immediately replace them like I would any other critical work tool.  I am so grateful to the inventors of this technology.  Having a scientific and engineering background, I had actually so desired a tool like TruFocals that I had set out some time ago to invent something similar.  Then I discovered that TruFocals were nearly ready to launch and I happily bought a pair.  I primarily use my TruFocals on the job and have not yet replaced my bifocals for reading or outdoor activities like biking.  To me, they are an expensive tool to be protected for work use.  When I started wearing them on the job, people said they were 'cool' looking (granted, they are a bunch of engineers!)  To me the style is irrelevant.  I would wear binoculars attached to my face if it were helpful.  But, thankfully TruFocals have come up with a more practical solution to my problem.  I've been showing these glasses and demonstrating them to everyone I know who might be interested and their response has been very positive.  Even my eye care professional thought they sounded interesting.   I think I have made a few sales for you!  The only thing I would suggest for your next generation product is perhaps to make a more robust industrial version, with a larger slider, larger zoom ability and some way to keep them from getting dirty between the two layers.";


var bobLong = "Prior to purchasing my TruFocals, I relied on several different types of glasses &#8722; a pair for the computer, a pair for reading and a pair for multiple distances.  The progressives I owned were literally a pain in the neck, with the small field of view forcing me to constantly tilt my head.  There were many situations, like looking at my side mirror in the car, where my vision correction was simply inadequate.  The blurry view was annoying.  I am obsessed with sharpness in my vision, so I was anxious to give TruFocals a try.  From a functional standpoint, the TruFocals are fantastic! I use them while driving, working on my computer, reading small print and watching TV. The ability to adjust the focus is just incredible and is a great improvement over the progressive glasses that I wear.  They offer me a much more satisfying visual experience than progressive or bifocal lenses. I find it amazing to be able to lock in that crisp focus of my computer screen at 18' &#8722; 24' away from my eyes.  People ask me about my TruFocals (especially about the slider) and they think that either they (or I) are European!  I can deal with the frame style...people think I look like a German physicist.  All I know is that I can see well again.  I have shown them to many interested people.  My optometrist thought the concept and design was very impressive, calling them 'ingenious',  'clever' and ' very well made'.  He and I both wonder if they can be made any lighter.  My O.D. changed the original nose pads to larger, silicone pads. The larger size distributes the weight over a larger surface area on the bridge of my nose and the silicone is more comfortable and less prone to sliding. I can now wear the eyeglasses for hours.  Overall, I really like my TruFocals and I love to talk to people about them.";


var alanLong = "The 'habit' and coordination of adjusting the slide comes more easily than I had imagined &#8722; you  get used to it in a day or so. And that initial period isn't too bad either; maybe because it's novel so it has a fun component and you can show off that your glasses are cooler than the next guy's. The real hit is everyone's reaction.  The graphic designer across the alley noticed them &#8722; 'new glasses? those are cool.'  When I showed her how they work she was blown away.  The woman who fit them thought they were absolutely great. Wanted to know how they work and where I got them. They work great.  My test is using the cell phone with those tiny buttons and graphics while driving and trying to read those signs which are so V E R Y far away &#8722; passed the test going away. The glasses are everything I hoped they would be.";
		   
 var theVolunteer = "nothing";
 
 
 
   $('.readMoreDOMWindow1').click(function(){ 
	$('div.formHolder').show();
	$('div.disclaimerInPopup').show();
	
										   
	theVolunteer =  $("#helper1").html();
	 $('div.formTopDynamicHelper').html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow1', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
  
    $('.moreReadMoreDOMWindow1').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper1").html();
	 $('div.popUpLongContent').html(marcieLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow1', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
   
  
  
  
  
  
  
   $('.readMoreDOMWindow2').click(function(){ 
	 $('div.formHolder').show();
	 $('div.disclaimerInPopup').show();
	theVolunteer =  $("#helper2").html();
	 $('div.formTopDynamicHelper').html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0, 
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow2', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
     $('.moreReadMoreDOMWindow2').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper2").html();
	 $('div.popUpLongContent').html(jeffLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow2', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
  
  
  
  
  
  
  
  
  
   $('.readMoreDOMWindow3').click(function(){ 
	 $('div.formHolder').show();
	 $('div.disclaimerInPopup').show();
	theVolunteer =  $("#helper3").html();
	 $('div.formTopDynamicHelper').html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0, 
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow3', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
     $('.moreReadMoreDOMWindow3').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper3").html();
	 $('div.popUpLongContent').html(michaelLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow3', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    $('.readMoreDOMWindow4').click(function(){ 
	 $('div.formHolder').show();
	 $('div.disclaimerInPopup').show();
	 $('div.formTopDynamicHelper').html();
	theVolunteer =  $("#helper4").html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0, 
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow4', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
     $('.moreReadMoreDOMWindow4').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper4").html();
	 $('div.popUpLongContent').html(krisLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow4', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
	 
	 
	 
	 
	 
	 
	 
	 
	 
  
  
  
    $('.readMoreDOMWindow5').click(function(){ 
	 $('div.formHolder').show();
	 $('div.disclaimerInPopup').show();
	  $('div.formTopDynamicHelper').html();
	theVolunteer =  $("#helper5").html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0, 
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow5', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
     $('.moreReadMoreDOMWindow5').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper5").html();
	 $('div.popUpLongContent').html(bobLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow5', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
	 
	 
	 
 	 
	  
	  
	  
    $('.readMoreDOMWindow6').click(function(){ 
	 $('div.formHolder').show();
	 $('div.disclaimerInPopup').show();
	  $('div.formTopDynamicHelper').html();
	theVolunteer =  $("#helper6").html();
	$("div.formTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
    $.openDOMWindow({ 
        windowSourceID:'#inlineContenContactForm', 
        height:255,  
        width:375, 
        overlayOpacity:0, 
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.readMoreDOMWindow6', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
  
  
  
     $('.moreReadMoreDOMWindow6').click(function(){ 
	//$('div.formHolder').show();
										   
	theVolunteer =  $("#helper6").html();
	 $('div.popUpLongContent').html(alanLong);
	 $("div.popupTopDynamicHelper").html();	 
	$("div.popupTopDynamicHelper").html("<p>" + theVolunteer + "</p>");
	
	
    $.openDOMWindow({ 
        windowSourceID:'#popUpLog', 
        height:275,  
        width:395, 
        overlayOpacity:0,
        positionType:'anchoredSingleWindow',  
        windowPadding:7,  
        windowBGColor:'#fff',  
        borderSize:'1',
		borderColor:'#666', 
        anchoredSelector:'.moreReadMoreDOMWindow6', 
        positionLeft:120, 
        positionTop:-150 
    }); 
    return false; 
}); 
	 
	 
	 
	 
	 
	  
  
  
  $('.closeDOMWindow').closeDOMWindow({eventType:'click'});
  
  
  
   $('.closeDOMWindowAfter').closeDOMWindow({anchoredSelector:'readMoreDOMWindow',eventType:'click'});
	
  
 
 
 
 
 
  $('.error').hide();

  $('input.text-input').css({backgroundColor:"#FFFFFF"});

  $('input.text-input').focus(function(){
$("label#email_error").hide();
    $(this).css({backgroundColor:"#FFDDAA"});

  });

  $('input.text-input').blur(function(){

    $(this).css({backgroundColor:"#FFFFFF"});

  });




  $(".button").click(function() {
		 $('div.formHolder').hide();
		  $('div.disclaimerInPopup').hide();
		 $('div.formTopDynamicHelper').html("<div id='sentMessage'>Your question was sent to " +  theVolunteer + ". <br /><br /> Thank You!  We hope you will receive an answer shortly." + "</div>")
		.hide()
        .fadeIn(2000, function() {  
		 

        });

		// validate and process form

		// first hide any error messages

    $('.error').hide();

		

	/*  var name = $("input#name").val();

		if (name == "") {

      $("label#name_error").show();

      $("input#name").focus();

      return false;

    }*/

		var email = $("input#email").val();

		if (email == "") {

      $("label#email_error").show();

      $("input#email").focus();

      return false;

    }

		var userMessage = $("textarea#userQuestion").val();

		if (userMessage == "") {

      $("label#userQuestion_error").show();

      $("textarea#userQuestion").focus();

      return false;

    }


		

		var dataString = '&email=' + email + '&userQuestion=' + userMessage + '&talkToWhichUser=' + theVolunteer;

		//alert (dataString);return false;
		
		

		$.ajax({

      type: "POST",

      url: "assets/TalkToUser/processMail.php",

      data: dataString,

      success: function(returnMessage) {
		 
		$("input#email").val("");
		$("textarea#userQuestion").val("");
       // $('#inlineContenContactForm').html("<div id='message'></div>");.append("<p>We will be in touch soon.</p>")  $('#message').append("<img id='checkmark' src='images/check.png' />");
//$('div.formTopDynamicHelper').html("<div id='message'></div>");  $('#message').html('<h2>Your Question was sent to ' +  theVolunteer + '</h2>') 

/*$('div.formTopDynamicHelper').html();
			$('div.disclaimerInPopup').html();*/
/*$('div.formTopDynamicHelper').html("<div id='sentMessage'>Your question was sent to " +  theVolunteer + ". <br /><br /> Thank You!  We hope you will receive an answer shortly." + "</div>")
		.hide()
        .fadeIn(2000, function() {  
		 

        });*/
		
		
		//alert ("returnMessage: " + returnMessage);
	

      }

     });

    return false;

	});

});

runOnLoad(function(){

  $("input#name").select().focus();
  
  
  
 //$("#helper1").html();
  
  
 //anchoredSelector:'readMoreDOMWindow', 
  
  
  
/*  $('.readMoreDOMWindow').openDOMWindow({ 
height:400, 
width:700, 
positionType:'anchored', 
anchoredClassName:'exampleWindow6', 
anchoredSelector:'.readMoreDOMWindow',
positionTop:50, 
eventType:'click', 
positionLeft:50, 
windowSourceID:'#inlineContenContactForm',
windowPadding:0, 
loader:1, 
loaderImagePath:'animationProcessing.gif', 
loaderHeight:16, 
loaderWidth:17 
}); */
  
  

});

