
jQuery.noConflict();

function showError(e) {
	console.info("fail:" + e);
}


function getVideoList() {
	var videoUrl ="http://v.9you.com/filter/xml?keyword=ss0jjcc2n&type=class&page=1&size=4";
	jQuery.ajax({url:"/proxy.jsp", type:"POST", dataType:"xml", data:"page=" + encodeURIComponent(videoUrl), cache:false, beforeSend:function () {
	}, success:function (xml) {
		fillShareDiv(xml);
	}, complete:function () {
	}, error:function (e) {
		console.info("error:function=" + e);
	}});
}
function fillShareDiv(xml) {
 
	var strHtml = "";
	jQuery(xml).find("video").each(function () {
		strHtml += "" + createVideoHtml(this);
	});
	jQuery("#videosDiv").empty();
	jQuery("#videosDiv").html(strHtml);
	jQuery("#videosDiv").show();
}

function createVideoHtml(video) {
    //alert(jQuery(share).find("type").text());
    try{
		var $loc_video = jQuery(video);
		//console.info(' id ==>:'+$loc_video.find("id").text());
		var id = unescape($loc_video.find("id").text());
		//console.info(' title ==>:'+$loc_video.find("title").text());
		var title = unescape($loc_video.find("title").text());
		var tag = unescape($loc_video.find("tag").text());
		var image = unescape($loc_video.find("image").text());
		var userName = $loc_video.find("userName").text();
		var nickName = unescape($loc_video.find("nickName").text());
		var uploadDate = $loc_video.find("uploadDate").text();
		
		var html  = "<div class=\"vidioborder\"> ";
			html += " <div class=\"vidio\"><div class=\"vidio_div1\"> <a href=\"http://v.9you.com/watch/"+id+".html\"><img src=\""+image+"\"  width='173px'  height='129px' /></a></div></div>";
			html += " <div class=\"vidiotext\">"+title+"</div>";
			html += "</div>";
	}catch(e){
		console.info('e:'+e.message);
	}
	return html;
}


