/*<![CDATA[
#(c)XAXMXAXRXUXLXLXZX
*/
function getID(field){
    return document.getElementById ? document.getElementById(field) : document.all(field);
}
function Show(field){
  field.style.display='';
}
function Hide(field){
  field.style.display='none';
}
function popUp(field){
    wind=window.open('about:blank','','');
    wind.focus();
    wind.location=field.href;
    return false;
}function printFriendly(html){
	wind=window.open('about:blank','','');
	wind.focus();
	wind.document.open();
	wind.document.write('<html><body style="font-family:arial,tahoma,sans-serif;font-size:12px"><div style="width:800px;margin:auto;padding:10px;border:1px solid #000000">'+html+'</div></body></html>');
	wind.document.close();
	return false;
}
function msg_delete(){
  return confirm("Are you sure ?");
}
function setOpacity(field,val){
    if(val<0) val=0;
	if(val>100) val=100;
	
	field.style.opacity=val/100;
	if (val==100)
		field.style.filter="";
	else
		field.style.filter="alpha(opacity="+val+")";
	field.currentOpacity=val;
}
function drawFlash(field,s,w,h){
    var d=  'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0';
    var h=  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+d+'" name="base" height="'+h+'" width="'+w+'">'+
            '<param name="movie" value="'+s+'" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="bgcolor" value="#000000" />'+
            '<embed src="'+s+'" quality="high" menu="false" type="application/x-shockwave-flash" height="'+h+'" width="'+w+'" />'+
            '</object>';
    if (field==false)
        document.write(h);
    else
        field.innerHTML=h;
}

//-- Callback:
function doc_load(){
    // Load
    for (i=0;i<document.getElementsByTagName("input").length;i++){
        field=document.getElementsByTagName("input")[i];
        if (field.className=="inputbox"){
            field.old_focus=field.onfocus;
            field.old_blur=field.onblur;
            field.onfocus=function(){
                this.style.borderColor="#22aa22";
                this.style.backgroundColor="#ffffff";
                if (this.old_focus)
                    this.old_focus();
            };
            field.onblur=function(){
                this.style.borderColor="";
                this.style.backgroundColor="";
                if (this.old_blur)
                    this.old_blur();
            };
        }
        else if (field.className=="inputbutton"){
            field.onmouseover=function(){
                this.style.backgroundPosition="left -22px";
            };
            field.onmouseout=function(){
                this.style.backgroundPosition="";
            };
        }
    }
    for (i=0;i<document.getElementsByTagName("textarea").length;i++){
        field=document.getElementsByTagName("textarea")[i];
        if (field.className=="inputbox"){
            field.old_focus=field.onfocus;
            field.old_blur=field.onblur;
            field.onfocus=function(){
                this.style.borderColor="#22aa22";
                this.style.backgroundColor="#ffffff";
                if (this.old_focus)
                this.old_focus();
            };
            field.onblur=function(){
                this.style.borderColor="";
                this.style.backgroundColor="";
                if (this.old_blur)
                this.old_blur();
            };
        }
    }
}
onload=doc_load;

//-- TABBED:
function tabclick(field,contentPrefix){
	//setOpacity
    tabsEl=field.parentNode.childNodes;
	waitShow=0;
	var hidenmid='';
    for (i=0;i<tabsEl.length;i++){
        if (tabsEl[i].nodeName.toLowerCase()=='a'){
            tabsEl[i].className='';
            contentID=tabsEl[i].href.substr(5);
			if (getID(contentPrefix+contentID).style.display==''){
				nmid=contentPrefix+contentID;
				getID(nmid).style.width='100%';
				for (j=0;i<100;i+=5){
					setTimeout('setOpacity(getID("'+nmid+'"),'+(100-i)+')',i*2);
				}
				hidenmid=nmid;
				waitShow=(i*2)+10;
			}
			else
				getID(contentPrefix+contentID).style.display='none';
        }
    }
    field.className='tab_active';
    contentID=field.href.substr(5);
	nmid=contentPrefix+contentID;
	getID(nmid).style.width='100%';
	setTimeout('setOpacity(getID("'+nmid+'"),0);getID("'+hidenmid+'").style.display="none";getID("'+nmid+'").style.display="";',waitShow);
	waitShow+=50;
	for (i=0;i<100;i+=5){
		setTimeout('setOpacity(getID("'+nmid+'"),'+(i)+')',(i*2) + waitShow);
	}
	setTimeout('setOpacity(getID("'+nmid+'"),100);',(i*2)+50+waitShow);	
    field.blur();
    return false;
}

