/*------------------------------------------------------*/
/* slideshow.js */
/*------------------------------------------------------*/
/*
Copyright (c) 2011, R@D
http://www.r4d-inc.com
2011.07.19
version: 1.0
--------------------------------------------------------*/
var xmlPath = "xml/slideshow_test.xml";
var count 	= 0;
$(function(){
	$.ajax({
		type: "GET",
		scriptCharset:"utf-8",
		url:xmlPath,
		dataType:"xml",
		success:parsexml
	});
});

function parsexml(xml,status){
	$(xml).find('item').each(function(){
		
		var title	=	$(this).find("title").text();
		var picUrl	=	$(this).find("picture").text();
		var linkUrl	=	$(this).find("link").text();
		
		var tag_picture	=	"<li id='picture" + count + "'><a href='" + linkUrl + "' title='" + title + "'><img src='" + picUrl + "' alt='" + title + "' /></a></li>";
		
		$("#slideshow ul").append(tag_picture);
		count++;
	});
	cycle();
	function cycle(){
		$('#slideshow ul').cycle({ 
			speed:       300, 
			timeout:     5000, 
			pager:      '#nav', 
			pagerEvent: 'mouseover', 
			pauseOnPagerHover: true 
		});
	}
}
//error
function error_func(){
	alert("error");
}




