
function xtractFile(data){
var m = data.match(/(.*)\/([^\/\\]+)(\.\w+)$/);
if(m == null) { m = "null"; }
return {path: m[1], file: m[2], extension: m[3]}
}

// Google Map function
function initGmap() {    
	var latlng = new google.maps.LatLng(53.339608, -6.261005);    
	
	var myOptions = {      zoom: 15,      
						   center: latlng,      
						   mapTypeId: google.maps.MapTypeId.ROADMAP 
					};    
	
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	
	
	var contentString = "Donegal Shop,<br />2nd Floor, St. Stephen's Green Centre,<br />Dublin 2, Ireland.";
	//create info window
	var infowindow = new google.maps.InfoWindow({    
		content: contentString,
        maxWidth: 200
	});
	
	var marker = new google.maps.Marker({      
		position: latlng,      
		map: map     
	});

	var marker = new google.maps.Marker({      
		position: latlng,      
		map: map     
		//title:"Hello World!"  //this shows up as a tooltip
	});
	
	google.maps.event.addListener(marker, 'click', function() {  
		infowindow.open(map,marker);
	});
}


jQuery(document).ready(function() {
	
	//Google map
	if($("#map_canvas").length > 0) {
		initGmap();
	}
	
	// Assign Zebra Cols to Product List
	var i = 0;
	jQuery(".productList li, .form_table tr, .cartproductgrid tr, .addresseditor tr, .prod_table tr, .reviewTable tr, .pagecontent tr, #categorydescription tr").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("zebra_row_1") : jQuery(this).addClass("zebra_row_0");
		i++;
	});
	
	//Apply 10px to first homeItem & 0 pixels to next 1
	i = 0;
	jQuery(".homeItem").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("margin10px") : jQuery(this).addClass("margin0px");
	});
	
	//apply 10 to first productList item & 0 pixels to the next 1
	i = 0;
	jQuery(".productItem").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("margin10px") : jQuery(this).addClass("margin0px");
	});
	
	//apply 10 to first relatedProduct item & 0 pixels to the next 1
	i = 0;
	jQuery(".relatedProduct").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("margin10px") : jQuery(this).addClass("margin0px");
	});
	
	//apply 10 to first relatedProduct item & 0 pixels to the next 1
	i = 0;
	jQuery(".imgThumb").each( function(i){
		i % 2 == 0 ? jQuery(this).addClass("margin10px") : jQuery(this).addClass("margin0px");
	});
	

	// lightbox
	jQuery('a.imgMain').lightBox();
	jQuery('a.imgThumb').lightBox();
	
	/* product details tabs
	$("#tabs").tabs();*/

	jQuery(".header_logo").hover(
		function() { jQuery(this).fadeTo("fast", 0.7); },
		function() { jQuery(this).fadeTo("fast", 1.0); }
	);
	
	//preload images
	jQuery.PreloadImg = function() {
		for(var i=0; i<arguments.length; i++)
		{
			jQuery("<img>").attr("src", arguments[i]);
		}
	}
	
	//png fix
	//jQuery(document).pngFix();

		
});
