function SearchTab(sServerName, btnFB, btnTwitter, btnHitAsk, btnWeibo) {
	SearchTab.prototype.serverName = sServerName;
	if (typeof(btnFB) != 'undefined') {
		SearchTab.prototype.btnFB = btnFB;
	}
	if (typeof(btnTwitter) != 'undefined') {
		SearchTab.prototype.btnTwitter = btnTwitter;
	}
	if (typeof(btnHitAsk) != 'undefined') {
		SearchTab.prototype.btnHitAsk = btnHitAsk;
	}
	if (typeof(btnWeibo) != 'undefined') {
		SearchTab.prototype.btnWeibo = btnWeibo;
	}
	SearchTab.prototype.enableMobile = true;
	SearchTab.prototype.linkTarget = "_self";
	SearchTab.prototype.num = 8;
	SearchTab.prototype.targetDivId = "mycontent"; 
	

	this.doQueryNewsPinterest = function(targetDivId, keyword, start, callback) {

		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/news?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href;

		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtmlWithImg = "";
						var tempHtmlWithoutImg = "";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = $.format.date(new Date(), "yyyy-MM-dd");
						var fbArr = null;
						var imgCount = 0;
						var noImgCount = 0;
						
						for ( var j = 0; j < data.responseData.results.length && (imgCount + noImgCount) < 5; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].image != undefined) {
									imgurl = data.responseData.results[j].image.url;
									if (imgurl == "") {
										imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image_ft.png";
									}
								} else {
									imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image_ft.png";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
						            publishedDate = $.format.date(new Date(data.responseData.results[j].publishedDate), "yyyy-MM-dd");
								}								

								if (data.responseData.results[j].image != undefined && imgCount <= 0) {

									tempHtmlWithImg += "<li><div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "<img style=\"display: none;\" src=\"" + imgurl + "\" class=\"hitbox_img\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div></li>";
									
									var tu = data.responseData.results[j].image.url;
									var tw = data.responseData.results[j].image.tbWidth;
									var th = data.responseData.results[j].image.tbHeight;
									var newstitle = data.responseData.results[j].title.replace(/<[^>]+>/g, "");
									var newsurl = data.responseData.results[j].unescapedUrl;
									imgCount++;
		
									
									if (fbArr == null) {
										fbArr = [{ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate}];
									}
									else {
										fbArr.push({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate});
									}
								}
								else {
									tempHtmlWithoutImg += "<li><div class=\"hitbox\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" 
										+ "<div class=\"hitbox_title_container2\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div></li>";
									
									noImgCount++;
								}
							}
						}

						$.post("/cloud_util/Feedback.jsp", { json: JSON.stringify(fbArr)} );
						var tempHtml = $("<ul class=\"ui-listview\">" + tempHtmlWithImg + "</ul>").hide();
						$('#' + targetDivId).html(tempHtml);
						//tempHtml.show('blind', 500);
						tempHtml.animate( { width: "show" }, 2000, 'easeOutQuint' );
						var newsDiv = $(tempHtmlWithoutImg).hide();
						$('#' + targetDivId + ' ul').append(newsDiv);
						//newsDiv.show(1000);
						newsDiv.animate( { width: "show" }, 2000, 'easeOutQuint' );
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						$("#" + targetDivId + " .thumb").thumbs({
							center: true,
							allowZoomIn: false,
							opacity: 0.8,
							fixWidth: 195,
							fixHeight: 254
						});
						if(callback){
							callback();
						}
					}
				});
	}
	
	this.doQueryNewsFlow = function(newsid, keyword, start, callback) {
		var targetDivId = 'news_col_' + newsid;
		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/news?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href;

		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtmlWithImg = "";
						var tempHtmlWithoutImg = "";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = $.format.date(new Date(), "yyyy-MM-dd");
						var fbArr = null;
						var imgCount = 0;
						
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].image != undefined) {
									imgurl = data.responseData.results[j].image.url;
									if (imgurl == "") {
										imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image_ft.png";
									}
								} else {
									imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image_ft.png";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
						            publishedDate = $.format.date(new Date(data.responseData.results[j].publishedDate), "yyyy-MM-dd");
								}								

								if (data.responseData.results[j].image != undefined && imgCount <= 1) {

									tempHtmlWithImg += "<li><div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "<img style=\"display: none;\" src=\"" + imgurl + "\" class=\"hitbox_img\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div></li>";
									
									var tu = data.responseData.results[j].image.url;
									var tw = data.responseData.results[j].image.tbWidth;
									var th = data.responseData.results[j].image.tbHeight;
									var newstitle = data.responseData.results[j].title.replace(/<[^>]+>/g, "");
									var newsurl = data.responseData.results[j].unescapedUrl;
									imgCount++;
		
									
									if (fbArr == null) {
										fbArr = [{ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate}];
									}
									else {
										fbArr.push({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate});
									}
								}
								else {
									
									tempHtmlWithoutImg += "<li><div class=\"hitbox\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" 
										+ "<div class=\"hitbox_title_container2\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div></li>";
								}
							}
						}

						$.post("/cloud_util/Feedback.jsp", { json: JSON.stringify(fbArr)} );
						var tempHtml = $("<ul class=\"ui-listview\">" + tempHtmlWithImg + "</ul>");//.hide();
						$('#' + targetDivId).html(tempHtml);
						//tempHtml.show('blind', 500);
						//tempHtml.animate( { width: "show" }, 2000, 'easeOutQuint' );
						var newsDiv = $(tempHtmlWithoutImg);//.hide();
						$('#' + targetDivId + ' ul').append(newsDiv);
						//newsDiv.show(1000);
						//newsDiv.animate( { width: "show" }, 2000, 'easeOutQuint' );
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						$("#" + targetDivId + " .thumb").thumbs({
							center: true,
							allowZoomIn: true,
							fixWidth: 170,
							fixHeight: 254
						});
						if (callback){
							callback(newsid);
						}
					}
				});
	}
	
	this.doQueryFtFacebook = function(keyword, start, callback) {
		keyword_str = keyword;
		count = 0;
		var strURL = "https://graph.facebook.com/search?type=post&q="
				+ encodeURIComponent(keyword)
				/*+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href*/;

		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtmlWithImg = "";
						var tempHtmlWithoutImg = "";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = $.format.date(new Date(), "yyyy-MM-dd");
						var fbArr = null;
						
						for ( var j = 0; j < data.data.length; j++) {
							if (data.data[j] != undefined) {
								var row = data.data[j];
								
								if (row.link == undefined || row.name == undefined)
									continue;
								
								if (row.picture != undefined) {
									imgurl = row.picture;
								}
								if (row.content != undefined) {
									content = row.content;
								}
								if (row.name != undefined) {
									title = row.name;
								}
								if (row.link != undefined) {
									url = row.link;
								}
								if (row.from.name != undefined) {
									publisher = row.from.name;
								}
								if (row.created_time) {
						            publishedDate = $.format.date(new Date(row.created_time), "yyyy-MM-dd");
								}								

								if (row.picture != undefined) {

									tempHtmlWithImg += "<div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "<img style=\"display: none;\" src=\"" + imgurl + "\" class=\"hitbox_img\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div>";
									
									var tu = row.picture;
									var tw = 130;
									var th = 130;
									var newstitle = title.replace(/<[^>]+>/g, "");
									var newsurl = url;
		
									
									if (fbArr == null) {
										fbArr = [{ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate}];
									}
									else {
										fbArr.push({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate});
									}
								}
								else {

									tempHtmlWithoutImg += "<div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div>";
								}
								count++;
							}
						}

						if (JSON) {
							//$.post("/cloud_util/Feedback.jsp", { json: JSON.stringify(fbArr)} );
						}
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">" + tempHtmlWithImg + tempHtmlWithoutImg + "</ul>";
						$('#' + SearchTab.prototype.targetDivId).html(tempHtml);
						if (count > 0) {
							$('#' + SearchTab.prototype.targetDivId).html(tempHtml);
						}
						else {
							$('#' + SearchTab.prototype.targetDivId).html("No result of [" + keyword_str + "]");
						}
						
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						$("#" + SearchTab.prototype.targetDivId + " .thumb").thumbs({
							center: true,
							fixWidth: 340,
							fixHeight: 245
						});
						if(callback){
							callback();
						}
					}
				});
	}
	
	this.doQueryFtNews = function(keyword, start, callback) {
		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/news?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href;

		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtmlWithImg = "";
						var tempHtmlWithoutImg = "";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = new Date();
						var fbArr = null;
						
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].image != undefined) {
									imgurl = data.responseData.results[j].image.url;
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].publishedDate != undefined && $.format.date) {
						            publishedDate = $.format.date(new Date(data.responseData.results[j].publishedDate), "yyyy-MM-dd");
								}								

								if (data.responseData.results[j].image != undefined) {

									tempHtmlWithImg += "<div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "<img style=\"display: none;\" src=\"" + imgurl + "\" class=\"hitbox_img\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div>";
									
									var tu = data.responseData.results[j].image.url;
									var tw = data.responseData.results[j].image.tbWidth;
									var th = data.responseData.results[j].image.tbHeight;
									var newstitle = data.responseData.results[j].title.replace(/<[^>]+>/g, "");
									var newsurl = data.responseData.results[j].unescapedUrl;
		
									
									if (fbArr == null) {
										fbArr = [{ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate}];
									}
									else {
										fbArr.push({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate});
									}
								}
								else {

									tempHtmlWithoutImg += "<div class=\"hitbox\" data-theme=\"c\" tabindex=\"0\" role=\"option\">" + "<a style=\"color:black\"  href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\">" + "<div class=\"hitbox_img_container thumb\">" + "</div><div class=\"hitbox_title_container\"><span class=\"hitbox_title\">" + title + "</span><span class=\"hitbox_date\">" + publishedDate + "</span>&nbsp;&nbsp;<span class=\"hitbox_source\">" + publisher + "</span></div></a></div>";
								}
							}
						}

						if (JSON) {
							$.post("/cloud_util/Feedback.jsp", { json: JSON.stringify(fbArr)} );
						}
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">" + tempHtmlWithImg + tempHtmlWithoutImg + "</ul>";
						$('#' + SearchTab.prototype.targetDivId).html(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						$("#" + SearchTab.prototype.targetDivId + " .thumb").thumbs({
							center: true,
							fixWidth: 340,
							fixHeight: 245
						});
						if(callback){
							callback();
						}
					}
				});
	}

	this.doQueryNews = function(keyword, start) {
		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/news?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href;

		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = new Date();
						var fbArr = null;
						
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].image != undefined) {
									imgurl = data.responseData.results[j].image.url;
									if (imgurl == "") {
										imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image.gif";
									}
								} else {
									imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image.gif";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
									publishedDate = data.responseData.results[j].publishedDate;
									publishedDate = new Date(publishedDate);
								}
								tempHtml = tempHtml
										+ "<li style=\"min-height: 100px;\" class=\"ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
										+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\" style=\"padding-right:5px;\">"
										+ "<div class=\"ui-btn-text\">"
										+ "<div style=\"overflow: hidden;\" class=\"ui-li-thumb thumb\"><img style=\"display: none;\" src=\"" + imgurl + "\"/></div>"
										+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
										+ "<p class=\"ui-li-desc\">" + content + "</p>"
										+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
										+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + publisher
										+ "</p></div>"
										+ (SearchTab.prototype.btnHitAsk 
												? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnWeibo 
												? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnTwitter
												? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnFB 
												? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
												: "")
										+ "</div></a></li>";

								if (data.responseData.results[j].image != undefined) {
									var tu = data.responseData.results[j].image.url;
									var tw = data.responseData.results[j].image.tbWidth;
									var th = data.responseData.results[j].image.tbHeight;
									var newstitle = data.responseData.results[j].title.replace(/<[^>]+>/g, "");
									var newsurl = data.responseData.results[j].unescapedUrl;
		
									
									if (fbArr == null) {
										fbArr = [{ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate}];
									}
									else {
										fbArr.push({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href, ttl: newstitle, nurl: newsurl, publisher: publisher, date: publishedDate});
									}
									//$.post("/cloud_util/Feedback2.jsp", { json: JSON.stringify({ name: keyword, url: tu, width: tw, height: th, googlelang: temp_lang_str_href })} );
								}
							}
						}
						tempHtml = tempHtml + "</ul>";
						$('#mycontent').html(tempHtml);
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
						
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						$("#mycontent .thumb").thumbs({
							center: true,
							fixWidth: 170,
							fixHeight: 170
						});

						if (JSON) {
							$.post("/cloud_util/Feedback.jsp", { json: JSON.stringify(fbArr)} );
						}
					}
				});
	}

	this.doMoreQueryNews = function() {
		keyword = keyword_str;
		$.mobile.showPageLoadingMsg();
		page = page + SearchTab.prototype.num;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/news?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + page
				+ "&rsz=" + SearchTab.prototype.num + "&ned=" + temp_lang_str_href;
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = "";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].image != undefined) {
									imgurl = data.responseData.results[j].image.url;
									if (imgurl == "") {
										imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image.gif";
									}
								} else {
									imgurl = "http://" + SearchTab.prototype.serverName + "/images/no_image.gif";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
									publishedDate = data.responseData.results[j].publishedDate;
									publishedDate = new Date(publishedDate);
								}
								tempHtml = tempHtml
											+ "<li style=\"padding: 5px; min-height: 100px;\" class=\"ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
											+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\" style=\"padding-right:5px;\">"
											+ "<div class=\"ui-btn-text\">"
											+ "<div style=\"overflow: hidden;\" class=\"ui-li-thumb thumb\"><img style=\"display: none;\" src=\"" + imgurl + "\"/></div>"
											+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
											+ "<p class=\"ui-li-desc\">" + content + "</p>"
											+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
											+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + publisher
											+ "</p></div>"
											+ (SearchTab.prototype.btnHitAsk 
													? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnWeibo 
													? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnTwitter
													? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnFB 
													? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
													: "")
											+ "</div></a></li>";
							}
						}

						tempHtml = tempHtml + "</ul>";
						tempHtml = $('#mycontent').html() + tempHtml;
						$('#mycontent').html(tempHtml);
						$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doQueryWeb = function(keyword, start, site) {
		keyword_str = keyword;

		var qqq = encodeURIComponent(keyword);
		if (typeof (site) != 'undefined') {
			qqq += encodeURIComponent(' site:' + site);
		}
		var strURL = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="
				+ qqq + "&start=" + start + "&rsz=" + SearchTab.prototype.num + "&lr=lang_" + temp_lang_str_href;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var content = "";
						var title = "";
						var author = "";
						var url = "";
						var publishedDate = "";
						if (data.responseData != undefined) {
							for ( var j = 0; j < data.responseData.results.length; j++) {
								if (data.responseData.results[j] != undefined) {
									if (data.responseData.results[j].content != undefined) {
										content = data.responseData.results[j].content;
									}
									if (data.responseData.results[j].title != undefined) {
										title = data.responseData.results[j].title;
									}
									if (data.responseData.results[j].unescapedUrl != undefined) {
										url = data.responseData.results[j].unescapedUrl;
									}
									if (data.responseData.results[j].author != undefined) {
										author = data.responseData.results[j].author;
									}
									if (data.responseData.results[j].publishedDate != undefined) {
										publishedDate = data.responseData.results[j].publishedDate;
									}
									tempHtml = tempHtml
											+ "<li class=\"ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
											+ "<a href=\"" + url
											+ "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\"><div class=\"ui-btn-text\">"
											+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
											+ "<p class=\"ui-li-desc\">" + content + "</p>"
											+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
											+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + author + "</p></div>"
											+ (SearchTab.prototype.btnHitAsk 
													? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnWeibo 
													? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnTwitter
													? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnFB 
													? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
													: "")
											+ "</div></a></li>";
								}
							}
						}
						tempHtml = tempHtml + "</ul>";
						$('#mycontent').html(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doMoreQueryWeb = function() {
		keyword = keyword_str;
		$.mobile.showPageLoadingMsg();
		page = page + SearchTab.prototype.num;
		var qqq = encodeURIComponent(keyword);
		/*
		 * if (typeof(site) != 'undefined') { qqq += ' site:' +
		 * encodeURIComponent(site); }
		 */
		var strURL = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="
				+ qqq + "&start=" + page + "&rsz=" + SearchTab.prototype.num + "&lr=lang_" + temp_lang_str_href;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var content = "";
						var title = "";
						var author = "";
						var url = "";
						var publishedDate = "";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].unescapedUrl != undefined) {
									url = data.responseData.results[j].unescapedUrl;
								}
								if (data.responseData.results[j].author != undefined) {
									author = data.responseData.results[j].author;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
									publishedDate = data.responseData.results[j].publishedDate;
								}
								tempHtml = tempHtml
										+ "<li class=\"ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
										+ "<a href=\"" + url
										+ "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\"><div class=\"ui-btn-text\">"
										+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
										+ "<p class=\"ui-li-desc\">" + content + "</p>"
										+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
										+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + author + "</p></div>"
										+ (SearchTab.prototype.btnHitAsk 
												? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnWeibo 
												? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnTwitter
												? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnFB 
												? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
												: "")
										+ "</div></a></li>";
							}
						}

						tempHtml = tempHtml + "</ul>";
						$('#mycontent').append(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doQueryBlog = function(keyword, start) {
		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num 
				+ "&hl=" + lang_str;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var content = "";
						var title = "";
						var author = "";
						var url = "";
						var publishedDate = "";
						if (data.responseData != undefined) {
							for ( var j = 0; j < data.responseData.results.length; j++) {
								if (data.responseData.results[j] != undefined) {
									if (data.responseData.results[j].content != undefined) {
										content = data.responseData.results[j].content;
									}
									if (data.responseData.results[j].title != undefined) {
										title = data.responseData.results[j].title;
									}
									if (data.responseData.results[j].postUrl != undefined) {
										url = data.responseData.results[j].postUrl;
									}
									if (data.responseData.results[j].author != undefined) {
										author = data.responseData.results[j].author;
									}
									if (data.responseData.results[j].publishedDate != undefined) {
										publishedDate = data.responseData.results[j].publishedDate;
										publishedDate = new Date(publishedDate);
									}
									tempHtml = tempHtml
											+ "<li class=\"ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
											+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\"><div class=\"ui-btn-text\">"
											+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
											+ "<p class=\"ui-li-desc\">" + content + "</p>"
											+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
											+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + author
											+ "</p></div>"
											+ (SearchTab.prototype.btnHitAsk 
													? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnWeibo 
													? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnTwitter
													? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
													: "")
											+ (SearchTab.prototype.btnFB 
													? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
													: "")
											+ "</div></a></li>";
								}
							}
						}
						tempHtml = tempHtml + "</ul>";
						$('#mycontent').html(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doMoreQueryBlog = function() {
		keyword = keyword_str;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		page = page + SearchTab.prototype.num;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/blogs?v=1.0&q=" + encodeURIComponent(keyword)
				+ "&start=" + page
				+ "&rsz=" + SearchTab.prototype.num 
				+ "&hl=" + lang_str;
		$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var content = "";
						var title = "";
						var author = "";
						var url = "";
						var publishedDate = "";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].postUrl != undefined) {
									url = data.responseData.results[j].postUrl;
								}
								if (data.responseData.results[j].author != undefined) {
									author = data.responseData.results[j].author;
								}
								if (data.responseData.results[j].publishedDate != undefined) {
									publishedDate = data.responseData.results[j].publishedDate;
									publishedDate = new Date(publishedDate);
								}
								tempHtml = tempHtml
										+ "<li class=\"ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
										+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\"><div class=\"ui-btn-text\">"
										+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
										+ "<p class=\"ui-li-desc\">" + content + "</p>"
										+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
										+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + author
										+ "</p></div>"
										+ (SearchTab.prototype.btnHitAsk 
												? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnWeibo 
												? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnTwitter
												? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnFB 
												? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
												: "")
										+ "</div></a></li>";
							}
						}

						tempHtml = tempHtml + "</ul>";
						$('#mycontent').append(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doQueryYoutube = function(keyword, start) {
		keyword_str = keyword;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/video?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + start
				+ "&rsz=" + SearchTab.prototype.num 
				+ "&hl=" + temp_lang_str_href;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = "";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].tbUrl != undefined) {
									imgurl = data.responseData.results[j].tbUrl;
									if (imgurl == "") {
										imgurl = "http://"
												+ SearchTab.prototype.serverName
												+ "/images/no_image.gif";
									}
								} else {
									imgurl = "http://"
											+ SearchTab.prototype.serverName
											+ "/images/no_image.gif";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].playUrl != undefined) {
									url = data.responseData.results[j].playUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].published != undefined) {
									publishedDate = data.responseData.results[j].published;
								}
								tempHtml = tempHtml
										+ "<li style=\"padding: 5px;\" class=\"ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
										+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\" style=\"padding-right:5px;\">"
										+ "<img src=\"" + imgurl + "\" class=\"ui-li-thumb\"/><div class=\"ui-btn-text\">"
										+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
										+ "<p class=\"ui-li-desc\">" + content + "</p>"
										+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
										+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + publisher
										+ "</p></div>"
										+ (SearchTab.prototype.btnHitAsk 
												? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnWeibo 
												? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnTwitter
												? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnFB 
												? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
												: "")
										+ "</div></a></li>";

							}
						}

						tempHtml = tempHtml + "</ul>";
						$('#mycontent').html(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doMoreQueryYoutube = function() {
		keyword = keyword_str;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		page = page + SearchTab.prototype.num;
		var strURL = "https://ajax.googleapis.com/ajax/services/search/video?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&start=" + page
				+ "&rsz=" + SearchTab.prototype.num 
				+ "&hl=" + temp_lang_str_href;
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
						var imgurl = "";
						var content = "";
						var title = "";
						var publisher = "";
						var url = "";
						var publishedDate = "";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].tbUrl != undefined) {
									imgurl = data.responseData.results[j].tbUrl;
									if (imgurl == "") {
										imgurl = "http://"
												+ SearchTab.prototype.serverName
												+ "/images/no_image.gif";
									}
								} else {
									imgurl = "http://"
											+ SearchTab.prototype.serverName
											+ "/images/no_image.gif";
								}
								if (data.responseData.results[j].content != undefined) {
									content = data.responseData.results[j].content;
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].playUrl != undefined) {
									url = data.responseData.results[j].playUrl;
								}
								if (data.responseData.results[j].publisher != undefined) {
									publisher = data.responseData.results[j].publisher;
								}
								if (data.responseData.results[j].published != undefined) {
									publishedDate = data.responseData.results[j].published;
								}
								tempHtml = tempHtml
										+ "<li style=\"padding: 5px;\" class=\"ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
										+ "<a href=\"" + url + "\" target=\"" + SearchTab.prototype.linkTarget + "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\" style=\"padding-right:5px;\">"
										+ "<img src=\"" + imgurl + "\" class=\"ui-li-thumb\"/><div class=\"ui-btn-text\">"
										+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
										+ "<p class=\"ui-li-desc\">" + content + "</p>"
										+ "<p class=\"ui-li-desc\">" + publishedDate + "</p>"
										+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + publisher
										+ "</p></div>"
										+ (SearchTab.prototype.btnHitAsk 
												? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnWeibo 
												? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnTwitter
												? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
												: "")
										+ (SearchTab.prototype.btnFB 
												? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
												: "")
										+ "</div></a></li>";
							}
						}

						tempHtml = tempHtml + "</ul>";
						$('#mycontent').append(tempHtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
	};

	this.doQueryImg = function(keyword, start, site) {
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		var strhtml = "<div id=\"thumbs_container\" class=\"current\"><ul style=\"display: block;\" class=\"thumbView\" id=\"thumbs\">";

		
		var strURL = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&imgsz=large&start=" + start
				+ "&rsz=" + SearchTab.prototype.num + "&nl=" + temp_lang_str_href;

		if (typeof (site) != 'undefined') {
			strURL += '&as_sitesearch=' + encodeURIComponent(site);
		}
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var imgurl = "";
						var url = "";
						var title = "";
						var imgstyle = "margin-left: 0px;";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].tbUrl != undefined) {
									imgurl = data.responseData.results[j].tbUrl;
									if (imgurl == "") {
										imgurl = "http://"
												+ SearchTab.prototype.serverName
												+ "/images/noimage.gif";
									}
								} else {
									imgurl = "http://"
											+ SearchTab.prototype.serverName
											+ "/images/noimage.gif";
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].originalContextUrl != undefined) {
									url = data.responseData.results[j].originalContextUrl;
								}

								strhtml = strhtml
										+ "<li class=\"pic\" style=\"" + imgstyle + "\"><a href=\"" + url + "\">"
										+ "<img width=\"70\" height=\"70\" title=\"" + title + "\" alt=\"" + imgurl + "\" src=\"" + imgurl + "\"></a></li>";
							}
						}
						strhtml = strhtml + "</ul></div>"
						$('#mycontent').html(strhtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});
		// 多query
		doMoreQueryImg();
	};

	this.doMoreQueryImg = function() {
		keyword = keyword_str;
		if (SearchTab.prototype.enableMobile)
			$.mobile.showPageLoadingMsg();
		page = page + SearchTab.prototype.num;
		var strhtml = "<div id=\"thumbs_container\" class=\"current\"><ul style=\"display: block;\" class=\"thumbView\" id=\"thumbs\">";
		var strURL = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q="
				+ encodeURIComponent(keyword)
				+ "&imgsz=large&start=" + page
				+ "&rsz=" + SearchTab.prototype.num + "&nl=" + temp_lang_str_href;
		$.ajax({
					type : 'GET',
					dataType : 'jsonp',
					url : strURL,
					success : function(data) {
						var imgurl = "";
						var url = "";
						var title = "";
						var imgstyle = "margin-left: 0px;";
						for ( var j = 0; j < data.responseData.results.length; j++) {
							if (data.responseData.results[j] != undefined) {
								if (data.responseData.results[j].tbUrl != undefined) {
									imgurl = data.responseData.results[j].tbUrl;
									if (imgurl == "") {
										imgurl = "http://"
												+ SearchTab.prototype.serverName
												+ "/images/noimage.gif";
									}
								} else {
									imgurl = "http://"
											+ SearchTab.prototype.serverName
											+ "/images/noimage.gif";
								}
								if (data.responseData.results[j].title != undefined) {
									title = data.responseData.results[j].title;
								}
								if (data.responseData.results[j].originalContextUrl != undefined) {
									url = data.responseData.results[j].originalContextUrl;
								}

								strhtml = strhtml
										+ "<li class=\"pic\" style=\"" + imgstyle + "\"><a href=\"" + url + "\">"
										+ "<img width=\"70\" height=\"70\" title=\"" + title + "\" alt=\"" + imgurl + "\" src=\"" + imgurl + "\"></a></li>";
							}
						}
						strhtml = strhtml + "</ul></div>"
						$('#mycontent').append(strhtml);
						if (SearchTab.prototype.enableMobile)
							$.mobile.hidePageLoadingMsg();
						
						if (SearchTab.prototype.callback) {
							SearchTab.prototype.callback();
						}
					}
				});

	};
	
	this.getRssFeed = function(feedUrl, keyword, start, rows) {
	    jQuery.getFeed({
	        url: '/cloud_util/FeedProxy.jsp',
	        data: {url: feedUrl},
	        success: function(feed) {	            
	            var tempHtml = "<ul class=\"ui-listview\" data-role=\"listview\" role=\"listbox\">";
				var imgurl = "";
				var content = "";
				var title = "";
				var publisher = "";
				var url = "";
				var publishedDate = "";
				var author = "";
				var keyword = keyword_str;
	            
	            for(var i = start; i < feed.items.length && i < rows; i++) {
	                var item = feed.items[i];
	                
	                title = item.title;
	                url = item.link;
	                content = item.description.replace(/<[^>]+?>/g, '');
	                content = $('<div/>').text(content).html();
	                publishedDate = item.updated;
	                publishedDate = new Date(publishedDate);
	                
	                tempHtml = tempHtml
							+ "<li class=\"ui-btn ui-btn-icon-right ui-li ui-btn-up-c\" role=\"option\" tabindex=\"0\" data-theme=\"c\">"
							+ "<a href=\"" + url
							+ "\" class=\"ui-link-inherit\"><div class=\"ui-btn-inner\"><div class=\"ui-btn-text\">"
							+ "<h3 class=\"ui-li-heading\">" + title + "</h3>"
							+ "<p class=\"ui-li-desc\">" + content + "</p>"
							+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + publishedDate + "</p>"
							+ "<p class=\"ui-li-desc\" style=\"color:#9ACD32\">" + author + "</p></div>"
							+ (SearchTab.prototype.btnHitAsk 
									? "<iframe src=\"http://hithot.cc/util/hitask.jsp?kkkk=" + keyword + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
									: "")
							+ (SearchTab.prototype.btnWeibo 
									? "<iframe src=\"http://hithot.cc/util/weibo.jsp?url=" + encodeURIComponent(url) + "&ttl=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "\" scrolling=\"no\" frameborder=\"0\" width=\"56\" height=\"72\"></iframe>"
									: "")
							+ (SearchTab.prototype.btnTwitter
									? "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/tweet_button.html?text=" + encodeURIComponent("[" + keyword + "] " + title.replace(/<[^>]+>/g, "")) + "&count=vertical&url=" + encodeURIComponent(url) + "&counturl=" + encodeURIComponent(url) + "\" style=\"width:65px; height:65px;\"></iframe>"
									: "")
							+ (SearchTab.prototype.btnFB 
									? "<iframe src=\"http://www.facebook.com/plugins/like.php?href=" + encodeURIComponent(url) + "&amp;layout=box_count&amp;show_faces=true&amp;width=65&amp;action=like&amp;colorscheme=dark&amp;height=65\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:50px; height:65px;\" allowTransparency=\"true\"></iframe>"
									: "")
							+ "</div></a></li>";
	            }
	            
	            jQuery('#mycontent').html(tempHtml);
				
				if (SearchTab.prototype.callback) {
					SearchTab.prototype.callback();
				}
	        }    
	    });
	};
};

