<!--

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 < 10) { alert(unescape("Minimal 10 huruf")); return false; }
	if(document.datamasuk.content.value.length > 320) { alert(unescape("Maksimal 320 huruf")); return false; }	
	else { return true; }
}

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