
	function submitCheckout(){
		$.get('index.php?route=onepagecheckout/checkout/pending', function(data) {
			$('#checkout').submit();
		});
	}
	
	function move_popup(id,popup){
		var container = $(id);
		var containerPOS = container.offset();
		var containerLeft = containerPOS.left;
		var containerWidth = container.outerWidth();
		var popup = $(popup);
		var popupWidth = popup.outerWidth();
		// alert(eval(containerLeft+containerWidth-popupWidth));
		popup.css('left',eval(containerLeft+containerWidth-popupWidth)+'px');
		// popup.css('right','px');
	}
	
	function fadeaddToCartContainer(){
		$('div#addToCartContainer').fadeOut("slow", "linear",function(){
			$('div#addToCartContainer').hide();
		});
	}
	
	$(document).ready(function(){
		$('#author_hide').hide();
		$('#sort_hide').hide();
		$('div.cat_info_fulldescription').hide();
		$('div.cat_info_excerpt').hide();
		$('a').click(function(){
			$(this).blur();
		});
		move_popup('div#container','div#addToCartContainer');
		$('div#addToCartContainer').hide();
		
		
		// window.baseHeight = $(document).height();
		
		$('div.cat_info_view_more a').click(function(){
			var id = $(this).attr('id');
			if ($(this).html() == '[view More]'){
				$('div.cid'+id).hide();
				$('div.cifd'+id).show();
				$(this).html('[view Less]');
			} else {
				$('div.cid'+id).show();
				$('div.cifd'+id).hide();
				// var offset = $('a#a'+id).offset();
				$(document).scrollTo($('a#a'+id));
				$(this).html('[view More]');
			}
			$('div#excerpt'+id+' a').html('[view Excerpt]');
			$('div.cie'+id).hide();
		});
		$('div.cat_info_view_excerpt a').click(function(){
			var id = $(this).attr('id');
			if ($(this).html() == '[view Excerpt]'){
				$('div.cid'+id).hide();
				$('div.cie'+id).show();
				$(this).html('[hide Experpt]');
			} else {
				$('div.cid'+id).show();
				$('div.cie'+id).hide();
				$(document).scrollTo($('a#a'+id));
				$(this).html('[view Excerpt]');
			}
			$('div#more'+id+' a').html('[view More]');
			$('div.cifd'+id).hide();
		});
	});
