var quotes = new Array();
quotes[0] = "<p>&quot;I highly recommend Scott and Vintage Construction!&quot;</p><p>David Dickerson,<br /><span class='title'>Client</span></p>"; 
quotes[1] = "<p>&quot;I just trusted Scott a whole lot more than I trusted the other guy. I have found my guy!&quot;</p><p>Rita Patel,<br /><span class='title'>Client and Realtor</span></p>"; 
quotes[2] = "<p>&quot;I recommend Vintage Construction to all of my clients.&quot;</p><p>Rita Patel,<br /><span class='title'>Client and Realtor</span></p>"; 
quotes[3] = "<p>&quot;Vintage Construction is rapidly becoming the choice for the real estate community.&quot;</p><p>Rita Patel,<br /><span class='title'>Client and Realtor</span></p>";
quotes[4] = "<p>&quot;The guy in charge of the Codes Dept. said, 'If you're using Vintage Construction, that's all I need to hear&#0133;&quot;</p><p>Jack McCann,<br /><span class='title'>Client</span></p>";
quotes[5] = "<p>&quot;When [the job] was ﬁnished, the house looked better than brand new!&quot;</p><p>Jack McCann,<br /><span class='title'>Client</span></p>"; 
quotes[6] = "<p>&quot;This was a major job, and if it hadn't been for Vintage Construction we probably would have had to bulldoze the house and started over.&quot;</p><p>Jack McCann,<br /><span class='title'>Client</span></p>";
quotes[7] = "<p>&quot;I know I'm dealing with a company with a great reputation and they do fantastic work!&quot;</p><p>Sean Tinsley,<br /><span class='title'>COO, Services Select, and Client</span></p>";
quotes[8] = "<p>&quot;It was seamless!  They came out and two days later my house was back to normal.&quot;</p><p>Sean Tinsley,<br /><span class='title'>COO - Services Select and Client</span></p>";
quotes[9] = "<p>&quot;They'll get it right the ﬁrst time and make it look like nothing happened.&quot;</p><p>Sean Tinsley,<br /><span class='title'>COO - Services Select and Client</span></p>"; 
quotes[10] = "<p>&quot;I am often asked by realtors for a company who can help ﬁx foundation or waterprooﬁng problems.  We bring Scott in because he is a professional and honest.&quot;</p><p>Wayne Evans,<br /><span class='title'>President - ProServ</span></p>";
quotes[11] = "<p>&quot;It's easy to recommend Vintage Construction because they do their job so well!&quot;</p><p>Wayne Evans,<br /><span class='title'>President - ProServ</span></p>"; 
quotes[12] = "<p>&quot;Vintage Construction did a great job, kept me well-informed and didn't give me any added costs.&quot;</p><p>Sherry Porter,<br /><span class='title'>Small Business Owner and Client</span></p>";
quotes[13] = "<p>&quot;They've completed more than 100 jobs for me and I trust them.&quot;</p><p>Ron Jones PE,<br /><span class='title'>PhD, Owner - GEC Inc</span></p>";

var videos = new Array();
videos[0] = "http://www.vintageconstructioninc.com/video/David.flv";
videos[1] = "http://www.vintageconstructioninc.com/video/rita.flv";
videos[2] = "http://www.vintageconstructioninc.com/video/Wayne.flv";
videos[3] = "http://www.vintageconstructioninc.com/video/sean.flv";
videos[4] = "http://www.vintageconstructioninc.com/video/Russell.flv";

var videoThumbs = new Array();
videoThumbs[0] = "http://www.vintageconstructioninc.com/images/vidThumbs/david.jpg";
videoThumbs[1] = "http://www.vintageconstructioninc.com/images/vidThumbs/rita.jpg";
videoThumbs[2] = "http://www.vintageconstructioninc.com/images/vidThumbs/evans.jpg";
videoThumbs[3] = "http://www.vintageconstructioninc.com/images/vidThumbs/sean.jpg";
videoThumbs[4] = "http://www.vintageconstructioninc.com/images/vidThumbs/russell.jpg";


