var myMsg = "Selamat datang di WEB Sistem PT.MPM & WEBSITE INI ADALAH WEB RESMI PT.MPM                                                                                                ";
//*****************************************************************
var i = 0;
function scrollMsg() {
	frontPart = myMsg.substring(i,myMsg.length);
	backPart  = myMsg.substring(0,i);
	window.status = frontPart + backPart;
	if (i < myMsg.length)
		{
		i++;
		}
	else
		{
		i = 0;
		}
	setTimeout("scrollMsg()", 60);
}

var myMsgIdx = "## BARANGSIAPA DENGAN SENGAJA MENGGUNAKAN, MENGADOPSI DAN MEMBAWA NAMA PT.MPM TANPA SEIZIN TERTULIS DARI PIHAK MANAJEMEN PT.MPM, MERUPAKAN PELANGGARAN HUKUM DAN AKAN DITUNTUT SECARA PIDANA & WEBSITE INI ADALAH WEB RESMI PT.MPM										";
//*****************************************************************
var i = 0;
function scrollMsgIdx() {
	frontPart = myMsgIdx.substring(i,myMsgIdx.length);
	backPart  = myMsgIdx.substring(0,i);
	window.status = frontPart + backPart;
	if (i < myMsgIdx.length)
		{
		i++;
		}
	else
		{
		i = 0;
		}
	setTimeout("scrollMsgIdx()", 120);
}

function caribulan(strDate, strYear){
	var days;
	if (strDate == 4 || strDate == 6 || strDate == 9 || strDate == 11) {
		days = 30;
	}
	else if (strDate == 2 && strYear % 4 == 0 ) {
		days = 29;
	}
	else if (strDate == 2) {
		days = 28;
	}
	else {
		days = 31;
	}
	
	return days;
}

function shortDay(strDay, strDate, strYear) {
	var str="";
	var temp = new Date(strDate+"/"+strDay+"/"+strYear);
	weekday = temp.getDay();
	if (weekday==0) {
		str="S"
	}
	if (weekday==1) {
		str="M"
	}
	if (weekday==2) {
		str="T"
	}
	if (weekday==3) {
		str="W"
	}
	if (weekday==4) {
		str="T"
	}
	if (weekday==5) {
		str="F"
	}
	if (weekday==6) {
		str="S"
	}
	return str;
}

function namabulan(i) {
	var nbulan;
	if (i==1) {
		nbulan="January";
	}
	else if (i==2) {
		nbulan="February";
	}
	else if (i==3) {
		nbulan="March";
	}
	else if (i==4) {
		nbulan="April";
	}
	else if (i==5) {
		nbulan="May";
	}
	else if (i==6) {
		nbulan="June";
	}
	else if (i==7) {
		nbulan="July";
	}
	else if (i==8) {
		nbulan="August";
	}
	else if (i==9) {
		nbulan="September";
	}
	else if (i==10) {
		nbulan="October";
	}
	else if (i==11) {
		nbulan="November";
	}
	else if (i==12) {
		nbulan="December";
	}
	return nbulan;
}

