// JavaScript Document
fileTabMenu="module/ajax_tabIndexMenu.php";
function $(id){return document.getElementById(id);};
function $name(name){return document.getElementsByName(name);};
function getWindowSizeAll(a){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){scrollSize=16;myWidth=(a)?window.innerWidth:window.screen.width;myHeight=(a)?window.innerHeight:document.body.parentNode.scrollHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=(a)?document.documentElement.clientWidth:document.body.offsetWidth;myHeight=(a)?document.documentElement.clientHeight:document.body.parentNode.scrollHeight;scrollSize=2;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=(a)?document.body.clientWidth:document.body.offsetWidth;myHeight=(a)?document.body.clientHeight:document.body.offsetHeight;scrollSize=2;}return[myWidth-scrollSize,myHeight];}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX= window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}return[scrOfX,scrOfY];}
function setCenter(id){$(id).style.left=((getWindowSizeAll(true)[0]-$(id).offsetWidth)/2+getScrollXY()[0])+"px";$(id).style.top=((getWindowSizeAll(true)[1]-$(id).offsetHeight)/2+getScrollXY()[1])+"px";};
function $value(node,name){try{return node.getElementsByTagName(name)[0].firstChild.nodeValue;}catch(e){return "";}}
function spacialTag(txt){txt=txt.replace(/>/g,'&gt;');txt=txt.replace(/</g,'&lt;');return txt;}
function spacialChar(txt){
	//txt=txt.replace(/\u000a|\u000d/g,"<br>");
	//txt=txt.replace(/\u0026/g,"&");
	//txt=txt.replace(/\\'/g,"'");
	
	txt = txt.replace(/\\u000a/g,"<br>");
	txt = txt.replace(/\\u003c/g,"<");
	txt = txt.replace(/\\u003e/g,">");
	txt = txt.replace(/\\u0026/g,"&");
	txt = txt.replace(/\\u000d/g,"");
	txt = txt.replace(/\\u0009/g," ");
	txt = txt.replace(/\\/g,"");
	return txt;
}
function strip_tags(html){
		//PROCESS STRING
	if(arguments.length < 3) {
		html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
	} else {
		var allowed = arguments[1];
		var specified = eval("["+arguments[2]+"]");
		if(allowed){
			var regex='</?(?!(' + specified.join('|') + '))\b[^>]*>';
			html=html.replace(new RegExp(regex, 'gi'), '');
		} else{
			var regex='</?(' + specified.join('|') + ')\b[^>]*>';
			html=html.replace(new RegExp(regex, 'gi'), '');
		}
	}

	//CHANGE NAME TO CLEAN JUST BECAUSE 
	var clean_string = html;

	//RETURN THE CLEAN STRING
	return clean_string;
}

