function webkit1pxBugFix() {
	var vpWidth = document.width + document.body.getStyle('margin-left').toInt();
	var border_left = (vpWidth % 2 == 1) ? '1px transparent solid' : '0';
	document.body.setStyle('border-left', border_left);
}

if (Browser.Engine.webkit) {
	window.addEvent('load', webkit1pxBugFix);
	window.addEvent('resize', webkit1pxBugFix);
	window.addEvent('domready', function(){
		document.body.setStyle("font-size", "16px");
	});
}

function getQueryString() {
  var result = {}, queryString = location.search.substring(1), re = /([^&=]+)=([^&]*)/g, m;

  while (m = re.exec(queryString)) {
    result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
  }

  return result;
}

// ...
//var myParam = getQueryString()["myParam"];



window.onload = function() {
	
	var do_gc = getQueryString()["do_gc"];	

	document.addEvent('keydown', function(event){
	    if (event.key == 'c' && event.control) {
			Cookie.dispose('gc');
			window.location.href = window.location.href;
		}
	});

	if(Cookie.read("gc") !== "gcread" || do_gc == 1) {
		Shadowbox.open({    
			content: 'http://www.irmocosmeticdentist.com/gift-certificate.php?title=$100%20Gift%20Certificate&image=/images/100-gift-certificate-home.jpg',
			player:     "iframe",
	        title:      "Get Your $100 Gift Certificate Now!",
			modal: 		true,
			height:		324,
			width:		762
	    });
		Cookie.write("gc", "gcread", {duration: 2});			
	}	
};

var Site = {
	start: function(){
		if (top.location != location) top.location.href = document.location.href;
		/* if ($('navigation')) Site.fancyNavigation() */
	},
	
/*
	fancyNavigation: function(){
		var szNormal = 120, szSmall = 110, szFull = 156;
		var kwicks = $('navigation').getElements('a');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
		kwicks.each(function(kwick, i) {
			kwick.addEvent("mouseenter", function(event) {
				var o = {};
				o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
				kwicks.each(function(other, j) {
					if (i != j) {
						var w = other.getStyle("width").toInt();
						if (w != szSmall) o[j] = {width: [w, szSmall]};
					}
				});
				fx.start(o);
			});
		}, this);
		 
		$("navigation").addEvent("mouseleave", function(event) {
			var o = {};
			kwicks.each(function(kwick, i) {
				o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
			});
			fx.start(o);
		}, this);
	}
*/
}

window.addEvent('domready', Site.start);
window.addEvent('domready',function() { new SmoothScroll({ duration: 1800 }); });
/* window.addEvent('domready', function() { SqueezeBox.assign($$('a[rel=boxed]')); }); */
