$(document).ready(function() {

	// Common urlParam
	$.urlParam = function(name){
		var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
		if (results != null) {
			return results[1];
		}
		return 0;
	}
	
	/*Rounded Corners for  breadcrumb */
	$("#breadCrumb-browseBrand").corner("3px; left;");
	
	/**
	 * Event click on div.addToCartButton
	 */
	$("div.addToCartButton").click(function(){
		
		$("div#cartPopup").show();
		
		//alert("TODO : Ajax Call");
	});

	$.formatMoney = function(number) {
	    var nStr = '' + Math.round(parseFloat(number) * 100) / 100;
	    var x = nStr.split('.');
	    var x1 = x[0];
	    var x2 = x.length > 1 ? '.' + x[1] : '.00';
	    var rgx = /(\d+)(\d{3})/;
	    while (rgx.test(x1)) {
	        x1 = x1.replace(rgx, '$1' + ',' + '$2');
	    }
	    if(x2.length<3)
	    	x2 += "0";
	    
	    return "$" + x1 + x2+" AUD";
	}

});
