$(document).ready(function(){
	

	$.ajax({
    type: "GET",
	url: "xml/table-data.xml",
	dataType: "xml",
	success: function(xml) {
		var newImageHtml= "<table width=\"587\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">";
		$(xml).find('table').each(function(){ 
			var name 	= $(this).find('name').text();	
			var url 	= $(this).find('url').text();	
			
			var name_1 	= $(this).find('name_1').text();
			var url_1 	= $(this).find('url_1').text();
			
			var name_2 	= $(this).find('name_2').text();
			var url_2 	= $(this).find('url_2').text();
			newImageHtml+="<tr class=\"tblgc\"><td width=\"200\" height=\"25\" class=\"padding-lt\"><a href="+url+" class=\"tbl-link\">"+name+"</a></td><td width=\"224\" class=\"padding-lt\"><a href="+url_1+" class=\"tbl-link\">"+name_1+"</a></td><td width=\"178\" class=\"padding-lt\"><a href="+url_2+" class=\"tbl-link\">"+name_2+"</a></td></tr>";			
		});
		newImageHtml+="</table>";
		document.getElementById('imp-wrapper').innerHTML	= newImageHtml;		
		//$('img.captify').captify({});
	}
	});		
	
});

function changeScorolingThumbs(fileName) {		
		$.ajax({
		type: "GET",
		url: fileName,
		dataType: "xml",
		success: function(xml) {
			var newImageHtml= ""; 
			var i=0;
			var newLinkHtml	= "<ul>";
			$(xml).find('cd').each(function(){
				var BigPic 		= $(this).find('bigImg').text();
				var thumbnail 	= $(this).find('thumb').text();
				var caption   	= $(this).find('caption').text();
				//var html        =$(this).find('html').text();
								
				newLinkHtml+="<li class=\"project\"><a href=\"javascript:void(0);\" onclick=\"javascript:changeMainImage('"+BigPic+"');\"><img src=\""+thumbnail+"\" alt=\""+caption+"\" rel=\"caption1\"  title=\""+caption+"\" class=\"captify\" /'></a></li>";					
				
			});		
			
			newLinkHtml+="</ul>";	
			document.getElementById('slideshow').innerHTML	= newLinkHtml;		
			
			$(".slider").jCarouselLite({
        		btnNext: ".next",
        		btnPrev: ".prev",
        		visible: 5
    		});			
			
			$('img.captify').captify({
				// all of these options are... optional
				// ---
				// speed of the mouseover effect
				speedOver: 'fast',
				// speed of the mouseout effect
				speedOut: 'normal',
				// how long to delay the hiding of the caption after mouseout (ms)
				hideDelay: 500,	
				// 'fade', 'slide', 'always-on'
				//animation: 'slide',	
				animation: 'always-on',	
				// text/html to be placed at the beginning of every caption
				prefix: '',		
				// opacity of the caption on mouse over
				//opacity: '0.7',	
				opacity: '0.9',	
				// the name of the CSS class to apply to the caption box
				className: 'caption-bottom',	
				// position of the caption (top or bottom)
				position: 'bottom',
				// caption span % of the image
				spanWidth: '100%'
			});			
		}
	});					
		
		
		/*caption*/
}
