function ResizeThem(){
var imgs      = document.getElementsByTagName("img");
for ( var p = 0; p < imgs.length; p++ )
    if ( imgs[p].getAttribute("alt") == "user posted image" ){
         imgs[p].style.cursor = "pointer";
         imgs[p].onclick = function( ){
              var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
                   iw.focus();
         };
    }
}


function ResizeThem_old(){
var maxheight = 180;
var maxwidth  = 150;
var imgs      = document.getElementsByTagName("img");
for ( var p = 0; p < imgs.length; p++ )
    if ( imgs[p].getAttribute("alt") == "user posted image" ){
         var w = parseInt( imgs[p].width );
         var h = parseInt( imgs[p].height );
         if ( w > maxwidth ){
              imgs[p].style.cursor = "pointer";
              imgs[p].onclick = function( ){
                   var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
                   iw.focus();
              };
              h = ( maxwidth / w ) * h;
              w = maxwidth;
              imgs[p].height = h;
              imgs[p].width = w;
         }
        if ( h > maxheight ){
              imgs[p].style.cursor="pointer";
              imgs[p].onclick = function( ){
                   var iw = window.open ( this.src, 'ImageViewer','resizable=1' );
                   iw.focus( );
              };
              imgs[p].width = ( maxheight / h ) * w;
              imgs[p].height = maxheight;
        }
    }
}
//  Begin validate total -->

function validateForm(the_form) {

   	for (var i=0; i < the_form.elements.length; i++)

		if (the_form.elements[i].value==""){

           alert('Kolom inputan '+the_form.elements[i].id+' tidak boleh kosong');	   

		   return false;

		}

	return true;

}

//  End -->



<!-- Begin return on click

function clicked(obj) {

	window.returnValue = obj.id.split(":");

	window.close();

}

// End -->



<!-- Begin change color

var _BGCOLOR = null;

function hilite(obj, hlt) {

	var children = obj.childNodes;

	for (i=0;i<children.length;i++) {

		if (hlt == true) {

			_BGCOLOR = children[i].style.backgroundColor;

			children[i].style.backgroundColor = '#F0FFF0';				

		} else {

			children[i].style.backgroundColor = _BGCOLOR;

		}

	}

}

//  End -->



<!-- Begin lookup popup

function openWindow(page) {

  OpenWin = this.open(page, "CtrlWindow", "width=650px,height=600px,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");

}

<!-- Begin

function colapse2(nama){

	var cek = document.getElementById(nama).style.display;

	if(cek == ""){

		document.getElementById(nama).style.display="none";	

	}else{

		document.getElementById(nama).style.display="";

	}

}

//  End -->





<!-- Begin

function NewWindow(mypage, myname, w, h, scroll) {

var winl = (screen.width - w) / 2;

var wint = (screen.height - h) / 2;

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

win = window.open(mypage, myname, winprops)

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

//  End -->



//  Begin Time -->



function MakeArraymonth(size) {

this.length = size;

for(var i = 1; i <= size; i++) {

this[i] = "";

}

return this;

}

function funClock() {

if (!document.layers && !document.all)

return;

var runTime = new Date();

var hours = runTime.getHours();

var minutes = runTime.getMinutes();

var seconds = runTime.getSeconds();

var dn = "AM";

if (hours >= 12) {

dn = "PM";

hours = hours - 12;

}

if (hours == 0) {

hours = 12;

}

if (minutes <= 9) {

minutes = "0" + minutes;

}

if (seconds <= 9) {

seconds = "0" + seconds;

}

movingtime = hours + ":" + minutes + ":" + seconds + " " + dn ;

if (document.layers) {

document.layers.clock.document.write(movingtime);

document.layers.clock.document.close();

}

else if (document.all) {

clock.innerHTML = movingtime;

}

setTimeout("funClock()", 1000)

}



//  End -->



//  Begin Load Images -->



function loadImages() {

if (document.getElementById) {  // DOM3 = IE5, NS6

document.getElementById('hidepage').style.visibility = 'hidden';

}

else {

if (document.layers) {  // Netscape 4

document.hidepage.visibility = 'hidden';

}

else {  // IE 4

document.all.hidepage.style.visibility = 'hidden';

      }

   }

}

//  End -->







/***********************************************

* Switch Menu script- by Martial B of http://getElementById.com/

* Modified by Dynamic Drive for format & NS4/IE4 compatibility

* Visit http://www.dynamicdrive.com/ for full source code

***********************************************/



var persistmenu="yes" 

var persisttype="sitewide" 



if (document.getElementById){ 

document.write('<style type="text/css">\n')

document.write('.submenu{display: none;}\n')

document.write('</style>\n')

}



function SwitchMenu(obj){

	if(document.getElementById){

	var el = document.getElementById(obj);

	var ar = document.getElementById("masterdiv").getElementsByTagName("span");

		if(el.style.display != "block"){

			for (var i=0; i<ar.length; i++){

				if (ar[i].className=="submenu") 

				ar[i].style.display = "none";

			}

			el.style.display = "block";

		}else{

			el.style.display = "none";

		}

	}

}

<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Abraham Joffe :: http://www.abrahamjoffe.com.au/ */

/***** CUSTOMIZE THESE VARIABLES *****/

  // width to resize large images to
var maxWidth=130;
  // height to resize large images to
var maxHeight=150;
  // valid file types
var fileTypes=["bmp","gif","png","jpg","jpeg"];
  // the id of the preview image tag
var outImage="previewField";

  // what to display when the image is not valid
var defaultPic="spacer.gif";

/***** DO NOT EDIT BELOW *****/

function preview(what){
 
  var source=what.value;
  var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
  for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
  globalPic=new Image();
  if (i<fileTypes.length) globalPic.src=source;
  else {
    globalPic.src=defaultPic;
    alert("File ini bukan file gambar, Jenis Gambar :\n\n"+fileTypes.join(", "));
  }
  setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges(){
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth) {
    y*=maxWidth/x;
    x=maxWidth;
  }
  if (y>maxHeight) {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}

// End -->