function pagecutTab(rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID){	
//alert("rowPerPage"+rowPerPage);alert("allPage"+allPage);alert("thisPage"+thisPage);alert("pagePerGroup"+pagePerGroup);alert("typePage"+typePage);alert("linkPage"+linkPage);alert("box"+box);alert("catID"+catID);alert("subCatID"+subCatID);
	$(box).innerHTML="";
	//var pagePerGroup=10;
	var thisGroup=Math.ceil(thisPage/pagePerGroup);
	var allGroup=Math.ceil(allPage/pagePerGroup);
	var pages="";
	//alert (thisPage);
	if(thisGroup>1&&allGroup>1){
		pages+="<img src=\"images/icon/btn_first.gif\" title=\"First Page\" id=\"pageFitst\" onclick=\"pagecutTab("+rowPerPage+","+allPage+",1,'"+pagePerGroup+"','"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"');\" style=\"cursor:pointer;\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_previous.gif\" title=\"Previous\" id=\"pagePrevious\" onclick=\"pagecutTab("+rowPerPage+","+allPage+","+parseInt((thisGroup-2)*pagePerGroup+1)+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"')\" style=\"cursor:pointer;\" />&nbsp;&nbsp;";
	}else{
		pages+="<img src=\"images/icon/btn_first.gif\" title=\"First Page\" id=\"pageFitst\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_previous.gif\" title=\"Previous\" id=\"pagePrevious\" />&nbsp;&nbsp;";
	}
	for(i=1;(i<=pagePerGroup)&&(i+pagePerGroup*(thisGroup-1)<=allPage);i++){
		if(i+pagePerGroup*(thisGroup-1)==thisPage){
			pages+="<font id=\"pageNum"+(i+pagePerGroup*(thisGroup-1))+"\" style=\"font-weight:bold; color:#3399FF;\">"+(i+pagePerGroup*(thisGroup-1))+"</font>&nbsp;&nbsp;";
		}else{
			var limit=(((i+pagePerGroup*(thisGroup-1))-1)*rowPerPage)+","+rowPerPage;
			pages+="<a href=\"javascript:void(0);\" id=\"pageNum"+(i+pagePerGroup*(thisGroup-1))+"\" onclick=\"pagecutTab("+rowPerPage+","+allPage+","+parseInt(i+pagePerGroup*(thisGroup-1))+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"')\">"+(i+pagePerGroup*(thisGroup-1))+"</a>&nbsp;&nbsp;";
		}
	}
	if(thisGroup<allGroup&&allGroup>1){
		pages+="<img src=\"images/icon/btn_next.gif\" title=\"Next\" id=\"pageNext\" style=\"cursor:pointer;\"";
		pages+="onclick=\"pagecutTab("+rowPerPage+","+allPage+","+parseInt(parseInt(thisPage)+parseInt(5))+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"')\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_last.gif\" title=\"Last Page\" id=\"pageLast\" style=\"cursor:pointer;\"";
		pages+="onclick=\"pagecutTab("+rowPerPage+","+allPage+","+parseInt((allPage-pagePerGroup)+1)+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"')\" />&nbsp;";
	}else{
		pages+="<img src=\"images/icon/btn_next.gif\" title=\"Next\" id=\"pageNext\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_last.gif\" title=\"Last Page\" id=\"pageLast\" />";
	}/**/
	$(box).innerHTML=pages;
	if(typePage=='gall-index'){	cp.call(fileTabMenu,'changePageRecentGallery',resTabIndexGallery,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID);	}
	else if(typePage=='vdo-index'){	cp.call(fileTabMenu,'changePageRecentVideo',resTabIndexVideo,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID);	}
	else if(typePage=='web-index'){ cp.call(fileTabMenu,'changePageRecentWebboard',resTabWebboard,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID);	} 
	else if(typePage=='acd-index'){ cp.call(fileTabMenu,'changePageRecentAccident',resTabAccident,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID);	} 
	else if(typePage=='spon-index'){ cp.call(fileTabMenu,'changePageRecentSponsor',resTabSponsor,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID);	} 
}
function pagecutTabLang(rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID,whereCat){	
//alert("rowPerPage"+rowPerPage);alert("allPage"+allPage);alert("thisPage"+thisPage);alert("pagePerGroup"+pagePerGroup);alert("typePage"+typePage);alert("linkPage"+linkPage);alert("box"+box);alert("catID"+catID);alert("subCatID"+subCatID);
	$(box).innerHTML="";
	//var pagePerGroup=10;
	var thisGroup=Math.ceil(thisPage/pagePerGroup);
	var allGroup=Math.ceil(allPage/pagePerGroup);
	var pages="";
	//alert (thisPage);
	if(thisGroup>1&&allGroup>1){
		pages+="<img src=\"images/icon/btn_first.gif\" title=\"First Page\" id=\"pageFitst\" onclick=\"pagecutTabLang("+rowPerPage+","+allPage+",1,'"+pagePerGroup+"','"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"','"+whereCat+"');\" style=\"cursor:pointer;\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_previous.gif\" title=\"Previous\" id=\"pagePrevious\" onclick=\"pagecutTabLang("+rowPerPage+","+allPage+","+parseInt((thisGroup-2)*pagePerGroup+1)+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"','"+whereCat+"')\" style=\"cursor:pointer;\" />&nbsp;&nbsp;";
	}else{
		pages+="<img src=\"images/icon/btn_first.gif\" title=\"First Page\" id=\"pageFitst\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_previous.gif\" title=\"Previous\" id=\"pagePrevious\" />&nbsp;&nbsp;";
	}
	for(i=1;(i<=pagePerGroup)&&(i+pagePerGroup*(thisGroup-1)<=allPage);i++){
		if(i+pagePerGroup*(thisGroup-1)==thisPage){
			pages+="<font id=\"pageNum"+(i+pagePerGroup*(thisGroup-1))+"\" style=\"font-weight:bold; color:#3399FF;\">"+(i+pagePerGroup*(thisGroup-1))+"</font>&nbsp;&nbsp;";
		}else{
			var limit=(((i+pagePerGroup*(thisGroup-1))-1)*rowPerPage)+","+rowPerPage;
			pages+="<a href=\"javascript:void(0);\" id=\"pageNum"+(i+pagePerGroup*(thisGroup-1))+"\" onclick=\"pagecutTabLang("+rowPerPage+","+allPage+","+parseInt(i+pagePerGroup*(thisGroup-1))+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"','"+whereCat+"')\">"+(i+pagePerGroup*(thisGroup-1))+"</a>&nbsp;&nbsp;";
		}
	}
	if(thisGroup<allGroup&&allGroup>1){
		pages+="<img src=\"images/icon/btn_next.gif\" title=\"Next\" id=\"pageNext\" style=\"cursor:pointer;\"";
		pages+="onclick=\"pagecutTabLang("+rowPerPage+","+allPage+","+parseInt(parseInt(thisPage)+parseInt(5))+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"','"+whereCat+"')\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_last.gif\" title=\"Last Page\" id=\"pageLast\" style=\"cursor:pointer;\"";
		pages+="onclick=\"pagecutTabLang("+rowPerPage+","+allPage+","+parseInt((allPage-pagePerGroup)+1)+","+pagePerGroup+",'"+typePage+"','"+linkPage+"','"+box+"','"+catID+"','"+subCatID+"','"+whereCat+"')\" />&nbsp;";
	}else{
		pages+="<img src=\"images/icon/btn_next.gif\" title=\"Next\" id=\"pageNext\" />&nbsp;";
		pages+="<img src=\"images/icon/btn_last.gif\" title=\"Last Page\" id=\"pageLast\" />";
	}/**/
	$(box).innerHTML=pages;
	cp.call(fileTabMenu,'changePageRecentSponsorLang',resTabSponsor,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,catID,subCatID,whereCat);
}