$(document).ready(function(){
  var navigationTimer = 0;
   $('#page-node-1 .node').supersleight({'shim':'images/x.gif'});
   
   // navigation
   $('#services-link').mouseenter(function() {
     showNavigationServices();
     clearTimeout(navigationTimer);
   });
   $('#navigation_services').mouseenter(function() {
     clearTimeout(navigationTimer);
   });
   $('#navigation').mouseleave(function() {
     navigationTimer = setTimeout("hideNavigationServices()", 1000);
   });
   
   // video player
   var videoPick = Math.floor(Math.random() * videos.length);
   var flashvars = {"volume": "20", 'uiAutoHide': "true", 'uiControls': "PlayPause|Seek|MuteUnmute", "autoPlay": "false", "video": videos[videoPick], 'volume':'60', 'poster': videoThumbs[videoPick]};
   
   swfobject.embedSWF("http://vintageconstructioninc.com/swf/videoPlayer.swf", "block-video", "215", "161", "9.0.0", "http://vintageconstructioninc.com/swf/expressInstall.swf", flashvars);
   
   $('#tag-credit').supersleight({'shim':'images/x.gif'});
   if ($.getURLParam('email') == 'true') {
    $('#contact-us').remove();
    $('#page-node-12 #main-content .node p').empty().prepend("Thanks for requesting your Free Home Health Checkup.  You've made a smart decision.  If we were in your living room, we'd give you a pat on the back, but it would be pretty weird of us to be in your living room right now. We'll be in touch at your requested time/urgency, so for now feel free to browse the rest of our site or click below to chat live with a live person.  Thanks!  See you soon.  - Scott Walter");
   }
   
   // rotator   
   $('#page-node-4 #sidebar').empty().html(quotes[Math.floor(Math.random() * quotes.length)]);
   $('#page-node-5 #sidebar').empty().html(quotes[Math.floor(Math.random() * quotes.length)]);
   $('#page-node-6 #sidebar').empty().html(quotes[Math.floor(Math.random() * quotes.length)]);
   $('#page-node-12 #sidebar').empty().html(quotes[Math.floor(Math.random() * quotes.length)]);
   
   // front quote 
   
   var hideQuote = readCookie('hideQuote');
   //var hideQuote = null;
   if ($('#page-node-1').html() != null && hideQuote == null) {
    var windowWidth = $(window).width();
    var windowHeight = $(window).height();
    $('#page-node-1').append("<div class='ui-widget-overlay quote' style='width: " + windowWidth + "; height: " + windowHeight + "; z-index=1001'><div class='introQuote'><div>&ldquo;To be trusted is a greater compliment than to be loved.&rdquo;</div><div class='attr'>&#126; George MacDonald</div></div></div>");
    var width = $('.ui-widget-overlay.quote .introQuote').width();
    var height = $('.ui-widget-overlay.quote .introQuote').height();
    $('.ui-widget-overlay.quote .introQuote').css('marginTop', (windowHeight - height) / 2).css('marginLeft', (windowWidth - width) / 2);
    createCookie('hideQuote', 'true');
    setTimeout(removeQuote, 3000);    
   }
 });
 
function removeQuote() {
  $('.ui-widget-overlay.quote').fadeOut(1500, function() {$(this).remove();});
}

function showNavigationServices() {
  if ($('#navigation_services').css('left') != '-15px') {
    $('#navigation_services').hide().css('left', '-15px').fadeIn('normal');
  }  
}

function hideNavigationServices() {
  $('#navigation_services').fadeOut('normal', function() {$(this).css('left', '-9999px')});
}

/* Copyright (c) 2006 Mathias Bank (http://www.mathias-bank.de)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Thanks to Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
 */
jQuery.extend({
/**
* Returns get parameters.
*
* If the desired param does not exist, null will be returned
*
* @example value = $.getURLParam("paramName");
*/ 
 getURLParam: function(strParamName){
	  var strReturn = "";
	  var strHref = window.location.href;
	  var bFound=false;
	  
	  var cmpstring = strParamName + "=";
	  var cmplen = cmpstring.length;

	  if ( strHref.indexOf("?") > -1 ){
	    var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	    var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
	      if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
	        var aParam = aQueryString[iParam].split("=");
	        strReturn = aParam[1];
	        bFound=true;
	        break;
	      }
	      
	    }
	  }
	  if (bFound==false) return null;
	  return strReturn;
	}
});

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}