function gantihari(form,tanggal,bulan,tahun) {
	var days;
	days = caribulan(eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
	
	var pjitem=eval('form.'+tanggal+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+tanggal+'.options[i] = null');
	}
	
	for (i=1; i<=days; i++) {
		temp = shortDay(i,eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
		eval('form.'+tanggal+'.options[i-1] = new Option();')
		eval('form.'+tanggal+'.options[i-1].text=i+" ("+temp+")";')
		eval('form.'+tanggal+'.options[i-1].value=i;')
	}
}

function gantihari1(form,tanggal,bulan,tahun,tanggal1) {
	var days;
	days = caribulan(eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
	
	var pjitem=eval('form.'+tanggal+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+tanggal+'.options[i] = null');
	}
	
	for (i=1; i<=days; i++) {
		temp = shortDay(i,eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
		eval('form.'+tanggal+'.options[i-1] = new Option();')
		eval('form.'+tanggal+'.options[i-1].text=i+" ("+temp+")";')
		eval('form.'+tanggal+'.options[i-1].value=i;')
	}
	
	var pjitem=eval('form.'+tanggal1+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+tanggal1+'.options[i] = null');
	}
	
	for (i=1; i<=days; i++) {
		temp = shortDay(i,eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
		eval('form.'+tanggal1+'.options[i-1] = new Option();')
		eval('form.'+tanggal1+'.options[i-1].text=i+" ("+temp+")";')
		eval('form.'+tanggal1+'.options[i-1].value=i;')
	}
}

function gantihari2(form,bulan,tahun,tanggal,tanggal1) {
	var days;
	var temp;
	days = caribulan(eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
	
	var pjitem=eval('form.'+tanggal+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+tanggal+'.options[i] = null');
		eval('form.'+tanggal1+'.options[i] = null');
	}
	
	for (i=1; i<=days; i++) {
		temp = shortDay(i,eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
		eval('form.'+tanggal+'.options[i-1] = new Option();')
		eval('form.'+tanggal+'.options[i-1].text=i+" ("+temp+")";')
		eval('form.'+tanggal+'.options[i-1].value=i;')

		eval('form.'+tanggal1+'.options[i-1] = new Option();')
		eval('form.'+tanggal1+'.options[i-1].text=i+" ("+temp+")";')
		eval('form.'+tanggal1+'.options[i-1].value=i;')
	}
}

function gantilainbln(form,nameid1,nameid2) {
	var vawal=eval('form.'+nameid1+'.value');
	var awal=eval('form.'+nameid1+'.selectedIndex');
	var pjitemawal=eval('form.'+nameid1+'.length');
	pjitemakhir=pjitemawal-awal;
	
	var pjitem=eval('form.'+nameid2+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+nameid2+'.options[i] = null');
	}

	var nbulan;
	for (i=vawal; i<=pjitemawal; i++) {
		eval('form.'+nameid2+'.options[i-vawal] = new Option();')
		nbulan = namabulan(i);
		eval('form.'+nameid2+'.options[i-vawal].text=nbulan;')
		eval('form.'+nameid2+'.options[i-vawal].value=i;')
	}
}

function gantilaintgl(form,nameid1,nameid2) {
	var vawal=eval('form.'+nameid1+'.value');
	var awal=eval('form.'+nameid1+'.selectedIndex');
	var pjitemawal=eval('form.'+nameid1+'.length');
	pjitemakhir=pjitemawal-awal;
	
	var pjitem=eval('form.'+nameid2+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+nameid2+'.options[i] = null');
	}

	for (i=vawal; i<=pjitemawal; i++) {
		eval('form.'+nameid2+'.options[i-vawal] = new Option();')
		eval('form.'+nameid2+'.options[i-vawal].text=i;')
		eval('form.'+nameid2+'.options[i-vawal].value=i;')
	}
	eval('form.'+nameid2+'.selectedIndex=0;')
}

function gantilainthn(form,nameid1,nameid2) {
	var vawal=eval('form.'+nameid1+'.value');
	var awal=eval('form.'+nameid1+'.selectedIndex');
	var pjitemawal=eval('form.'+nameid1+'.length');
	pjitemawal=pjitemawal-awal;
	
	var pjitem=eval('form.'+nameid2+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+nameid2+'.options[i] = null');
	}
	
	for (i=0; i<=pjitemawal-1; i++) {
		eval('form.'+nameid2+'.options[i] = new Option();')
		tahun=i+parseInt(vawal,10);
		eval('form.'+nameid2+'.options[i].text=tahun;')
		eval('form.'+nameid2+'.options[i].value=tahun;')
	}
}