//-- Input Tags Filterer
function isNumber(field){
    allowNum="0123456789";
    tmpstr=field.value.toString();
    var minus=false; if (tmpstr.substring(0,1)=='-') minus=true;
    tmpstrnew="";

    isNotNULL=false;
    for (var i=0;i<tmpstr.length;i++){
        if (allowNum.indexOf(tmpstr.substring(i,i+1))>=0){
            if (isNotNULL||(tmpstr.substring(i,i+1)!='0')){
                tmpstrnew+=tmpstr.substring(i,i+1);
                isNotNULL=true;
            }
        }
    }
    if (tmpstrnew.length==0) tmpstrnew='0';
    if (minus) tmpstrnew='-'+tmpstrnew;
    if (tmpstrnew!=field.value)
        field.value=tmpstrnew;
}
function toNumber(str){
    allowNum="0123456789";
    tmpstr=str.toString();
    var minus=false; if (tmpstr.substring(0,1)=='-') minus=true;
    tmpstrnew="";

    isNotNULL=false;
    for (var i=0;i<tmpstr.length;i++){
        if (allowNum.indexOf(tmpstr.substring(i,i+1))>=0){
            if (isNotNULL||(tmpstr.substring(i,i+1)!='0')){
                tmpstrnew+=tmpstr.substring(i,i+1);
                isNotNULL=true;
            }
        }
    }
    if (tmpstrnew.length==0) tmpstrnew='0';
    if (minus) tmpstrnew='-'+tmpstrnew;
    if (tmpstrnew!=str)
        str=tmpstrnew;
    return parseInt(str);
}
function isMoney(field){
    allowNum="0123456789";
    tmpstr=field.value.toString();
    var minus=false; if (tmpstr.substring(0,1)=='-') minus=true;
    tmpstrnew="";
    isNotNULL=false;
    for (var i=0;i<tmpstr.length;i++){
        if (allowNum.indexOf(tmpstr.substring(i,i+1))>=0){
            if (isNotNULL||(tmpstr.substring(i,i+1)!='0')){
                tmpstrnew+=tmpstr.substring(i,i+1);
                isNotNULL=true;
            }
        }
    }
    tmpstr=tmpstrnew;
    tmpstrnew="";
    for (var i=0;i<tmpstr.length;i++){
        if ((i%3==0)&&(i>0))
            tmpstrnew="."+tmpstrnew;
        tmpstrnew=tmpstr.substring(tmpstr.length-i-1,tmpstr.length-i).toString()+tmpstrnew;
    }

    if (tmpstrnew.length==0) tmpstrnew='0';

    if (minus) tmpstrnew='-'+tmpstrnew;
    if (tmpstrnew!=field.value)
        field.value=tmpstrnew;
}
function toMoney(str){
    allowNum="0123456789";
    tmpstr=str.toString();
    var minus=false; if (tmpstr.substring(0,1)=='-') minus=true;
    tmpstrnew="";
    isNotNULL=false;
    for (var i=0;i<tmpstr.length;i++){
        if (allowNum.indexOf(tmpstr.substring(i,i+1))>=0){
            if (isNotNULL||(tmpstr.substring(i,i+1)!='0')){
                tmpstrnew+=tmpstr.substring(i,i+1);
                isNotNULL=true;
            }
        }
    }
    tmpstr=tmpstrnew;
    tmpstrnew="";
    for (var i=0;i<tmpstr.length;i++){
        if ((i%3==0)&&(i>0))
            tmpstrnew="."+tmpstrnew;
        tmpstrnew=tmpstr.substring(tmpstr.length-i-1,tmpstr.length-i).toString()+tmpstrnew;
    }

    if (tmpstrnew.length==0) tmpstrnew='0';

    if (minus) tmpstrnew='-'+tmpstrnew;
    if (tmpstrnew!=str)
        str=tmpstrnew;
    return str;
}
function vF(field){
    val=field.value;
    val=val.toUpperCase();
    maxsz=field.size;
    if (val.length>maxsz)
        val=val.substring(0,maxsz);
    if (val!=field.value)
        field.value=val;
}
function vA(field){
    val=field.value;
    maxsz=field.size;
    if (val.length>maxsz)
        val=val.substring(0,maxsz);
    if (val!=field.value)
        field.value=val;
}
function vN(field){
    isNumber(field);
    val=field.value;
    maxsz=field.size;
    if (val.length>maxsz)
        val=val.substring(0,maxsz);
    if (val!=field.value)
        field.value=val;
}
function vMax(field,maxval){
    if (toNumber(field.value)>maxval){
        field.value=maxval;
    }
}

