// test variables
var myHeight = 350;
var myWidth = 300;
var isResizable = false;

function createTarget(form) {
_target = form.target;
_colon = _target.indexOf(":");
if(_colon != -1) {
form.target = _target.substring(0,_colon);
form.args = _target.substring(_colon+1);
} else if(typeof(form.args)=="undefined") {
form.args = "";
}
if(form.args.indexOf("{")!=-1) {
_args = form.args.split("{");
form.args = _args[0];
for(var i = 1; i < _args.length;i++) {
_args[i] = _args[i].split("}");
form.args += eval(_args[i][0]) + _args[i][1];
   }
}
form.args = form.args.replace(/ /g,"");
_win = window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
return true;
}

var clickmessage="Klik kanan tidak dibenarkan ke atas gambar!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.name=="news_img"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()

function openwindow(winurl){
  window.open (winurl,"NewWin","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=300,height=350");
}

function openwinhistory(winurl){
  window.open (winurl,"NewWinHistory","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=190,height=200");
}

function openwinweather(winurl){
  window.open (winurl,"NewWinWeather","toolbar=no,location=no,directories=no,status=no,scrollbars=auto,resizable=no,copyhistory=no,width=300,height=140");
}

function openwinjob(winurl){
  window.open (winurl,"NewWinJob","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=225");
}

function openwin(winurl, lebar, tinggi){
  window.open (winurl,"NewWinCustom","toolbar=no,location=no,directories=no,status=no,scrollbars=auto,resizable=no,copyhistory=no,width="+lebar+",height="+tinggi+"");
}

function openwinscroll(winurl, lebar, tinggi){
  window.open (winurl,"NewWinCustom","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width="+lebar+",height="+tinggi+"");
}

function submitonce(theform) {
 if (document.all || document.getElementById) {
  // hunt down "submit" and "reset"
  for (i=0;i<theform.length;i++) {
   var tempobj=theform.elements[i];
   if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
    tempobj.disabled=true;
   }
  }
 }
}