// ----------------------------------- Tab Webboard ----------------------------------------//
/*function changeTabWebboard(tab,catID,rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box){
	//$('boxTabVideo').innerHTML="<img src=\""+$('pathMain').value+"images/icon/loader.gif\"  />";
	if(tab==1){
		document.getElementById('Board1Tab').className='current';
		document.getElementById('Board2Tab').className='modernbricksmenu';
		document.getElementById('Board3Tab').className='modernbricksmenu';
		document.getElementById('Board4Tab').className='modernbricksmenu';
		document.getElementById('Board5Tab').className='modernbricksmenu';	
		document.getElementById('Board6Tab').className='modernbricksmenu';	
		$('page-index-web').innerHTML="";
	}else if(tab==2){
		document.getElementById('Board1Tab').className='modernbricksmenu';
		document.getElementById('Board2Tab').className='current';
		document.getElementById('Board3Tab').className='modernbricksmenu';
		document.getElementById('Board4Tab').className='modernbricksmenu';	
		document.getElementById('Board5Tab').className='modernbricksmenu';	
		document.getElementById('Board6Tab').className='modernbricksmenu';
		$('page-index-web').innerHTML="";
	}
	else if(tab==3){
		document.getElementById('Board1Tab').className='modernbricksmenu';
		document.getElementById('Board2Tab').className='modernbricksmenu';
		document.getElementById('Board3Tab').className='current';
		document.getElementById('Board4Tab').className='modernbricksmenu';	
		document.getElementById('Board5Tab').className='modernbricksmenu';
		document.getElementById('Board6Tab').className='modernbricksmenu';
		pagecutTab(rowPerPage,allPage,thisPage,pagePerGroup,typePage,linkPage,box,"","");
	}
	else if(tab==4){
		document.getElementById('Board1Tab').className='modernbricksmenu';
		document.getElementById('Board2Tab').className='modernbricksmenu';
		document.getElementById('Board3Tab').className='modernbricksmenu';
		document.getElementById('Board4Tab').className='current';
		document.getElementById('Board5Tab').className='modernbricksmenu';	
		document.getElementById('Board6Tab').className='modernbricksmenu';
		$('page-index-web').innerHTML="";
	}
	else if(tab==5){
		document.getElementById('Board1Tab').className='modernbricksmenu';
		document.getElementById('Board2Tab').className='modernbricksmenu';
		document.getElementById('Board3Tab').className='modernbricksmenu';
		document.getElementById('Board4Tab').className='modernbricksmenu';
		document.getElementById('Board5Tab').className='current';	
		document.getElementById('Board6Tab').className='modernbricksmenu';
		$('page-index-web').innerHTML="";
	}
	else if(tab==6){
		document.getElementById('Board1Tab').className='modernbricksmenu';
		document.getElementById('Board2Tab').className='modernbricksmenu';
		document.getElementById('Board3Tab').className='modernbricksmenu';
		document.getElementById('Board4Tab').className='modernbricksmenu';
		document.getElementById('Board5Tab').className='modernbricksmenu';
		document.getElementById('Board6Tab').className='current';
		$('page-index-web').innerHTML="";
	}
	cp.call(fileTabMenu,'changeTabWebboard',resTabWebboard,tab);

}*/
/*function resTabWebboard(result){
	var tab=result.getElementsByTagName('tab')[0];
	var numTab=tab.getAttribute('id');
	var webID=tab.getElementsByTagName('webID');
	var countCkk=1;
	
	var tabHTML ="";
	tabHTML+="<div class=\"blankN\"></div>";

	for(var i=0;i<webID.length;i++){
		
		var id=$value(webID[i],'id');
		var webTopic=spacialChar($value(webID[i],'webTopic'));
		var webImg=$value(webID[i],'webImg');
		var webVote=$value(webID[i],'webVote');
		var webView=$value(webID[i],'webView');
		var update=$value(webID[i],'update');
		var webDetail=strip_tags(spacialChar($value(webID[i],'webDetail')));
		var webDetail=webDetail.substring(0,300);
		var comment=$value(webID[i],'comment');
		var member=$value(webID[i],'member');
		var memberID=$value(webID[i],'memberID');
		var webCat=$value(webID[i],'webCat');
		var webSubCat=$value(webID[i],'webSubCat')
		var can=$value(webID[i],'can')
		
		tabHTML+="<div class=\"Pastcontent-webboard2\">";
		
			if(can==1){
					tabHTML+="<div class=\"checkBoxBoard\"><input name=\"checkbox"+countCkk+"\" type=\"checkbox\" value=\""+id+"\"></div>";
				}
            	tabHTML+="<div class=\"picRightN\">";
				
                	tabHTML+="<div class=\"imgsize\"><a href=\"webboard_detail.php?webID="+id+"\" ><img src=\""+webImg+"\" width=\"80\" height=\"80\" alt=\""+webTopic+"\" title=\""+webTopic+"\"></a></div>";
            	tabHTML+="</div>";
            	tabHTML+="<div class=\"TitleN\"><a href=\"webboard_detail.php?webID="+id+"\" >"+webTopic+"</a></div>";
            	tabHTML+="<div class=\"TextBoardN2\">";
                	tabHTML+="<a1><a href=\"webboard_detail.php?webID="+id+"\" >"+webDetail+"</a></a1>";
            	tabHTML+="</div>";
        	//tabHTML+="</a>";
	  		tabHTML+="<div class=\"TextBoard-footer\">";
            	tabHTML+=""+$('lang_publisher').value+" <a href=\"member.php?user="+memberID+"\"> "+member+"</a>&nbsp;";
				tabHTML+=""+$('lang_view').value+" : "+webView+"&nbsp;";
				tabHTML+=""+$('lang_comment').value+" : "+comment+"&nbsp;";
				tabHTML+=""+$('lang_date').value+" :"+update+"";
				tabHTML+="<b><a href=\"javascript:void(0);\" title=\"Share Facebook\" onClick=\"javascript:window.open('http://www.facebook.com/sharer.php?u="+$('pathMain').value+"webboard_detail.php?webID="+id+"','Facebook','status = 1, height = 450, width = 500, resizable = 0');\">";
            		tabHTML+="<img src=\"images/icon/facebook_w.png\" width=\"15\" height=\"15\" align=\"bottom margin-top:3px;\"/></a>&nbsp;";
            	tabHTML+="<a href=\"javascript:void(0);\" title=\"Share Twitter\" onClick=\"javascript:window.open('http://twitter.com/home?status="+$('pathMain').value+"webboard_detail.php?webID="+id+"','Twitter','status = 1, height = 520, width = 800, resizable = 0');\">";
					tabHTML+="<img src=\"images/icon/twitter_w.png\" width=\"15\" height=\"15\" align=\"bottom\" /></a>&nbsp;";
				tabHTML+="<a href=\"javascript:void(0);\" title=\""+$('lang_shareEmail').value+"\" onClick=\"shareEmail('"+$('pathMain').value+"webboard_detail.php?webID="+id+"')\">";
            		tabHTML+="<img src=\"images/icon/mail_w.png\" width=\"15\" height=\"17\" align=\"top\" /></a></b>";
				//tabHTML+=""+$('lang_date').value+"&nbsp;"+update+"";
        	tabHTML+="</div>";
  		tabHTML+="</div>";
		
		countCkk++;
	}
//		 
	$('boxTabWebboard').innerHTML=tabHTML;
	
}*/

