
function movein(which){
	which.style.background='#FFF9BF';
}
function moveout(which,thiscolor){
	which.style.background=thiscolor;
}



function MachakFull(Ie,other){
x=screen.availWidth;
y=screen.availHeight;
target = parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf('.')-1,navigator.appVersion.length));
if((navigator.appVersion.indexOf("Mac")!=-1) &&(navigator.userAgent.indexOf("MSIE")!=-1) &&(parseInt(navigator.appVersion)==4))
window.open(other,"sub",'scrollbars=no');
if (target >= 4){
	if (navigator.appName=="Netscape"){
    var MachakFull=window.open(other,"MachakFull",'scrollbars=no','width='+x+',height='+y+',top=0,left=0');
	MachakFull.moveTo(0,0);
	MachakFull.resizeTo(x,y);}
if (navigator.appName=="Microsoft Internet Explorer")
	window.open(Ie,"MachakFull","fullscreen=yes,scrollbars=no");
	}
	else window.open(other,"sub",'fullscreen=yes,scrollbars=no');
	}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function textLimiter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
		else 
		countfield.value = maxlimit - field.value.length;
	}
var message="copyright Satlantas Polres Pasuruan";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 

//Disable right mouse click Script
document.onmousedown="if (event.button==2) return false";
document.oncontextmenu=new Function("return false");

document.onkeydown = showDown;

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
	

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


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);

  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }//-->

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

// <img src="xyz.png" alt="foo" width="10" height="20" onload="fixPNG(this)"> #

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function open_window(urlfile){
	myWin=window.open(urlfile,'','toolbars=no, scrollbars=yes, width=650, height=450, resizable=yes');
}

function toggleElement(strDivId,strDisplayVal)
{
	if (!strDisplayVal)
	{
		strDisplayVal = document.getElementById(strDivId).style.display;

		switch (strDisplayVal)
		{
			case "block" :
				strDisplayVal = "none";
				break;
			case "inline" :
				strDisplayVal = "none";
				break;
			case "none" :
				strDisplayVal = "block";
				break;
			case "" :
				break;
		}
	}
	document.getElementById(strDivId).style.display = strDisplayVal;
}

// ##################
// HTML Manipulation
// ##################

