String.prototype.trim = function() {
    return this.replace(/(^ *)|( *$)/g, "").replace(/¡©*/g,"");
}
String.prototype.ltrim = function() {
    return this.replace(/(^ *)/g, "");
}
String.prototype.rtrim = function() {
    return this.replace(/( *$)/g, "");
}
String.prototype.removeBlank = function(){
	return this.replace(/(^ *)|( *)|( *$)/g, "");
}

function popUpImage(fileName){

	window.open('/common/popupImage.asp?realFile=' + fileName,'FIFO_IMAGE_VIEW','top=20,left=20,width=180,height=138,scrollbars=1,resizable=1');

}

function delComment(idx, c_idx){
		location.href="/news/news_comment_del.asp?act=DEL&idx="+ idx +"&c_idx=" + c_idx;
}

function delComment_photo(idx, c_idx){
		location.href="/news/news_photo_comment_del.asp?act=DEL&idx="+ idx +"&c_idx=" + c_idx;
}

function delComment_comm(idx, c_idx, cat){
		location.href="comm_comment_del.asp?act=DEL&idx="+ idx +"&c_idx=" + c_idx + "&cat=" + cat;
}

function delComment_notice(idx, c_idx, cat){
		location.href="notice_comment_del.asp?act=DEL&idx="+ idx +"&c_idx=" + c_idx + "&cat=" + cat;
}

function modifyArticle(idx, page, cat){
	location.href='comm_write.asp?idx='+ idx +'&page='+ page +'&cat='+ cat +'&act=edit';
}

function deleteArticle(idx, page, cat){
	if(confirm('\n»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?           \n\n')){
		if(cat == 'PIC'){
			location.href='pict_del.asp?idx='+ idx +'&page='+ page +'&cat='+ cat +'&act=del';
		}else{
			location.href='comm_write_ok.asp?idx='+ idx +'&page='+ page +'&cat='+ cat +'&act=del';
		}
	}
}

function replyArticle(idx, page, cat){
	location.href='comm_write.asp?idx='+ idx +'&page='+ page +'&cat='+ cat;
}

function goList(page, cat){
	location.href='comm_list.asp?cat='+ cat +'&page='+ page;
}

function vote(){
	var isCheck;
	isCheck = false;

	if(document.all.votePanel.style.display == 'none'){
		showVotePanel();
	}else{

		for(i=0;i<document.poll.pollRadio.length;i++){
			if(document.poll.pollRadio[i].checked){
				isCheck = true;
				break;
			}
		}

		if(isCheck){
			document.poll.submit();
		}else{
			alert('\nÅõÇ¥ÇÏ½Ç Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.   \n\n');
		}
	}
}

function showVotePanel(){
	document.all.votePanel.style.display = 'block';
	document.all.resultPanel.style.display = 'none';
}

function voteResult(){
	document.all.votePanel.style.display = 'none';
	document.all.resultPanel.style.display = 'block';
}

function voteRightPanel(){
	var isCheck;
	isCheck = false;

	for(i=0;i<document.pollRight.pollRadio.length;i++){
		if(document.pollRight.pollRadio[i].checked){
			isCheck = true;
			break;
		}
	}

	if(isCheck){
		document.pollRight.submit();
	}else{
		alert('\nÅõÇ¥ÇÏ½Ç Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.   \n\n');
	}
}

function voteResultRightPanel(){
	location.href='/community/comm_read.asp?cat=POL&idx='+ document.pollRight.idx.value + '&showResult=T';
}

function voteMain(idx, voteFlag){
	if(voteFlag){
		location.href='/community/comm_read.asp?cat=POL&idx='+ idx;
	}else{
		location.href='/community/comm_read.asp?cat=POL&idx='+ idx + '&showResult=T';
	}
}

function checkemail(email){
	var re = /^[-0-9a-zA-Z_]+@[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$/;
	var result = re.test(email);
	return result;
}

function textPlus(obj){
	var fSize = document.all[obj].style.fontSize;
	if(fSize == ''){
		fSize = 12;
	}else if (parseInt(fSize.substr(0,fSize.lastIndexOf('pt')),10) > 20){
		return;
	}else{
		fSize = parseInt(fSize.substr(0,fSize.lastIndexOf('pt')),10) + 1;
	}
	document.all[obj].style.fontSize = fSize + 'pt';
}

function textMinus(obj){
	var fSize = document.all[obj].style.fontSize;
	if(fSize == ''){
		fSize = 10;
	}else if (parseInt(fSize.substr(0,fSize.lastIndexOf('pt')),10) < 8){
		return;
	}else{
		fSize = parseInt(fSize.substr(0,fSize.lastIndexOf('pt')),10) - 1;
	}
	document.all[obj].style.fontSize = fSize + 'pt';
}

function openRelay(relayUrl){
	window.open(relayUrl,'FighterForumRelay','width=800,height=600');
}