var calendar = null;
function selected(cal, date) {
	cal.sel.value = date;
}

function closeHandler(cal) {
	cal.hide();
	Calendar.removeEvent(document, "mousedown", checkCalendar);
}

function checkCalendar(ev) {
	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
	for (; el != null; el = el.parentNode)
	if (el == calendar.element || el.tagName == "A") break;
	if (el == null) {
		calendar.callCloseHandler(); Calendar.stopEvent(ev);
	}
}

function showCalendar(id) {
	var el = document.getElementById(id);
	if (calendar != null) {
		calendar.hide();
		calendar.parseDate(el.value);
	} else {
		var cal = new Calendar(true, null, selected, closeHandler);
		calendar = cal;
		cal.setRange(1900, 2070);
		calendar.create();
	}
	calendar.sel = el;
	calendar.showAtElement(el);

	Calendar.addEvent(document, "mousedown", checkCalendar);
	return false;
}

function checkDate(fld) {
    var mo, day, yr;
    var entry = fld;
    var re = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;
    if (re.test(entry)) {
        var delimChar = (entry.indexOf("/") != -1) ? "/" : "-";
        var delim1 = entry.indexOf(delimChar);
        var delim2 = entry.lastIndexOf(delimChar);
        day = parseInt(entry.substring(0, delim1), 10);
        mo = parseInt(entry.substring(delim1+1, delim2), 10);
        yr = parseInt(entry.substring(delim2+1), 10);
        var testDate = new Date(yr, mo-1, day);
//        alert(testDate)
        if (testDate.getDate( ) == day) {
            if (testDate.getMonth( ) + 1 == mo) {
                if (testDate.getFullYear( ) == yr) {
                    return testDate;
                } else {
                    alert("Tahun yang dimasukkan salah");
                }
            } else {
                alert("Bulan yang dimasukkan salah");
            }
        } else {
            alert("Tanggal yang dimasukkan salah");
        }
    } else {
        alert("Format tanggal salah.\n(Gunakan tombol yang tersedia!)");
    }
    return false;
}



function checkDateRange(mulai, selesai){
  if(mulai != '' && selesai != ''){
    if((startDate = checkDate(mulai)) && (endDate = checkDate(selesai))){
//	alert(startDate);
	  if(startDate < endDate){
	    return true;
	  }else{
	  	alert('Tanggal mulai harus lebih dulu dari tanggal selesai');
		return false;
	  }
	 }else{
	  return false;
	  }
  }else{
  	alert('Tentukan tanggal mulai dan selesainya');
	return false;
  }
}

function giveToday(ayyana, obj, resultnya){
	if (obj.checked){
	 resultnya.value = ayyana;
	}else{
	 resultnya.value = '';
	}
}

var querywindow = '';

function popUp(url) {

    if (!querywindow.closed && querywindow.location) {
        querywindow.focus();
    } else {
        querywindow=window.open(url, '','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=No,width=910,height=800');
    }

    if (!querywindow.opener) {
        querywindow.opener = self;
    }

    if (window.focus) {
        querywindow.focus();
    }

    return false;
}
function popUp1(url) {

    if (!querywindow.closed && querywindow.location) {
        querywindow.focus();
    } else {
        querywindow=window.open(url, '','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=No,width=350,height=470');
    }

    if (!querywindow.opener) {
        querywindow.opener = self;
    }

    if (window.focus) {
        querywindow.focus();
    }

    return false;
}
function popUp2(url) {

    if (!querywindow.closed && querywindow.location) {
        querywindow.focus();
    } else {
        querywindow=window.open(url, '','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=No,width=600,height=500');
    }

    if (!querywindow.opener) {
        querywindow.opener = self;
    }

    if (window.focus) {
        querywindow.focus();
    }

    return false;
}
function popUp3(url) {

    if (!querywindow.closed && querywindow.location) {
        querywindow.focus();
    } else {
        querywindow=window.open(url, '','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=No,width=500,height=470');
    }

    if (!querywindow.opener) {
        querywindow.opener = self;
    }

    if (window.focus) {
        querywindow.focus();
    }

    return false;
}