// Take a HTML string and lay it out nicely. This is not intended to be an
// advanced function, but it does make unreadable HTML code created by
// various HTML editors much easier to use.
function MakePrettyHTML(objHTML)
	{

	//allHTML = tbContentElement.DOM.body.innerHTML;
	allHTML = objHTML;

	allHTML = allHTML.replace(/<img/gi,"||<img");
	allHTML = allHTML.replace(/<br>/gi,"||<br>");
	allHTML = allHTML.replace(/<\/a>/gi,"||</a>");
	allHTML = allHTML.replace(/<em>/gi,"||<em>");
	allHTML = allHTML.replace(/<strong>/gi,"||<strong>");
	allHTML = allHTML.replace(/<b>/gi,"||<b>");
	allHTML = allHTML.replace(/<i>/gi,"||<i>");
	allHTML = allHTML.replace(/<\/td>/gi,"||</td>");
	allHTML = allHTML.replace(/<\/li>/gi,"||</li>");

	allHTML = allHTML.replace(/></gi,">\n<");

	allHTML = allHTML.replace(/\|\|<img/gi,"<img");
	allHTML = allHTML.replace(/\|\|<br>/gi,"<br>");
	allHTML = allHTML.replace(/\|\|<\/a>/gi,"</a>");
	allHTML = allHTML.replace(/\|\|<em>/gi,"<em>");
	allHTML = allHTML.replace(/\|\|<strong>/gi,"<strong>");
	allHTML = allHTML.replace(/\|\|<b>/gi,"<b>");
	allHTML = allHTML.replace(/\|\|<i>/gi,"<i>");
	allHTML = allHTML.replace(/\|\|<\/td>/gi,"</td>");
	allHTML = allHTML.replace(/\|\|<\/li>/gi,"</li>");

	allHTML = allHTML.replace(/<p/gi,"<p");
	allHTML = allHTML.replace(/<\/p>/gi,"</p>");
	allHTML = allHTML.replace(/ <\/p>/gi,"</p>");
	allHTML = allHTML.replace(/<h1/gi,"<h1");
	allHTML = allHTML.replace(/<h2/gi,"<h2");
	allHTML = allHTML.replace(/<h3/gi,"<h3");
	allHTML = allHTML.replace(/<h4/gi,"<h4");
	allHTML = allHTML.replace(/<h5/gi,"<h5");
	allHTML = allHTML.replace(/<h6/gi,"<h6");
	allHTML = allHTML.replace(/<ul/gi,"<ul");
	allHTML = allHTML.replace(/<ol/gi,"<ol");
	allHTML = allHTML.replace(/<blockquote/gi,"<blockquote");
	allHTML = allHTML.replace(/<img/gi,"<img");
	allHTML = allHTML.replace(/<font/gi,"<font");
	allHTML = allHTML.replace(/<\/font>/gi,"</font>");
	allHTML = allHTML.replace(/<a /gi,"<a ");
	allHTML = allHTML.replace(/<strong/gi,"<b");
	allHTML = allHTML.replace(/<\/strong>/gi,"</b>");
	allHTML = allHTML.replace(/<b/gi,"<b");
	allHTML = allHTML.replace(/<\/b>/gi,"</b>");
	allHTML = allHTML.replace(/<i/gi,"<i");
	allHTML = allHTML.replace(/<\/i>/gi,"</i>");
	allHTML = allHTML.replace(/<em/gi,"<em");
	allHTML = allHTML.replace(/<\/em>/gi,"</em>");
	allHTML = allHTML.replace(/<br>/gi,"<br>\n");
	allHTML = allHTML.replace(/<\/h1>/gi,"</h1>\n");
	allHTML = allHTML.replace(/<\/h2>/gi,"</h2>\n");
	allHTML = allHTML.replace(/<\/h3>/gi,"</h3>\n");
	allHTML = allHTML.replace(/<\/h4>/gi,"</h4>\n");
	allHTML = allHTML.replace(/<\/h5>/gi,"</h5>\n");
	allHTML = allHTML.replace(/<\/h6>/gi,"</h6>\n");
	allHTML = allHTML.replace(/<\/p>/gi,"</p>\n");
	allHTML = allHTML.replace(/<table(.*)>/gi,"<table$1>");
	allHTML = allHTML.replace(/<tbody/gi,"  <tbody");
	allHTML = allHTML.replace(/<tr/gi,"  <tr");
	allHTML = allHTML.replace(/<td/gi,"    <td");
	allHTML = allHTML.replace(/<\/tr>/gi,"  </tr>");
	allHTML = allHTML.replace(/<\/table>/gi,"</table>");
	allHTML = allHTML.replace(/<\/tbody>/gi,"  </tbody>");
	allHTML = allHTML.replace(/<li>/gi,"  <li> ");
	allHTML = allHTML.replace(/<\/li>/gi,"</li>\n");
	allHTML = allHTML.replace(/<\/ul>/gi,"</ul>\n");
	allHTML = allHTML.replace(/<\/ol>/gi,"</ol>\n");
	allHTML = allHTML.replace(/<\/blockquote>/gi,"</blockquote>\n");

	//allHTML = allHTML.replace(/<p><table/gi,"<table");
	//allHTML = allHTML.replace(/<\/table><\/p>/gi,"</table>\n");

	if (blnMozHTMLEditor)
		{
		// What a hack! There is a better way to do this...
		allHTML = allHTML.replace(/\n\n/gi,"\n");
		allHTML = allHTML.replace(/\n\n/gi,"\n");
		allHTML = allHTML.replace(/  /gi," ");
		}

	return allHTML;
	}



function showDown(evt) {
evt = (evt)? evt : ((event)? event : null);
if (evt) {
if (event.keyCode == 8 && (event.srcElement.type!= "text" && event.srcElement.type!= "textarea" && event.srcElement.type!= "password")) {
// When backspace is pressed but not in form element
cancelKey(evt);
}
else if (event.keyCode == 116) {
// When F5 is pressed
cancelKey(evt);
}
else if (event.keyCode == 122) {
// When F11 is pressed
cancelKey(evt);
}
//else if (event.ctrlKey && (event.keyCode == 78 ¦¦ event.keyCode == 82)) {
else if (event.ctrlKey && event.keyCode == 78) {
 //When ctrl is pressed with R or N
cancelKey(evt);
}
else if (event.ctrlKey && event.keyCode == 116) {
cancelKey(evt);
}
else if (event.altKey && event.keyCode==37 ) {
// stop Alt left cursor
return false;
}
}
}

function cancelKey(evt) {
if (evt.preventDefault) {
evt.preventDefault();
return false;
}
else {
evt.keyCode = 0;
evt.returnValue = false;
}
} 

var Pesan="| Satlantas Polres Pasuruan |";
   var Letak=1;
   function GulungKeKiri() {
     window.status=Pesan.substring(0, Letak);
    if (Letak >= Pesan.length) {
      Letak=1;
      window.setTimeout("GulungKeKanan()",300); }
    else {
      Letak++;
      window.setTimeout("GulungKeKiri()",100);   }}

   function GulungKeKanan() {
     window.status=Pesan.substring(Letak, Pesan.length);
    if (Letak >= Pesan.length) {
      Letak=1;
      window.setTimeout("GulungKeKiri()",300);    }
    else {
      Letak++;
      window.setTimeout("GulungKeKanan()",100);  }}

	window.onLoad=GulungKeKiri();