function requestSearch(id,template,blogid,tag){
	var tmpl = template;
	var blgid = '';
	
	var clArt = '#CC3333';
	var clCinema = '#FFCC00';
	var clTheater = '#FF9933';
	var clLive = '#8B56D6';
	var clEducation = '#99CC00';
	
	var colorArr = new Array();
	
	colorArr[14] = colorArr[1] = clArt;
	colorArr[8] = colorArr[4] = clCinema;
	colorArr[11] = colorArr[6] = clTheater;
	colorArr[12] = colorArr[7] = clLive;
	colorArr[13] = colorArr[5] = clEducation;
	
	
	if(tmpl=='profile'){
		if(lang=='en') blgid = '10';
		if(lang=='ja') blgid = '3';
	}
	else if(tmpl=='related_event'){
		if(lang=='en') blgid = '13,8,11,12,14';
		if(lang=='ja') blgid = '1,4,5,6,7';
	}
	
	var url = '/mt/mt-search.cgi?Template='+tmpl+'&tag='+tag+'&IncludeBlogs='+blgid;
	
	//e_edu;13,e_cinema:8,e_theater:11,e_live:12,e_art:14
	//e_profile:10,
	//art(j)=1,
	//cinema(j)=4
	//edu(j)=5
	//theater(j)=6
	//live(j)=7
	//profile(j)=3
	
	function onLoadXML(data){
		if(data.root.item!=undefined && data.root.item!=''){
			
			var resultHtml = '';
			if(tmpl=='profile'){
			
				if(lang=='ja'){
					titleHtml = '<h3><img align="作家プロフィール" src="/art/static_images/genre_pofile.gif" width="192" height="20" /></h3>';
				}
				else if(lang=='en'){
					titleHtml = '<h3><img align="artisits profile" src="/en/art/static_images/genre_pofile.gif" width="192" height="20" /></h3>';
				}
					contentsHtml = '';
					for(var i=0; i<data.root.item.length; i++){
					
						photoHtml ='';
						if(data.root.item[i].photo != undefined && data.root.item[i].photo != ''){
							photoHtml = '<img alt="" src="'+data.root.item[i].photo+'" width="96" />';
						}else{
							photoHtml ='<div style="height:26px;"></div>';
						}
						
						if(data.root.item[i].photocap != undefined && data.root.item[i].photocap != ''){
							photoHtml += '<p class="type_menu" style="margin-bottom:10px;">'+data.root.item[i].photocap+'</p>';
						}
						
						
						nameHtml ='';
						if(data.root.item[i].name != undefined && data.root.item[i].name != ''){
							nameHtml = '<p class="name" style="line-height:15px;">'+data.root.item[i].name+'</p>';
						}
						
						profileHtml ='';
						if(data.root.item[i].profile != undefined && data.root.item[i].profile != ''){
							profileHtml = '<p>'+data.root.item[i].profile+'</p>';
							
							replaceProfileHtml = profileHtml.replace(/<p>/g, '<p class="type_menu_10">');
						}
						
						
						contentsHtml += photoHtml + nameHtml + replaceProfileHtml;
					}
					
					
				
				resultHtml +=  titleHtml + contentsHtml;
				$(id).setHTML(resultHtml);
			}


			if(tmpl=='related_event'){
				
				if(lang=='ja'){
					titleHtml = '<h3>関連イベント</h3>';
				}
				else if(lang=='en'){
					titleHtml = '<h3>Related Events</h3>';
				}
					contentsHtml = '';
					for(var i=0; i<data.root.item.length; i++){
					
						isFinish ='';
						if(lang=='ja'){
							if(data.root.item[i].category != undefined && data.root.item[i].category != '' && data.root.item[i].category =='finished'){
								isFinish = '(終了)';
							}
						}
						else if(lang=='en'){
							if(data.root.item[i].category != undefined && data.root.item[i].category != '' && data.root.item[i].category =='finished'){
								isFinish = '(finished)';
							}
						}
					
					
					
						urlHtml ='';
						if(data.root.item[i].url != undefined && data.root.item[i].url != ''){
							urlHtml = '<a href="'+data.root.item[i].url+'" style="border-left:2px solid '+colorArr[data.root.item[i].blogId]+';">';
						}
						
						nameHtml ='';
						if(data.root.item[i].title != undefined && data.root.item[i].title != ''){
							nameHtml = data.root.item[i].title+ isFinish +'</a>';
						}
						
						
						contentsHtml += '<li>'+urlHtml + nameHtml+'</li>';
					}
					
					
				
				resultHtml +=  titleHtml + '<ul>'+contentsHtml+'</ul>';
				$(id).setHTML(resultHtml);
			}
			
			
		}
	}

	var httpObj = new JKL.ParseXML(url);
		httpObj.setOutputArrayElements(['item']);
		httpObj.async(onLoadXML); 
		httpObj.parse();
}