function popup4(url)
{
 var width  = 510;
 var height = 420;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function printer(url)
{
 var width  = 650;
 var height = 760;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function printersewa(url)
{
 var width  = 650;
 var height = 790;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function popupkirimpesanprivate(url)
{
 var width  = 510;
 var height = 350;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function popupkirimpesan(url)
{
 var width  = 510;
 var height = 550;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function popupregister(url)
{
 var width  = 520;
 var height = 450;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function popuplogin(url)
{
 var width  = 520;
 var height = 350;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function popup5(url)
{
 var width  = 620;
 var height = 560;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function popup6(url)
{
 var width  = 620;
 var height = 450;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}


function popup7(url)
{
 var width  = 620;
 var height = 600;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}


function popup8(url)
{
 var width  = 960;
 var height = 730;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function ubahWarna(me,color){
	me.style.background=color;
}

function popup9(url)
{
 var width  = 990;
 var height = 700;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function ubahWarna(me,color){
	me.style.background=color;
}


function popup10(url)
{
 var width  = 1024;
 var height = 700;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function ubahWarna(me,color){
	me.style.background=color;
}

function popup_bigfoto(url)
{
 var width  = 1024;
 var height = 730;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=yes';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function popuppeta(url)
{
 var width  = 990;
 var height = 600;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
function ubahWarna(me,color){
	me.style.background=color;
}

function popup_slideshow(url)
{
 var width  = 1024;
 var height = 730;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=yes';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}

function popup_search(url)
{
 var width  = 650;
 var height = 500;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=yes';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}



function popup_chat(url)
{
 var width  = 750;
 var height = 500;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}




function checkEmail(myForm) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){
return (true)
}
alert("Alamat Email salah! Silahkan diisi dengan benar.")
return (false)
}


function createXMLHttpRequest( ) {
    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
    try { return new XMLHttpRequest( ); } catch(e) {}
    alert("XMLHttpRequest not supported");
    return null;
  }

function checkNama(){
  $("resultNama").style.display = "block";
    var xhr = createXMLHttpRequest( );
    xhr.onreadystatechange = function( ) {
      if (xhr.readyState==4) { // Request is finished
        if (xhr.status==200) {
          $("resultNama").innerHTML = xhr.responseText;
        } else {
          alert("Filenya hilang kontak administrator");
        }
      }else{
		if(xhr.readyState==1){
			$("resultNama").innerHTML = "<img src='images/ajax-loader.gif'>";
		}
	  }
    }
    xhr.open("GET", "register.php?check=1&nama="+$("nama").value, true);
    xhr.send(null);

}
  function $(id) {
  	return document.getElementById(id);
	}

function checkLogin(op, val, pass){
  $("hasilLogin").style.visibility = "visible";
    var xhr = createXMLHttpRequest( );
    xhr.onreadystatechange = function( ) {
      if (xhr.readyState==4) { // Request is finished
        if (xhr.status==200) {
          $("hasilLogin").innerHTML = xhr.responseText;
        } else {
          alert("Filenya hilang kontak administrator");
        }
      }else{
		if(xhr.readyState==1){
			$("hasilLogin").innerHTML = "<img src='images/ajax-loader.gif'>";
		}
	  }
    }
    xhr.open("GET", "login.php?op="+op+"&user_id="+val+"&passwordNe="+pass, true);
    xhr.send(null);

}


//terakhir
function loads(op, val, target, fileTarget) {
  $(target).style.display = "block";
    var xhr = createXMLHttpRequest( );
    xhr.onreadystatechange = function( ) {
      if (xhr.readyState==4) { // Request is finished
        if (xhr.status==200) {
          $(target).innerHTML = xhr.responseText;
        } else {
          alert("File missing contact server administrator");
        }
      }else{
	  	if (xhr.readyState==1){
			$(target).innerHTML = "<p><img src='images\/progress.gif'>Loading...<\/p>";
		}
	  }
    }
    xhr.open("GET", fileTarget+"?op="+op+"&keyword="+val, true);
    xhr.send(null);
  }

  function $(id) {
  	return document.getElementById(id);
	}

  function sends(op, val, target, fileTarget) {
  $(target).style.display = "block";
    var xhr = createXMLHttpRequest( );
    xhr.onreadystatechange = function( ) {
      if (xhr.readyState==4) { // Request is finished
        if (xhr.status==200) {
          $(target).innerHTML = xhr.responseText;
        } else {
          alert("File missing contact server administrator");
        }
      }else{
	  	if (xhr.readyState==1){
			$(target).innerHTML = "<p><img src='images\/progress.gif'>Sending...<\/p>";
		}
	  }
    }
    xhr.open("POST", fileTarget+"?op="+op+"&keyword="+val, true);
    xhr.send(null);
  }



function openWindow()
{
  window.open("pop.html", "player");
}

function closeWindow()
{
  // Close the current window
  window.close();
}

function doSelectChange(el,dest) {


	var ele = el.options[el.selectedIndex].text


	 	dstext = dest.value
		ds = dstext.lastIndexOf(",")

		var tk = dstext.split(",");
  		var len = (tk.length)

		var i = 0;
		var nu = el.options[el.selectedIndex].text
		for(i=0;i<len;i++){

			if(nu==tk[i]){
				nu = "";
			}

		}

		if(len=="5"){
			alert("Maximum 5 Area");
			el.options[el.selectedIndex].selected = false;
		}

		else if(nu != ""){
			extension = dstext.substring(ds+1, dstext.length).toLowerCase()
			if(extension==""){
				dest.value = nu
			}
			else{
				nuval = dstext.substring(0,ds+1)
				nuval = "," + nu
				dest.value += nuval
			}
		}
  }


  	function deletetext(dest){
		dstext = dest.value
		var tk = dstext.split(",");

  		var len = (tk.length)
		if(tk[len-1]==""){
			ind = len-2;
		}

		else{
			ind = len - 1;
		}

		tk.splice(ind,1)
		dest.value = tk;
	}


  function lookupItem(el,dest) {
  //var curValue = el.value.toLowerCase()
  var found = false
  var index = dest.selectedIndex
  var numOptions = dest.options.length
  var pos = 0

  var whole = el.value.toLowerCase()
  var token = whole.split(",");
  var ind = (token.length)-1
   var curValue = token[ind];

  // Repeat until found or end of list is reached
  while ((!found) && (pos < numOptions)) {

		// Do comparisons in lowercase
		found = (dest.options[pos].text.toLowerCase().indexOf(curValue)==0)
		if (found)
			index = pos
			pos++
		}

		if (found)  // Updated listbox
		  dest.selectedIndex = index
	}




 //Start Disable Right Click
//eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('f 4="";8 9(){1(0.a){(4);5 6}}8 7(e){1(0.b||(0.g&&!0.a)){1(e.c==2||e.c==3){(4);5 6}}}1(0.b){0.h(i.j);0.k=7}l{0.m=7;0.d=9}0.d=n o("5 6")',25,25,'document|if|||message|return|false|clickNS|function|clickIE|all|layers|which|oncontextmenu||var|getElementById|captureEvents|Event|MOUSEDOWN|onmousedown|else|onmouseup|new|Function'.split('|'),0,{}))
// End Disable Right Click

// Start Image Effect
function fade(el, up)
            {
                var interval    = 70;
                var s           = el.style;

                if(typeof el.fadeKillID == "number")
                {
                    clearTimeout(el.fadeKillID);
                    el.fadeKillID = null;
                }

                var goAgain = true;

                // Mozilla
                if(typeof s.MozOpacity == "string")
                {
                    if(up && s.MozOpacity < .9)
                        s.MozOpacity    = parseFloat(s.MozOpacity) + 0.2;
                    else if(!up && s.MozOpacity > .7)
                        s.MozOpacity    = parseFloat(s.MozOpacity) - 0.1;
                    else
                        goAgain = false;
                } //IE
                else if(typeof el.filters == "object")
                {
                    var a = el.filters.alpha;
                    if(up && a.opacity < 90)
                        a.opacity   += 20;
                    else if(!up && a.opacity > 70)
                        a.opacity   -= 10;
                    else
                        goAgain = false;
                }

                if(goAgain)
                    el.fadeKillID = setTimeout(function(){fade(el,up);},interval);
            }
// End Image Effect


function graphicsb_data0()
{


    //---------------------------------------------
    //Scroll Bar Images
    //---------------------------------------------


	this.up_button = "images/sample1_up.gif";                                          //image path and name only
	this.up_button_roll = "images/sample1_up_roll.gif";                                //image path and name only
	this.down_button = "images/sample1_down.gif";                                      //image path and name only
	this.down_button_roll = "images/sample1_down_roll.gif";                            //image path and name only


	this.slider_tile_bg_style = "background-image:url(images/sample1_slider_bg.gif);"  //image defined as CSS style


	this.bubble_top_cap = "images/sample1_bubble_topcap.gif,2";                        //image path and name, height - (width is automatically set to scroll bar width)
	this.bubble_bottom_cap = "images/sample1_bubble_bottomcap.gif,2";                  //image path and name, height - ""
	this.bubble_center = "images/sample1_bubble_center.gif,7";                         //image path and name, height - ""
	this.bubble_tile_bg_style = "images/sample1_bubble_bg.gif";                        //image path and name only





    /*---------------------------------------------
    Scroll Bar Container and Content
    ---------------------------------------------*/


	this.container_width = 276
	this.container_height = 295

	this.container_bg_color = "";



	this.content_padding = 20
	this.content_styles = "font-family:Arial;font-weight:normal;font-size:12px;";
	this.content_class_name = "";




    /*---------------------------------------------
    Scroll Bar Behaviour and Width
    ---------------------------------------------*/


	this.scroll_bar_width = 16                     //The width of the bar in pixels.
	this.scroll_increment = 20                     //The distance to scroll when clicking the up or down buttons.


	this.allow_hover_scroll = false;                //Auto scroll while hovering over top and bottom buttons.
	this.hover_scroll_delay = 50;                   //Milliseconds (1/1000 second)


	this.use_hand_cursor = false;




}

var nsstyle='display:""'
if (document.layers)
var scrolldoc=document.scroll1.document.scroll2
function up(){
if (!document.layers) return
if (scrolldoc.top<0)
scrolldoc.top+=10
temp2=setTimeout("up()",50)
}
function down(){
if (!document.layers) return
if (scrolldoc.top-150>=scrolldoc.document.height*-1)
scrolldoc.top-=10
temp=setTimeout("down()",50)
}

function clearup(){
if (window.temp2)
clearInterval(temp2)
}

function cleardown(){
if (window.temp)
clearInterval(temp)
}





////buat gambar tumbnaild scroll& css = style_scroll.css
 	var Timer;

	function ScrollLeft(divimg)
	{
	  Timer = setInterval("document.getElementById('"+divimg+"').scrollLeft -= 2", 15);
	}
	function ScrollRight(divimg)
	{
	  Timer = setInterval("document.getElementById('"+divimg+"').scrollLeft += 2", 15);
	}


	// -- thumbnail opener  ------------------------------------------------------- //
	// -----------------------------------------------------------------------------

	function loadImage(imageFile,index,count)
	{
	  if (document.all&&!window.opera)
	  {
	    document.getElementById('det_img').style.filter="blendTrans(duration=1)";
	    document.getElementById('det_img').filters.blendTrans.Apply();
		document.getElementById('det_img').filters.blendTrans.Play();
	  }
	  document.getElementById("det_img").src = imageFile;

	  if(count!=""){document.getElementById("det_ind").innerHTML = "&nbsp;showing "+ index +" of "+count+" images";}

	}




//buat checked compare
  function toggleCompareCbx(elem) {
        var masterId = elem.value;
        var pageId   = 37;
        var catName  = "Flat Panels/LCD";
        var langId   = "en";
        RecentComparisonHistory.toggleMasterId(pageId, masterId, catName, langId);
        RecentComparisonHistory.createCookie();
    }
function toggle_check(object)
    {
    	var cb = document.getElementById("checkbox_" + object.name);
    	if (cb.checked)
    	{
    		cb.checked = false;
    	}
    	else
    	{
    		cb.checked = true;
    	}

    }

function cobaDeh(){
		document.getElementById("id_australia").style.display = "none";
		document.getElementById("id_indonesia").style.display = "none";
		document.getElementById("id_singapore").style.display = "none";


			if(document.getElementById("id_pilih").selectedIndex==1){
			document.getElementById("id_australia").style.display = "";

			}else if(document.getElementById("id_pilih").selectedIndex==2){
					document.getElementById("id_indonesia").style.display = "";
    	    }else if(document.getElementById("id_pilih").selectedIndex==3){
					document.getElementById("id_singapore").style.display = "";
    	    }

			//alert(document.getElementById("id_pilih").selectedIndex);
		}

//harga didalam textbox dengan koma
	function FormatCurrency(objNum)
	{
	    var num = objNum.value;
	    var ent, dec;

	    if (num != '' && num != objNum.oldvalue)
	    {
	          num = MoneyToNumber(num);
	          if (isNaN(num))
	          {
	                objNum.value = objNum.oldvalue;
	          } else {
	                var ev = (navigator.appName.indexOf('Netscape') != -1)?Event:event;
	                if (ev.keyCode == 190 || !isNaN(num.split('.')[1]))
	                {
	                      objNum.value = AddCommas(num.split('.')[0])+'.'+num.split('.')[1];
	                }
	                else
	                {
	                      objNum.value = AddCommas(num.split('.')[0]);
	                }
	                objNum.oldvalue = objNum.value;
	          }
	    }
	}

	function MoneyToNumber(num)
	{
	    return (num.replace(/,/g, ''));

	}

	function AddCommas(num)
	{
	    numArr=new String(num).split('').reverse();
	    for (i=3;i<numArr.length;i+=3)
	    {
	          numArr[i]+=',';
	    }
	    return numArr.reverse().join('');
	}

//messsage 1 kotak
function MsgBoxchica (textstring) {
alert ('Sorry, Please Login or Register. Thank you!')
}
function MsgBoxakseschica (textstring) {
alert ('Maaf, Anda tidak berhak mengakses atau Edit data ini.!')
}

//batas maxlength textarea
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

//batas input perkata chica
function count(field,maxchar) {
if (field.value.length > maxchar) {
field.value = field.value.substring(0, maxchar);}}

//inputan number
function isInt(v)
{
return (parseInt(v) == v);
}
function detectNum(e)
{
var nv='';
var pt=false;
for (x=0; x<e.value.length; x++)
{
c = e.value.substring(x,x+1);
if (isInt(c) || ((c == '.') && (pt == false)) || ((x == 0) && (c == '-')))
{
nv += c;
if (c == '.') { pt=true; }
}
}
e.value = nv;
}