function changeRightWebboard(tab,current,type,blog_id){  
	if(type=='black'){ cClick="btAJClickVi"; cNoClick="btAJClassVi";	}
	else if(type=='white'){ cClick="btAJClick"; cNoClick="btAJClass";	}
	if(tab=='a'){	//lang_tabBlogNew
		b1=$('lang_tabBlogNew').value;			class1=cClick;			onmouseover1="changeRightWebboard('a',1,'"+type+"','"+blog_id+"')";
		b2=$('lang_tabRecentReply').value;			class2=cNoClick;		onmouseover2="changeRightWebboard('b',2,'"+type+"','"+blog_id+"')";
		b3=$('lang_tabMostReply').value;				class3=cNoClick;		onmouseover3="changeRightWebboard('c',3,'"+type+"','"+blog_id+"')";
		cursor1="";							btclick1="";
		cursor2="cursor:pointer;";		btclick2="changeRightWebboard('b',2,'"+type+"','"+blog_id+"')";
	}
	else if(tab=='b'){ //lang_tabRecentReply
		if(current==2){
			b1=$('lang_tabBlogNew').value;		class1=cNoClick;		onmouseover1="changeRightWebboard('a',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabRecentReply').value;		class2=cClick;			onmouseover2="changeRightWebboard('b',2,'"+type+"','"+blog_id+"')";
			b3=$('lang_tabMostReply').value;			class3=cNoClick;		onmouseover3="changeRightWebboard('c',3,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('a',1,'"+type+"','"+blog_id+"')";
			cursor2="cursor:pointer;";		btclick2="changeRightWebboard('c',3,'"+type+"','"+blog_id+"')";
		}else if(current==1){
			b1=$('lang_tabRecentReply').value;		class1=cClick;			onmouseover1="changeRightWebboard('b',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabMostReply').value;			class2=cNoClick;		onmouseover2="changeRightWebboard('c',2,'"+type+"','"+blog_id+"')";
			b3=$('lang_tabMostVote').value;		class3=cNoClick;		onmouseover3="changeRightWebboard('d',3,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('a',1,'"+type+"','"+blog_id+"')";
			cursor2="cursor:pointer;";		btclick2="changeRightWebboard('c',2,'"+type+"','"+blog_id+"')";
		}
	}
	else if(tab=='c'){ //lang_tabMostReply
		if(current==3){
			b1=$('lang_tabBlogNew').value;		class1=cNoClick;		onmouseover1="changeRightWebboard('a',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabRecentReply').value;		class2=cNoClick;		onmouseover2="changeRightWebboard('b',2,'"+type+"','"+blog_id+"')";
			b3=$('lang_tabMostReply').value;			class3=cClick;			onmouseover3="changeRightWebboard('c',3,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('b',2,'"+type+"','"+blog_id+"')";
			cursor2="cursor:pointer;";		btclick2="changeRightWebboard('d',3,'"+type+"','"+blog_id+"')";
		}else if(current==2){
			b1=$('lang_tabRecentReply').value;		class1=cNoClick;		onmouseover1="changeRightWebboard('b',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabMostReply').value;			class2=cClick;			onmouseover2="changeRightWebboard('c',2,'"+type+"','"+blog_id+"')";
			b3=$('lang_tabMostVote').value;		class3=cNoClick;		onmouseover3="changeRightWebboard('d',3,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('b',1,'"+type+"','"+blog_id+"')";
			cursor2="cursor:pointer;";		btclick2="changeRightWebboard('d',3,'"+type+"','"+blog_id+"')";
		}else if(current==1){
			b1=$('lang_tabMostReply').value;			class1=cClick;			onmouseover1="changeRightWebboard('c',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabMostVote').value;		class2=cNoClick;		onmouseover2="changeRightWebboard('d',2,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('b',1,'"+type+"','"+blog_id+"')";
			cursor2="cursor:pointer;";		btclick2="changeRightWebboard('d',2,'"+type+"','"+blog_id+"')";
		}
	}
	
	else if(tab=='d'){ //lang_tabMostVote
		if(current==3){
			b1=$('lang_tabRecentReply').value;		class1=cNoClick;		onmouseover1="changeRightWebboard('b',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabMostReply').value;			class2=cNoClick;		onmouseover2="changeRightWebboard('c',2,'"+type+"','"+blog_id+"')";
			b3=$('lang_tabMostVote').value;		class3=cClick;			onmouseover3="changeRightWebboard('d',3,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('c',2,'"+type+"','"+blog_id+"')";
			cursor2="";						btclick2="";
		}else if(current==2){
			b1=$('lang_tabMostReply').value;			class1=cNoClick;		onmouseover1="changeRightWebboard('c',1,'"+type+"','"+blog_id+"')";
			b2=$('lang_tabMostVote').value;		class2=cClick;			onmouseover2="changeRightWebboard('d',2,'"+type+"','"+blog_id+"')";
			cursor1="cursor:pointer;";		btclick1="changeRightWebboard('c',1,'"+type+"','"+blog_id+"')";
			cursor2="";						btclick2="";
		}
	}
		var tabHTML ="";
			
        	/*tabHTML+="<center>";
        		tabHTML+="<input type=\"button\" name=\"tab1\" value=\""+b1+"\" class=\""+class1+"\" onclick=\""+onmouseover1+"\" />";	
        		tabHTML+="<input type=\"button\" name=\"tab2\" value=\""+b2+"\" class=\""+class2+"\" onclick=\""+onmouseover2+"\"/>";	
        		tabHTML+="<input type=\"button\" name=\"tab3\" value=\""+b3+"\" class=\""+class3+"\" onclick=\""+onmouseover3+"\"/>";	
        	tabHTML+="</center>";*/
			tabHTML+="<div style=\"position:relative;	width:250px;	height:23px;\">";
				tabHTML+="<ul class=\"menuPage\">";
        		tabHTML+="<li class=\""+class1+"\"><a href=\"javascript:void(0)\" name=\"tab1\"  onclick=\""+onmouseover1+"\">"+b1+"</a></li>";	
        		tabHTML+="<li class=\""+class2+"\" style=\"margin-left:-2px;\"><a href=\"javascript:void(0)\" name=\"tab2\" onclick=\""+onmouseover2+"\">"+b2+"</a></li>";	
        		tabHTML+="<li class=\""+class3+"\" style=\"margin-left:-2px;\"><a href=\"javascript:void(0)\" name=\"tab3\" onclick=\""+onmouseover3+"\">"+b3+"</a></li>";	
				tabHTML+="</ul>";
        	tabHTML+="</div>";
			tabHTML+="<div class=\"floatleft\"><img src=\"pic/btn_first.gif\" style=\"margin-top:15px; margin-left:180px;margin-bottom:8px;"+cursor1+"\" onclick=\""+btclick1+"\" /></div>";
			tabHTML+="<div class=\"floatRight\"><img src=\"pic/btn_last.gif\" style=\"margin-top:15px; margin-right: 5px; margin-bottom:8px;"+cursor2+"\" onclick=\""+btclick2+"\" /></div>";
		$('rightTabWeb').innerHTML=tabHTML;
	
		if(type=='white'){ 	cp_widget.call(fileTabMenu,'changeRightWebboard',resRightWebboard,tab,blog_id); 	}
		//else if(type=='black')	{	cp_widget.call(fileTabMenu,'changeRightWebboard',resRightBlackWebboard,tab); 	}
		//resRightBlackWebboard
}
function resRightWebboard(result){    
	var tab=result.getElementsByTagName('tab')[0];
	var numTab=tab.getAttribute('id');
	var webID=tab.getElementsByTagName('webID');
	
	var tabHTML ="";
	tabHTML+="<div class=\"Pastblank-short\"></div>";

	for(var i=0;i<webID.length;i++){
		//alert (numTab);
		var id=$value(webID[i],'id');
		var webTopic=spacialChar($value(webID[i],'webTopic'));
		var webLevel=$value(webID[i],'webLevel');
		var webReplyID=$value(webID[i],'webReplyID');
		var cutName=webTopic.substring(0,20);
		
		tabHTML+="<div class=\"PastcontentWG\">";
				if(numTab=="b"){
				tabHTML+="<div class=\"listStlye02\" style=\"margin-left:5px;\"><a href=\""+id+"#levalRe"+webLevel+"_"+webReplyID+"\">"+cutName+"</a></div>";
				} else {
				tabHTML+="<div class=\"listStlye02\" style=\"margin-left:5px;\"><a href=\""+id+"\">"+cutName+"</a></div>";
				}
		}
	$('boxRightWeb').innerHTML=tabHTML;
}
/*function resRightBlackWebboard(result){
	var tab=result.getElementsByTagName('tab')[0];
	var numTab=tab.getAttribute('id');
	var webID=tab.getElementsByTagName('webID');
	
	var tabHTML ="";
	tabHTML+="<div class=\"Pastblank-short\"></div>";

	for(var i=0;i<webID.length;i++){
		
		var id=$value(webID[i],'id');
		var webTopic=spacialChar($value(webID[i],'webTopic'));
		var webImg=$value(webID[i],'webImg');
		var webVote=$value(webID[i],'webVote');
		var webView=$value(webID[i],'webView');
		var shotDetail=$value(webID[i],"webDetail");
		var cutName=webTopic.substring(0,20);
		var shotDetail=spacialChar(shotDetail);
		var shotDetail=strip_tags(shotDetail);
		
		tabHTML+="<div class=\"PastcontentWGVi\">";
			tabHTML+="<div class=\"VoteWGVi\">";
  				tabHTML+="<div class=\"WGimgVoteVi\" >";
					tabHTML+="<input type=\"button\" id=\"bt-r-web_"+id+"\" onclick=\"upVoteWeb('bt-r-web_"+id+"','"+id+"')\" value=\""+webVote+"\" class=\"btClassWG\" style=\"vertical-align:top; text-align:center;\" />";
      			tabHTML+="</div>";					
      			tabHTML+="<div class=\"TxtVoteWGVi\"><a href=\"javascript:void(0)\" onclick=\"upVoteWeb('bt-r-web_"+id+"','"+id+"');\">"+$('lang_vote').value+"</a></div>";
      		tabHTML+="</div>";
				tabHTML+="<div class=\"imgvideoWGVi\"><a href=\"webboard_detail.php?webID="+id+"\" ><img src=\""+webImg+"\" width=\"50\" height=\"50\"/></a></div>";
				tabHTML+="<div class=\"TitleWGVideoVi\"><a href=\"webboard_detail.php?webID="+id+"\" onmouseover=\"showTip(this,event,'"+webTopic+"','"+webTopic+"','"+shotDetail+"','"+webImg+"');\">"+cutName+"</a></div>";
			tabHTML+="<div class=\"ViewWGVi\">"+$('lang_view').value+" : "+webView+"</div>";///////////////////////////////////////////////////////////////////////////////////////////////////////////////
		tabHTML+="</div>";
			
			if(numTab=='a'){
			
			}
			
	}
	$('boxRightWeb').innerHTML=tabHTML;
}*/