/*cal*/
var calender_hidden_timer=new Array();
var calender_current_date=new Array();
function calender_visible(fieldname){
    clearTimeout(calender_hidden_timer[fieldname]);
    getID('cldr-'+fieldname+'-div').style.visibility='';
    getID('cldr-'+fieldname+'-btn').style.backgroundColor='#aaa';
}
function calender_hidden (fieldname){
    calender_hidden_timer[fieldname]=setTimeout("getID('cldr-"+fieldname+"-div').style.visibility='hidden';"+
        "getID('cldr-"+fieldname+"-btn').style.backgroundColor='#ccc';",200);
}
function calender_nBulan(t){
    var Kabisat  =(((2004-t+4)%4)==0)?29:28;
    return new Array(31,Kabisat,31,30,31,30,31,31,30,31,30,31);;
}
function calender_interval(b,t){
    var q=calender_nBulan(t);
    var r=0;
    if (2004<=t){
        for (var i=0;i<(b-1);i++)
            r+=q[i];
        for (var i=2004;i<t;i++)
            r+=(((2004-i)%4)==0)?366:365;
        r+=4;
        r=r%7;
    }
    else{
        for (var i=2003;i>=t;i--)
            r+=(((2004+2004-i)%4)==0)?366:365;
        var tt=0;
        for (var i=0;i<(b-1);i++)
            r-=q[i];
        r=6-((r+2)%7);
    }
    return r;
}
function calender_show(fieldname,currentDate){
    /******** aCalender Style Sheet ********/
    calender_current_date[fieldname]=currentDate;
    var sT='color:#fff;background:#000';
    var sD='color:#000;background:#fff';
    var styleDayT=new Array('color:#fff;background:#600',sT,sT,sT,sT,'color:#fff;background:#050',sT);
    var styleDays=new Array('color:#fff;background:#f00',sD,sD,sD,sD,'color:#030;background:#efe',sD);
    var styleDayNow='color:#004;background:#cdf';
    var styleBln ='background:#444';
    var styleList='font-family:arial,tahoma,verdana,sans-serif;font-size:11px';
    var styleCldr='background:#ddd;border:1px solid #444;padding:1px';
    var styleDay ='font-family:arial,tahoma,verdana,sans-serif;font-size:11px;padding:3px';
    var colorDayBorder          ='#ddd';
    var colorDayBorder_select   ='#009';
    var colorDayBorder_hover    ='#090';
    /***** end of aCalender Style Sheet *****/
    field=getID(fieldname);
    dfield=getID('cldr-'+fieldname+'-div');
    var m='';
    var t_s=currentDate.substring(0,4);
    var b_s=currentDate.substring(5,7);
    var h_s=currentDate.substring(8,10);
    var t=Number(t_s);
    var b=Number(b_s);
    var h=Number(h_s);
    var curval=field.value;
    var cv_t_s=curval.substring(0,4);
    var cv_b_s=curval.substring(5,7);
    var cv_h_s=curval.substring(8,10);
    var cv_t=Number(cv_t_s);
    var cv_b=Number(cv_b_s);
    var cv_h=Number(cv_h_s);
    var namaHari =new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
    var namaBulan=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
    m+='<div style="'+styleCldr+'">';
    m+='<table cellspacing="0" cellpadding="2">';
    m+='<tr><td colspan="7" style="text-align:center;'+styleBln+'">';
    var blur_focus='onfocus="calender_visible(\''+fieldname+'\')" '+
                   'onblur="calender_hidden(\''+fieldname+'\')"';
    // Tulis Bulan
    m+='<select id="cldr-'+fieldname+'-bulan" '+blur_focus+' onchange="calender_show(\''+fieldname+'\',\''+t_s+'-\'+this.value+\'-'+h_s+'\')" style="margin-right:3px;'+styleList+'">';
    for (var i=1;i<=12;i++){
        var vb='0'+i; vb=vb.substring(vb.length-2,vb.length);
        m+='<option '+((i==b)?'selected="selected"':'')+' value="'+vb+'">'+namaBulan[i-1]+'</option>';
    }
    m+='</select>';
    // Tulis Tahun
    m+='<select '+blur_focus+' onchange="calender_show(\''+fieldname+'\',this.value+\'-'+b_s+'-'+h_s+'\')" style="'+styleList+'">';
    for (var i=1900;i<=2099;i++)
        m+='<option '+((i==t)?'selected="selected"':'')+' value="'+i+'">'+i+'</option>';
    m+="</select>";
    // Tulis Title Hari
    m+='</tr></tr><tr>';
    for (var i=0;i<7;i++){
        m+='<th style="text-align:center;cursor:help;font-weight:bold;border:1px solid '+colorDayBorder+';'+styleDay+';'+styleDayT[i]+'" title="'+namaHari[i]+'">'+namaHari[i].substring(0,1)+'</th>';
    }
    m+='</tr><tr>';
    var startDay=calender_interval(b,t);
    var jBulan  =calender_nBulan(t);
    // Tulis Tanggal
    if (startDay){
        m+='<td colspan="'+(startDay)+'"></td>';
    }
    var dtNew=new Date();
    var n_t=dtNew.getFullYear()+'-'+(dtNew.getMonth()+1)+'-'+dtNew.getDate();

    for (var i=1;i<=jBulan[b-1];i++){
        var c_t=t_s+'-'+b+'-'+i;
        var vb='0'+i; vb=vb.substring(vb.length-2,vb.length);
        var n=(i-1+startDay)%7;
        var bord=(c_t==cv_t_s+'-'+cv_b+'-'+cv_h)?colorDayBorder_select:colorDayBorder;
        if (n==0)
            m+='</tr><tr>';
        m+='<td '+
            'onmouseover="this.style.borderColor=\''+colorDayBorder_hover+'\';" '+
            'onmouseout="this.style.borderColor=\''+bord+'\';" '+
            'onmousedown="getID(\''+fieldname+'\').value=\''+t_s+'-'+b_s+'-'+vb+'\';" '+
            'style="text-align:right;cursor:pointer;border:1px solid '+
            bord+';'+styleDay+';'+((n_t==c_t)?styleDayNow:styleDays[n])+'">'+i+'</td>';
    }
    m+='</tr>';
    m+='</table>';
    m+='</div>';
    dfield.innerHTML=m;
    calender_visible(fieldname);
    getID('cldr-'+fieldname+'-bulan').focus();
}
function calender_write(field,fieldname,t,b,h,nameclass,inputstyle,alignright){
    field=getID(field);
    var appd='';
    var m='';
    d=new Date();
    t=(t?t:d.getFullYear());
    b=(b?b:d.getMonth()+1);
    h=(h?h:d.getDate());
    if (nameclass)
        appd+='class="'+nameclass+'" ';
    if (inputstyle)
        appd+='style="float:left;'+inputstyle+'" ';
    t=(t>75)?('19'+t):('20'+t);
    t=t.substring(t.length-4,t.length);
    b='0'+b; b=b.substring(b.length-2,b.length);
    h='0'+h; h=h.substring(h.length-2,h.length);
    m   +='<div id="cldr-'+fieldname+'-div" style="position:absolute;visibility:hidden;'+(alignright?'margin-left:-35px':'')+'">&nbsp;</div>';
    m   +='<div><input onfocus="getID(\'cldr-'+fieldname+'-btn\').focus();" readonly="readonly" type="text" name="'+fieldname+'" id="'+fieldname+'" value="'+t+'-'+b+'-'+h+'" '+appd+'/>';
    m   +='<input type="button" '+
            'onmouseover="if (this.style.backgroundColor!=\'#000\') this.style.color=\'#f00\';" onmouseout="this.style.color=\'#000\';" '+
            'onfocus="this.style.color=\'#000\';calender_show(\''+fieldname+'\',calender_current_date[\''+fieldname+'\'])" '+
            'value="&equiv;" id="cldr-'+fieldname+'-btn" title="Calender" style="float:left;cursor:pointer;padding:0px;margin:0px;border:none;background-color:#ccc;width:22px;margin-left:1px;font-weight:bold;font-size:14px;" /></div>';
    field.innerHTML=m;
    ifield=getID(fieldname);
    calender_current_date[fieldname]=ifield.value;
    bfield=getID('cldr-'+fieldname+'-btn');
    dfield=getID('cldr-'+fieldname+'-div');
    bfield.style.color='#000';
    dfield.style.marginTop=field.style.height=bfield.style.height=ifield.offsetHeight+'px';
    field.style.width=(bfield.offsetWidth+ifield.offsetWidth+1)+'px';
}
//---- EDITOR
function load_editor(elname,isadvance){
	if (isadvance){
		CKEDITOR.replace(elname,
			{
				height:350,
				uiColor: '#f6f7f7', language : 'en',
				enterMode	: Number(3), shiftEnterMode	: Number(2),
				toolbar : [ 
						[ 'Maximize','Source','-','PasteFromWord','PasteText','-','Undo','Redo','-', 'Link', 'Unlink', '-','Smiley','SpecialChar','myImage','-','NumberedList', 'BulletedList','-','Outdent','Indent','Blockquote','-','Replace'], '/',
						[ 'Styles','Font','FontSize', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','TextColor','BGColor']
					]
			}
		);
	}
	else{
		CKEDITOR.replace(elname,
		{
			height:350,
			uiColor: '#f6f7f7', language : 'en',
			enterMode	: Number(2), shiftEnterMode	: Number(3),
			toolbar : [
					[ 'Bold', 'Italic', 'Underline', 'Strike','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','NumberedList', 'BulletedList', 'Outdent','Indent', '-','Link', 'Unlink','-','TextColor','BGColor']
				]
		}
		);
	}
}
function load_editor_old(elname,isadvance){
    if (isadvance){
      tinyMCE.init({
        mode : "exact",
        theme : "advanced",
        skin : "o2k7",
        elements : elname,
        document_base_url : '/',
        cleanup : true,
        cleanup_on_startup : true,
        verify_css_classes : true,
        verify_html : true,
        invalid_elements : "font,iframe,form,textarea,input,script",
        inline_styles : true,
        convert_newlines_to_brs : false,
        doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
        force_hex_style_colors : true,
        relative_urls : false,
        plugins : "inlinepopups,elink,epictures,style,preview,searchreplace,contextmenu,paste,fullscreen",
        theme_advanced_buttons1 : "fullscreen,preview,code,|,undo,redo,|,search,replace,|,cleanup,removeformat,|,elink,unlink,anchor,|,epictures,charmap,|,forecolor,backcolor",
        theme_advanced_buttons2 : "styleprops,formatselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "none",
        theme_advanced_resizing : false
      }
      );
    }
    else{
        tinyMCE.init({
        mode : "exact",
        theme : "advanced",
        skin : "o2k7",
        elements : elname,
        document_base_url : '/',
        cleanup : true,
        cleanup_on_startup : true,
        verify_css_classes : true,
        verify_html : true,
        invalid_elements : "font,iframe,form,textarea,input,script",
        inline_styles : true,
        convert_newlines_to_brs : false,
        doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
        force_hex_style_colors : true,
        relative_urls : false,
        plugins : "elink",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,elink,unlink,anchor,|,bullist,numlist,outdent,indent,|,forecolor,backcolor",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "none",
        theme_advanced_resizing : false
      }
      );
    }
}
/* EDITOR */
function ed_paste(field,t1,t2,del)
{
    if (!isNaN(field.selectionStart))
    {
        var selLength = field.textLength;
        var selStart    = field.selectionStart;
        var selEnd      = field.selectionEnd;
        var scrollTop = field.scrollTop;
        if (selEnd == 1 || selEnd == 2)
            selEnd = selLength;
        var isNullInner=(selEnd==selStart);
        if (!del){
            var s1 = (field.value).substring(0,selStart);
            var s2 = (field.value).substring(selStart, selEnd);
            var s3 = (field.value).substring(selEnd, selLength);

            field.value = s1 + t1 + s2 + t2 + s3;
            field.selectionStart = selEnd + t1.length + t2.length;
            field.selectionEnd = field.selectionStart;
        }
        else{
            var s1 = (field.value).substring(0,selStart);
            var s2 = t1+t2;
            var s3 = (field.value).substring(selEnd, selLength);
            field.value=s1+s2+s3;
            field.selectionStart = selStart+t1.length+t2.length;
            field.selectionEnd = field.selectionStart;
        }
        if (isNullInner){
            field.selectionStart = selStart+t1.length;
            field.selectionEnd = field.selectionStart;
        }
        field.focus();
        field.scrollTop = scrollTop;
    }
    else if (field.createTextRange)
    {
        field.focus();
        field.caretPos = document.selection.createRange().duplicate();
        if (!del){
            var txtSel=t1+field.caretPos.text+t2;
            field.caretPos.text=txtSel;
        }
        else field.caretPos.text=t1+t2;
        field.focus();
    }
    else{
        field.value = field.value + t1+t2;
        field.focus();
    }
}
function ed_emo_ov(field){
    field.style.position="absolute";
    field.style.height="";
    field.style.background="#ffffff";
    field.style.border="1px solid #99bbcc";
    field.style.padding="2px";
    field.style.marginTop="-3px";
    field.style.marginLeft="-3px";
}
function ed_emo_out(field){
    field.style.position="";
    field.style.height="22px";
    field.style.background="";
    field.style.border="";
    field.style.padding="";
    field.style.marginTop="";
    field.style.marginLeft="";
}
function ed_cmd(prefix, cmd, arg){
    var edt=getID(prefix+'_en_editor');
    var frm=getID(prefix+'_en_form');

    switch(cmd){
        case "b": ed_paste(edt,"[b]","[/b]",false);
                    break;
        case "i": ed_paste(edt,"[i]","[/i]",false);
                    break;
        case "u": ed_paste(edt,"[u]","[/u]",false);
                    break;
        case "code": ed_paste(edt,"[code]","[/code]",false);
                    break;
        case "size":
                            var taged="size:"+((arg>7)?7:((arg<1)?1:arg));
                            ed_paste(edt,"["+taged+"]","[/size]",false);
                    break;
        case "align":
                            var taged=arg;
                            ed_paste(edt,"["+taged+"]","[/"+taged+"]",false);
                    break;
        case "emo": ed_paste(edt," ["+arg+"] ","",true);
                    break;
    }
}

function x_filter_dir(tp){
	getID('x_filter_dir_type').value=tp;
	fl=getID('x_filter_dir_cont');
	if (((tp>=1)&&(tp<=4))||(tp==8)||(tp==9)){
		// txt
		khtm_l='&nbsp;<br /><b>Keyword:</b><br /><input type="text" name="x_filter_val" value="" class="inputbox" size="20" /><br /><br />';
		khtm_l+='<input type="submit" name="sc1" value="go" />';
		fl.innerHTML=khtm_l;
	}
	else if ((tp==5)||(tp==6)){
		// num
		khtm_l='<b>From:</b><br />';
		if (tp==6) khtm_l+='Rp.';
		khtm_l+='<input onfocus="this.select()" type="text" name="x_filter_int1" value="0" class="inputboxnum" size="12" onkeyup="isNumber(this)" onchange="isNumber(this)" class="inputboxnum" /><br />';
		khtm_l+='<b>To:</b><br />';
		if (tp==6) khtm_l+='Rp.';
		khtm_l+='<input onfocus="this.select()" type="text" name="x_filter_int2" value="0" class="inputboxnum" size="12" onkeyup="isNumber(this)" onchange="isNumber(this)" class="inputboxnum" /><br />';
		khtm_l+='<input type="submit" name="sc1" value="go" style="margin-top:5px" />';
		fl.innerHTML=khtm_l;
	}	
	else {
		fl.innerHTML='&nbsp;<br />&nbsp;<br /><em>please select field...</em>';
	}
}

//================ POPUP MENU:
var imenu = new Array();
function i_ad(nama,menuurl){
	var inew_dir = new Array();
	inew_dir[0]=nama;
	inew_dir[1]=1;
	inew_dir[2]=new Array();
	inew_dir[3]=menuurl;
	return inew_dir;
}
function i_ai(nama,item_url){
	var inew_dir = new Array();
	inew_dir[0]=nama;
	inew_dir[1]=2;
	inew_dir[2]=item_url;
	return inew_dir;
}
var main_popup_timeout;
var ohtml='<div class="box-cat-list" style="padding-bottom:3px">';
function c_hgpop(field){
	if (field.style.height=='1px'){
		field.style.height='';
		field.style.overflow='';
		if (field.offsetHeight>400){
			field.style.height='300px';
			field.style.overflow='auto';
		}
	}
}
function c_hgpopot(field){}
function w_vd(item,id_field){
	// var - dir
	var i;
	for (i=0;i<item.length;i++){
		if (item[i][1]==1){
			id_popup=id_field+'_'+i;
			id_link =id_field+'_L'+i;
			ohtml+='<a style="overflow:normal;cursor:default" id="'+id_link+'" onmouseout="getID(\''+id_popup+'\').timeoutV=setTimeout(\'c_hgpopot(getID(\\\''+id_popup+'\\\'));getID(\\\''+id_popup+'\\\').style.visibility=\\\'hidden\\\';getID(\\\''+id_link+'\\\').style.backgroundColor=\\\'\\\';getID(\\\''+id_link+'\\\').style.color=\\\'\\\';\',50);" onmouseover="clearTimeout(getID(\''+id_popup+'\').timeoutV);getID(\''+id_link+'\').style.backgroundColor=\'#585D64\';getID(\''+id_link+'\').style.color=\'#ffffff\';c_hgpop(getID(\''+id_popup+'\'));getID(\''+id_popup+'\').style.visibility=\'\';" href="'+item[i][3]+'">';
			ohtml+='<span style="float:right;display:block">&raquo;&nbsp;</span>'+item[i][0]+'</a>';
			ohtml+='<div id="'+id_popup+'" onmouseover="clearTimeout(this.timeoutV);getID(\''+id_link+'\').style.backgroundColor=\'#585D64\';getID(\''+id_link+'\').style.color=\'#ffffff\';c_hgpop(getID(\''+id_popup+'\'));getID(\''+id_popup+'\').style.visibility=\'\';" onmouseout="this.timeoutV=setTimeout(\'c_hgpopot(getID(\\\''+id_popup+'\\\'));getID(\\\''+id_popup+'\\\').style.visibility=\\\'hidden\\\';getID(\\\''+id_link+'\\\').style.color=\\\'\\\';getID(\\\''+id_link+'\\\').style.backgroundColor=\\\'\\\';\',100);" class="box-cat-list" style="overflow:hidden;height:1px;position:absolute;width:200px;margin-left:240px;border:1px solid #cccccc;background:#f8f8f8;margin-top:-24px;visibility:hidden;padding:1px;'+((item[i][2].length<1)?'display:none':'')+'">';
			w_vd(item[i][2],id_popup);
			ohtml+='</div>';
		}
		else{
			ohtml+='<a href="'+item[i][2]+'">'+item[i][0]+'</a>';
		}
	}
}

function divAnimShow(field,size){
	getID(field).style.width="100%";
	waitTime=0;
	for (i=0;i<50;i++){
		setTimeout("setOpacity(getID('"+field+"'),"+(100-(i*2))+");",i*5);
		waitTime=i*5;
	}
	setTimeout("getID('"+field+"').style.height='';",waitTime);
	for (i=0;i<50;i++){
		setTimeout("setOpacity(getID('"+field+"'),"+(i*2)+");",((i+50)*5));
		waitTime=i*5;
	}
}
function divAnimHide(field,tosize){
	getID(field).style.width="100%";
	waitTime=0;
	for (i=0;i<50;i++){
		setTimeout("setOpacity(getID('"+field+"'),"+(100-(i*2))+");",i*5);
		waitTime=i*5;
	}
	setTimeout("getID('"+field+"').style.height='"+tosize+"px';",waitTime);
	for (i=0;i<50;i++){
		setTimeout("setOpacity(getID('"+field+"'),"+(i*2)+");",((i+50)*5));
		waitTime=i*5;
	}
}

window.onerror=function(){return true; };
//]]>

