function editor_init() {
	for(var i=0;i<frames.length;i++) frames[i].document.designMode = 'On';
}
function get_iframe_content(obj) {
	//alert(obj);
	window.frames[obj].document.body.innerHTML = document.myform[obj].value;	
	
}
function edit_text(obj, command) {
	frames[obj].document.execCommand(command, false, null); 
}
function create_link(obj) {
	frames[obj].document.execCommand('createlink', true, null); 
}
function edit_finalize() {
	for(var i=0;i<frames.length;i++) {
		document.myform[frames[i].name].value = frames[i].document.body.innerHTML;
		
	}
	
	if (document.pform.marathon_date) document.pform.marathon_date.value=document.pform.fYear.value+"-"+document.pform.fMonth.value+"-"+document.pform.fDay.value;
	if (document.pform.travel_date) document.pform.travel_date.value=document.pform.dYear.value+"-"+document.pform.dMonth.value+"-"+document.pform.dDay.value;
	if (document.pform.event_date) document.pform.event_date.value=document.pform.fYear.value+"-"+document.pform.fMonth.value+"-"+document.pform.fDay.value;
	if (document.pform.birth_date) document.pform.birth_date.value=document.pform.fYear.value+"-"+document.pform.fMonth.value+"-"+document.pform.fDay.value;
	if (document.pform.event_time) document.pform.event_time.value=document.pform.fHour.value+":"+document.pform.fMinute.value+":00";
	
	
	if (document.pform.fMonth) document.pform.fMonth.disabled=true;
	if (document.pform.fDay) document.pform.fDay.disabled=true;
	if (document.pform.fYear) document.pform.fYear.disabled=true;
	if (document.pform.fHour) document.pform.fHour.disabled=true;
	if (document.pform.fMinute) document.pform.fMinute.disabled=true;
	if (document.pform.fSecond) document.pform.fSecond.disabled=true;
	
	if (document.pform.dMonth) document.pform.dMonth.disabled=true;
	if (document.pform.dDay) document.pform.dDay.disabled=true;
	if (document.pform.dYear) document.pform.dYear.disabled=true;
	
	if (document.pform.rMonth) document.pform.rMonth.disabled=true;
	if (document.pform.rDay) document.pform.rDay.disabled=true;
	if (document.pform.rYear) document.pform.rYear.disabled=true;
	
	if (document.pform.chk_pay) document.pform.chk_pay.disabled=true;
}