
var isOpen = false;

function quickShop(base_url, productId){
	
		var siteHeight = jQuery('body').height();
		var siteWidth = jQuery('body').width();
		
		var scrollOffset = document.viewport.getScrollOffsets();
		
		var offsetHeight = document.viewport.getHeight();
		var offsetWidth = document.viewport.getWidth();
		
		var topOffset = 110;
		var leftOffset = ((offsetWidth + scrollOffset[0])/2) - (637/2);
		
		
		var fader = new Element('div', {"style":  "position:absolute; display:block; height:"+siteHeight+"px; width:"+siteWidth+"px; top:0; left:0; filter:alpha(opacity=40); -moz-opacity:0.4; opacity: 0.4; background-color:#000000; z-index:100;", "id":"ajaxyFader"});

		var newContainer = new Element('div', {"style": "position:absolute; height:570px; width:637px; top:" + topOffset + "px; left:" + leftOffset + "px; z-index:200;", "id":"ajaxyContainer"});
	  
      jQuery('body').append(fader);
	  jQuery('body').append(newContainer);
	  
	   if ((base_url == undefined) || (base_url == '')) {base_url = 'http://minervamobiles.com/';}
	   
	   if( base_url.indexOf('index.php') != -1 ){
		 	base_url = base_url.replace(new RegExp("/index.php"), '');
		 }
	  
	  jQuery.ajax({
		  type: "POST",
		  url: base_url+'ajaxy.php?id='+productId,
		  success: function(data) {		
			newContainer.insert(data);
			newContainer.hide();
			Effect.Appear('ajaxyContainer', { duration: 0.4 });									
		  }
		});

}

function wClose(){
		
	Element.remove($('ajaxyContainer'));
	Element.remove($('ajaxyFader'));
	
	}

function quickShopClose(){
	
		Effect.Fade('ajaxyContainer', { duration: 0.4 });
		window.setTimeout(wClose, 500);
		
	
	}
