<!--

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

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

function contents() {
	if(document.datamasuk.content.value.length < 20) { alert(unescape("Isi min.20 & max. 320 huruf")); return false; }
	if(document.datamasuk.content.value.length > 320) { alert(unescape("Isi min.100 & max. 320 huruf")); return false; }	
	else { return true; }
}

function postart() {
	if(document.datamasuk.content.value.length < 100) { alert(unescape("Isi min.100 & max. 3600 huruf")); return false; }
	if(document.datamasuk.content.value.length > 3600) { alert(unescape("Isi min.100 & max. 3600 huruf")); return false; }	
	else { return true; }
}

function count() {
	if(document.datamasuk.content.value.length > 0) { 
	document.datamasuk.hitung.value=document.datamasuk.content.value.length;
	}
	if(document.datamasuk.content.value.length == 0) { 
	document.datamasuk.hitung.value=0;
	}
}

function tmt_lenValidator(f,sp,ep,ks,eMsg) {
	var str;
	var myErr="";
	var re=/^(\s*)$/;
	fv=MM_findObj(f).value;
	if(ks) {if(re.test(fv)) {fv=fv.replace(re,""); } }
	if(fv.length<sp||fv.length>ep) { alert(unescape(eMsg)); 
	myErr += 'eMsg'; }
	document.MM_returnValue=(myErr=="");
}

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 tmt_createImgObj(imgURL,loadHandler,minW,maxW,minH,maxH,minS,maxS,fW,fH){//v2.0
	document.MM_returnValue=false; var img=new Image();img.minW=minW;img.maxW=maxW;img.minH=minH;img.maxH=maxH;
	img.fW=fW;img.fH=fH;img.minS=minS;img.maxS=maxS;img.onload=loadHandler;img.src=imgURL;
}

function tmt_checkImgObj() {//v2.0
	var errorMsg="";
	if(this.maxS!=""&&this.fileSize/1000>this.maxS){
		errorMsg+="max size : "+this.maxS+" kilobytes \n";}
	if(this.minS!=""&&this.fileSize/1000<this.minS){
		errorMsg+="min size : "+this.minS+" kilobytes \n";}
	if(this.maxW!=""&&this.width>this.maxW){
		errorMsg+="max width : "+this.maxW+" pixels \n";}
	if(this.minW!=""&&this.width<this.minW){
		errorMsg+="min width : "+this.minW+" pixels \n";}
	if(this.maxH!=""&&this.height>this.maxH){
		errorMsg+="max height : "+this.maxH+" pixels \n";}	
	if(this.minH!=""&&this.height<this.minH){
		errorMsg+="min height : "+this.minH+" pixels \n";}	
	if(errorMsg==""){
		if(this.fW){var fW=MM_findObj(this.fW);if(fW){fW.value=this.width;}}
		if(this.fH){var fH=MM_findObj(this.fH);if(fH){fH.value=this.height;}}}
		else{alert(errorMsg);}document.MM_returnValue=(errorMsg=="");
}

function tmt_CheckImg(formElement,minW,maxW,minH,maxH,minS,maxS,mime,fW,fH){//v2.1
	document.MM_returnValue=true;if(document.getElementById){var obj=MM_findObj(formElement);
	var f=obj.form.name;if(obj&&f){var exRex=new RegExp("\\.("+mime+")$","i");
	var noWhiteRex=/\\[\w_]*\.(\w{3})$/i;if(exRex.test(obj.value)&&noWhiteRex.test(obj.value)){	
	var imgURL="file:///"+obj.value;tmt_createImgObj(imgURL,tmt_checkImgObj,minW,maxW,minH,maxH,minS,maxS,fW,fH);
	eval("setTimeout(\"if(document.MM_returnValue){document."+f+".submit()}\",300)");}
	else{document.MM_returnValue=false;alert("Only "+mime+" files are allowed, no whitespaces inside names");
	obj.focus();obj.select();}}}
}

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 == '');
}

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 10;
offsetY = 10;
var toolTipSTYLE="";

function initToolTips() {
  if(ns4||ns6||ie4) {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}

function toolTip(msg, fg, bg) {

  if(toolTip.arguments.length < 1) {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else {

    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";

    var content =
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg + 
    '"><td align="center"><font face="sans-serif" color="' + fg +
    '" size="-2">&nbsp\;' + msg +
    '&nbsp\;</font></td></table></td></table>';

    if(ns4) {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }

    if(ns6) {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }

    if(ie4) {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}

function moveToMouseLoc(e) {
  	if(ns4||ns6) {
    	x = e.pageX;
    	y = e.pageY;
  	}
  	else {
    	x = event.x + document.body.scrollLeft;
    	y = event.y + document.body.scrollTop;
  	}

toolTipSTYLE.left = x + offsetX;
toolTipSTYLE.top = y + offsetY;
return true;

}

var list; // global list variable cache
var tickerObj; // global tickerObj cache
var hex = 255;

function fadeText(divId) {
  	if(tickerObj) {
    	if(hex>0) {
      	hex-=5; // increase color darkness
      	tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
      	setTimeout("fadeText('" + divId + "')", fadeSpeed); 
    	} else
      	hex=255; //reset hex value
  	}
}

function initialiseList(divId) {
  	tickerObj = document.getElementById(divId);
  	if(!tickerObj)
    	reportError("Could not find a div element with id \"" + divId + "\"");
  	list = tickerObj.childNodes;
  	if(list.length <= 0)
    	reportError("The div element \"" + divId + "\" does not have any children");
  	for (var i=0; i<list.length; i++) {
    	var node = list[i];
    	if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
        tickerObj.removeChild(node);
  	}
  	run(divId, 0);
}

function run(divId, count) {
	fadeText(divId);
  	list[count].style.display = "block";
  	if(count > 0)
    	list[count-1].style.display = "none";
  	else
    	list[list.length-1].style.display = "none";
  	count++;
  	if(count == list.length)
    	count = 0;
  	window.setTimeout("run('" + divId + "', " + count+ ")", interval*1000);
}

function reportError(error) {
  	alert("The script could not run because you have errors:\n\n" + error);
  	return false;
	}

var interval = 5; // interval in seconds
var fadeSpeed = 10; // fade speed, the lower the speed the faster the fade.  40 is normal.

//-->