function gantilainthnA(form,nameid1,nameid2) {
	var vawal=eval('form.'+nameid1+'.value');
	var awal=eval('form.'+nameid1+'.selectedIndex');
	var pjitemawal=eval('form.'+nameid1+'.length');
	pjitemawal=awal;
	
	var pjitem=eval('form.'+nameid2+'.length');
	for (i=pjitem; i>=0; i--) {
		eval('form.'+nameid2+'.options[i] = null');
	}
	
	for (i=0; i<=pjitemawal; i++) {
		eval('form.'+nameid2+'.options[i] = new Option();')
		eval('form.'+nameid2+'.options[i].text=form.'+nameid1+'.options[i].text;')
		eval('form.'+nameid2+'.options[i].value=form.'+nameid1+'.options[i].value;')
	}
}

function warning(form,str) {
	if (confirm(str)) {
		document.Freturnvalue=true;
	}
	else {
		document.Freturnvalue=false;
	}
}

function maxhari(form,bulan,tahun,from,to) {
	var days;
	var temp;
	days = caribulan(eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
	
	var pjitem=eval('form.'+to+'.length');
	for (j=pjitem; j>=0; j--) {
		eval('form.'+to+'.options[j] = null');
	}
	
	var dfrom=eval('form.'+from+'.value');
	var k;
	for (j=dfrom; j<=days; j++) {
		k=j-dfrom;
		temp = shortDay(j,eval('form.'+bulan+'.value'),eval('form.'+tahun+'.value'));
		eval('form.'+to+'.options[k] = new Option();')
		eval('form.'+to+'.options[k].text=j+" ("+temp+")";')
		eval('form.'+to+'.options[k].value=j;')
	}
}

function bukawindowcustom(alamat,w,h,jendela) {
	newWindow=window.open(alamat+'&ran='+Math.random(),jendela,"width="+w+",height="+h+",menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=0,left=0");
	newWindow.focus();
}

function bukawindowreport(alamat,w,h) {
	newWindow=window.open(alamat+'&ran='+Math.random(),'',"width="+w+",height="+h+",menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=0,left=0");
	newWindow.focus();
}

<!-- Please keep copyright lines in place without changes.
//   Copyright 2000 William and Mari Bontrager
//   Copyright 2003 Bontrager Connection, LLC
//
// For more information and instructions, please 
//    see the "Double Click Trapper" article at 
//    http://willmaster.com/possibilities/archives


// When the form's submit button is clicked a second 
//    time, the click trap is set. Here, specify how 
//    many seconds the trap exist before it's released.

TrapClicksForHowManySeconds = 12;



// If the user clicks the submit button and causes a 
//    trap, or clicks when a trip is set, you may spawn 
//    an alert box with a message. If you do want to 
//    spawn the alert box, specify the message between 
//    the quotation marks. Otherwise, leave it blank.
//(Blank is two consecutive quotation mark characters, 
//    with nothing between them.)
// Note: If you use any quotation marks in the message 
//       itself, those must be preceeded with a back-slash 
//       character. Example: "My name is \"tall\", okay?"

AlertBoxMessage = "PLEASE WAIT!!\n\nThe server should respond momentarily.\n\n\nClick the \"OK\" button.";



// If the user clicks the submit button and causes a trap, 
//    or clicks when a trip is set, you may spawn a popup 
//    box. If you want to spawn the popup box, specify 
//    the URL of the web page to insert into the popup. 
//    Otherwise, leave it blank. You may also specify 
//    the height of the popup and the width of the popup.

PopUpBoxURL = "";
PopUpBoxHeight = 300;
PopUpBoxWidth = 500;



// If you want the submit button to change its text when 
//    it is clicked, specify the name you assigned to the 
//    form, the name you assigned to the submit button 
//    form field, and the new text for the submit button. 
//    Otherwise, leave at least one of these blank.

NameOfForm = "Form1";
NameOfSubmitButton = "delall";
NewTextForSubmitButton = "WAIT!!";



// ////////////////////////////////////////// //
// NO CUSTOMIZATION REQUIRED BELOW THIS POINT //
// ////////////////////////////////////////// //


TrapTime = 0;
DoubleClickTrapperCounter = 0;


function DoubleClickTrapperAction(bt) {
DoubleClickTrapperCounter++;
DoubleClickTrapperButton(bt);
var trapTheClick = false;
if(DoubleClickTrapperCounter > 1 ) { trapTheClick = true; }
if(trapTheClick == true) {
	if(TrapTime == 0) {
		var tDate = new Date;
		TrapTime = tDate.valueOf();
		}
	else {
		var tDate = new Date;
		var localTrapTime = tDate.valueOf();
		if((localTrapTime - TrapTime) > (TrapClicksForHowManySeconds * 1000)) {
			TrapTime = 0;
			trapTheClick = false;
			DoubleClickTrapperCounter = 0;
			}
		}
	}
var valueToReturn = true;
if(trapTheClick == true) {
	valueToReturn = false;
	DoubleClickTrapperAlert();
	}
return valueToReturn;
} // end of function DoubleClickTrapperAction()


function DoubleClickTrapperButton(bt) {
var formname   = StripSpaces(NameOfForm);
var submitname = StripSpaces(bt);
var newtext    = StripSpaces(NewTextForSubmitButton);

var c = document.forms[0].elements.length;
for (i=0;i<c;i++) {
	e=eval('document.' + NameOfForm + '.elements[' + i + ']');
	if (e.type=='submit') {
		e.disabled = true;
	}
}

if(formname.length > 0 && submitname.length > 0 && newtext.length > 0) {
	var s1 = 'document.' + NameOfForm + '.' + bt + ".disabled = false";
	eval(s1);
	var s = 'document.' + NameOfForm + '.' + bt + ".value = '" + NewTextForSubmitButton + "'";
	eval(s);
	}
} // end of function DoubleClickTrapperButton()


function DoubleClickTrapperPopUp() {
var url = StripSpaces(PopUpBoxURL);
if(url.length > 0) {
	if(PopUpBoxHeight < 1) { PopUpBoxHeight = 200; }
	if(PopUpBoxWidth < 1) { PopUpBoxWidth = 300; }
	window.open(url,'',('height=' + PopUpBoxHeight + ',width=' + PopUpBoxWidth + ',resizable=yes,scrollbars=yes'));
	}
} // end of function DoubleClickTrapperPopUp()


function DoubleClickTrapperAlert() {
var message = StripSpaces(AlertBoxMessage);
if(message.length > 0) { alert(AlertBoxMessage); }
} // end of function DoubleClickTrapperAlert()


function StripSpaces(s) {
while(s.indexOf(' ') == 0) { s = s.substr(1); }
return s;
} // end of function StripSpaces()

// -->


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function Go(x) {
 if(x == "nothing") {
   document.forms[0].reset();
   document.forms[0].elements[0].blur();
   return;
 }
 else {
   this.location.href = x;
   document.forms[0].reset();
   document.forms[0].elements[0].blur();
 }
}
function newWindow(content, w, h) {
   nw = window.open(content,"popupWindow","width=" + w + ",height=" + h + ",left=0,top=0, scrollbars=yes, menubar=no, status=no");
   nw.focus();
}
function newWindowWI(content, w, h) {
   nw = window.open(content,"popupWindow","width=" + 440 + ",height=" + 440 + ",left=0,top=0, scrollbars=yes, menubar=yes, status=yes, resizable=yes");
   nw.focus();
}function newWindowWO(content, w, h) {
   nw = window.open(content,"popupWindow","width=" + 440 + ",height=" + 440 + ",left=0,top=0, scrollbars=yes, menubar=no, status=no");
   nw.focus();
}

function gantistatus(alamat) {
	newWindow=window.open(alamat,"PSBPRINT","width=900,height=600,menubar=yes,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=no,top=0,left=0");
	newWindow.focus();
}


/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //angka 2 adalah nilai kecepatan marquee, ubah jika ingin mengubahnya
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////TIDAK ADA YANG PERLU DI UBAH PADA BAGIAN INI////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("isi-marquee").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee

// Cek Flash
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


