	
	function findPos(obj,which) {

	var pos_left = pos_top = pos_right = 0;

	switch(which) {
		case 'left':
			do {
				pos_left += obj.offsetLeft;
			} while (obj = obj.offsetParent)
		
			return pos_left;
			break;
		case 'right':
			do {
				pos_left += obj.offsetLeft;
			} while (obj = obj.offsetParent)
	
			var doc_width = $(document).width();
			
			pos_left = findPos(document.getElementById('wraper'), 'left');
			
			var wrap_width = $('#wraper').width();
			
			pos_right = pos_left + wrap_width;
		
			return pos_right;
		break;
		case 'top':
			do {
				pos_top += obj.offsetTop;
			} while (obj = obj.offsetParent)
		
			return pos_top;
		break;	
	}
	return 0;
	}
	
	$(document).ready(function() {
		var pos_left = findPos(document.getElementById('wraper'), 'left');
		var pos_right = findPos(document.getElementById('wraper'), 'right');
		
		var cafb_margin_left = pos_left-142;
		$('#click_area_friskies_bag').css('margin-left', cafb_margin_left);
		
		var cafe_margin_left = pos_right;
		$('#click_area_friskies_etiquette').css('margin-left', cafe_margin_left);
		
		var doc_width = $(document).width();
		var doc_height = $(document).height(); //sometimes is buggy
		//var doc_height = document.documentElement.clientHeight;
		var cafe_width = doc_width - pos_right - 5; // 5 is bug workaround or hidden elements extending document size (or something)

		if(cafe_width > 142) {
			cafe_width = 142;
		}

		$('#click_area_friskies_etiquette').width(cafe_width);

		$('#click_area_friskies_bag').height(doc_height);		
		$('#click_area_friskies_etiquette').height(doc_height);
		
		$('#click_area_friskies_bag').click(function() {
			window.location.href = '/clicks/frontend/goto/id/3';			
		});
				
		$('#click_area_friskies_etiquette').click(function() {
			window.location.href = '/clicks/frontend/goto/id/2';			
		});
	})