/*
 * Title: Main Javascript File
 * For: JavaScript
 * Site: becklerscarpet.com
 * Author: Matthew Watts
 * Company: Rexibit Web Services - http://www.rexibit.com
 * Last Modified: 2011-08-31
*/

$(document).ready(function(){
	/*
	 * Break up the URL parts
	 */
	
	var pathArray = window.location.pathname.split( '/' );

	/*
	 * Add an OuterHTML function
	 */

	jQuery.fn.outerHTML = function() {
	    return $('<div>').append( this.eq(0).clone() ).html();
	};

	/*
	 * Convert the image area for the Color Pages
	 */

	if (pathArray.length > 4){
		var image = $('#large_product_image_area img').outerHTML();
	 	var paragraph = $('#large_product_image_area p').outerHTML();
	 	var imageUrl = $('#large_product_image_area img').attr('src');
	 	var completeHtml = '<a href="' + imageUrl + '" class="cloud-zoom" rel="adjustX: 10, adjustY:-4">' + image + paragraph + '</a>';
	 	
	 	$('#large_product_image_area').html(completeHtml);
	}

	$(".request").colorbox({width:"50%", height:"80%", iframe:true});
});
