$(document).ready(function(){
						   
var ary = [];
$("#homeads a > img").each(function(idx,row){
	ary.push({url:row.src,description: row.alt,link:$(row).parent().attr('href')});
});
$("#homeads p > img").each(function(idx,row){
	ary.push({url:row.src,description: row.alt,link:'#'});
});
/*
$("#homeads").html('');
$("#homeads").showcase({  
    images: ary,  
    width: "530px",  
    height: "360px",  
    animation: { type: "fade", interval: 7500, stopOnHover: true },  
    navigator: { item: { width: "1px", height: "1px" } },  
    titleBar: { css: { backgroundColor: "#232323", fontColor: "#ffffff" } }  
});  
*/
$("#homeads").html("<div id=img0></div><div id=img1></div><div id=img2></div><div id=img3></div>");
$("#homeads").css({width:"530px",height:"360px"});
if (ary.length != 0) {
	for (var i in ary) {
		var img = new Image();
		img.src = ary[i].url;
		img.alt = ary[i].description || "";
		img.width = 265;
		img.height = 170;
		img.border = 0;
		var $link = $("<a />").attr("href", ary[i].link || "#");
		$link.append(img);
		if ( i==0 ) {
			$("#img0").append($link);
			$("#img0").css({float:"left",width:"265px",height:"170px"});
		}
		if ( i==1 ) {
			$("#img1").append($link);
			$("#img1").css({float:"left",width:"265px",height:"170px"});
		}
		if ( i==2 ) {
			$("#img2").append($link);
			$("#img2").css({float:"left",width:"265px",height:"170px"});
		}
		if ( i==3 ) {
			$("#img3").append($link);
			$("#img3").css({float:"left",width:"265px",height:"170px"});
		}
	}
}
});

