/* file header
*
*
*/

// BEGIN determine size of viewport

 var viewportwidth;
 var viewportheight;

 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }

// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }

 // older versions of IE

 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }

// END determine size of viewport

$(document).ready(function() {
          var $dialog = $('#adkloud')
                .html('Mention this advertisement and we\'ll give you <b>5% off labor</b><span id="promo_disclaimer">*</span> on your first visit!<div id="promo_disclaimer">* First-time customers only please!</div>')
                .dialog({
                        autoOpen: false,
                        title: 'First time visiting us?',
                        dialogClass: 'dclass',
                        height: 135,
                        minHeight: 40,
                        closeOnEscape: false,
                        resizable: false,
			draggable: false,
			position: [viewportwidth-345, 20]
                });
	$(".dclass").draggable();
        $(".dclass .ui-dialog-content").css('overflow','hidden');
        $dialog.css('font-size','medium');
	$(".dclass").css('background-color','white');
	$(".dclass .ui-dialog-content").css('color','black');
 (function() {
    var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
        window.onload = function() { $dialog.dialog('open'); }
});

  var _gaq = _gaq || [];
  _gaq.push(
	['_setAccount', 'UA-16967940-2'],
	['_trackPageview'],
	['_setDomainName', 'none'],
	['_setAllowLinker', true],
	['_setAllowHash', false]
  );

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

  window.fbAsyncInit = function() {
    FB.init({appId: '132537226769335', status: true, cookie: true,
             xfbml: true});
  };
