function drawMessageDialog(){
var msgBox = '<table id="msgBox" align=center cellspacing=0 cellpadding=0 style="width: 400px; display: none; border: 1px silver solid;">';
msgBox += '<tr>';
msgBox += '<td class=buttonoff style="text-align: center; width: 400px;"><img align=right src="/themes/x.gif" onClick="switchDisplayId(\'msgBox\');"><img align=right src="/themes/minimize.gif" onClick="switchDisplayId(\'msgBoxContentRow\');">Kotak Pesan Baru</td>';
msgBox += '</tr>';
msgBox += '<tr id="msgBoxContentRow">';
msgBox += '<td id="msgBoxContent" style="background: #F5F5F5; width: 400px; padding: 5px;"></td>';
msgBox += '</tr></table>';
document.write(msgBox);
}

function showMessage(msg){
	var fContent = document.getElementById('msgBoxContent');
	if (fContent){
		fContent.innerHTML = msg;
		var fBox = document.getElementById('msgBox');
		var leftMsg = (window.innerWidth/2)-200;
		setDisplayId('msgBox', 'block')
		if (fBox){
			fBox.style.left = leftMsg;
		}
	}
}

function confirmation(msg, link){
	showMessage('<center>'+msg+'<br><br><button style="font: bold 10px verdana;" onClick="top.location.href=\''+link+'\';">Ya</button> &nbsp; <button style="font: bold 10px verdana;" onClick="switchDisplayId(\'msgBox\');">Ga</button>');
}

function kirimSMS(id, name){
	var smsBox ='<center>';
	smsBox += '<a href="/'+id+'"><img border=0 src="/images/members/frame/1/'+id+'.jpg"><br>'+name+'</a>';
	smsBox += '<br><b>Kirim SMS Langsung</b>';
	smsBox += '<form method=POST action="/php/kirim.pesan/o/'+id+'">';
	smsBox += 'Sisa Karakter: <span id="IDpanjang">1024</span><br><textarea style="width:390px; height:128px;" name="isi" onKeyUp=\'CheckMaxLength(this, 1024, "IDpanjang");\' onBlur=\'CheckMaxLength(this, 1024, "IDpanjang");\'></textarea><br><input type=submit value="Kirim" name=submit><button onClick="top.location.href=\'/php/kirim.pesan/o/'+id+'\'">Buka SMS Lainnya</button>';
	smsBox += '<form></center>';
	showMessage(smsBox);
}

drawMessageDialog();