// fill space
var flash = '/images/template/temp' + Math.round((Math.random())*8) + '.swf';
function makePageEqual(eventNumber) {

	if(eventNumber>0) {
		document.getElementById('fill_1').style.height = 0 + 'px';
		document.getElementById('fill_2_3').style.height = 0 + 'px';
		document.getElementById('fill_1').style.display='none';
		document.getElementById('fill_2_3').style.display='none';
	}

	var column_2_height = document.getElementById('column_2').offsetHeight;
	var column_3_height = document.getElementById('column_3').offsetHeight;
	var difference_2_3 = column_2_height - column_3_height;

	if(Math.abs(difference_2_3) > 20 && eventNumber!=1) {
		if(difference_2_3 > 0) {
			div_2_3_id = 'fill_3'; 
			document.getElementById(div_2_3_id).style.marginRight = '10px';
			html_2_3_content = '<div style="width:298px; height:' + (Math.abs(difference_2_3) - 12) + 'px; z-index:1"><embed src="'+flash+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" width="298" height="' + (Math.abs(difference_2_3) - 12) + '"></embed></div>';
		} 
		else {
			div_2_3_id = 'fill_2'; 
			html_2_3_content = '<div style="width:218px; height:' + (Math.abs(difference_2_3) - 12) + 'px; z-index:1"><embed src="'+flash+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" width="218" height="' + (Math.abs(difference_2_3) - 12) + '"></embed></div>';
		}
		document.getElementById(div_2_3_id).style.height = (Math.abs(difference_2_3) - 12) + 'px';
		document.getElementById(div_2_3_id).style.borderWidth = '1px';
		document.getElementById(div_2_3_id).style.borderStyle = 'solid';
		document.getElementById(div_2_3_id).style.borderColor = '#CCCCCC';
		document.getElementById(div_2_3_id).innerHTML = html_2_3_content; 
		document.getElementById(div_2_3_id).style.display = 'block';
	}

	var column_1_height = document.getElementById('column_1').offsetHeight;
	var column_23_height = document.getElementById('column_2_3').offsetHeight;
	var difference_1_23 = column_1_height - column_23_height;

	if(Math.abs(difference_1_23)>50) {
		if(difference_1_23>0) {
			div_1_23_id = 'fill_2_3'; 
			html_1_23_content = '<div style="width:528px; height:' + (Math.abs(difference_1_23) - 12) + 'px; z-index:1"><embed src="'+flash+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" width="528" height="' + (Math.abs(difference_1_23) - 12) + '"></embed></div>';
		}
		else {
			div_1_23_id = 'fill_1'; 
			document.getElementById(div_1_23_id).style.marginLeft = '10px';
			html_1_23_content = '<div style="width:438px; height:' + (Math.abs(difference_1_23) - 12) + 'px; z-index:1"><embed src="'+flash+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" width="438" height="' + (Math.abs(difference_1_23) - 12) + '"></embed></div>';
		}
		document.getElementById(div_1_23_id).style.marginRight = '10px';
		document.getElementById(div_1_23_id).style.height = (Math.abs(difference_1_23) - 12) + 'px';
		document.getElementById(div_1_23_id).style.borderWidth = '1px';
		document.getElementById(div_1_23_id).style.borderStyle = 'solid';
		document.getElementById(div_1_23_id).style.borderColor = '#CCCCCC';
		document.getElementById(div_1_23_id).innerHTML = html_1_23_content; 
		document.getElementById(div_1_23_id).style.display = 'block';
	}
}

// show comments
function showComments() {
	document.getElementById('commnets_brief').style.display='none';
	document.getElementById('comments_list').style.display='block';
	document.getElementById('comment_post').style.display='block';
	makePageEqual(1);
}

// check data
function checkData() {
	String.prototype.Trim = function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
	String.prototype.Ltrim = function(){return this.replace(/(^\s*)/g, "");}
	String.prototype.Rtrim = function(){return this.replace(/(\s*$)/g, "");}
	if(document.forms[1].mho_NewsComAuthor.value.Trim() =="") {
		document.forms[1].mho_NewsComAuthor.value = "";
		alert("Your Name Please!");
		document.forms[1].mho_NewsComAuthor.focus();
		return false;
	}
	if(document.forms[1].mho_NewsComCopy.value.Trim() =="") {
		document.forms[1].mho_NewsComCopy.value = "";
		alert("Comment Copy Please!");
		document.forms[1].mho_NewsComCopy.focus();
		return false;
	}
	if(document.forms[1].authinput.value.Trim() =="") {
		document.forms[1].authinput.value = "";
		alert("4-character Please!");
		document.forms[1].authinput.focus();
		return false;
	}
}

