// JavaScript Document



// From Dreamweaver 8 Starter Page

//--------------- LOCALIZEABLE GLOBALS ---------------

var d=new Date();

var monthname=new Array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");

var dailyname=new Array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");

//Ensure correct for language. English is "January 1, 2004"

var TODAY = dailyname[d.getDay()] + ", " + d.getDate() + " " + monthname[d.getMonth()] + " " + d.getFullYear();

//---------------   END LOCALIZEABLE   ---------------



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_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}



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_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 == '');

}



// From Dreamweaver 8 Snippets

var popUpWin=0;



function popUpWindow(URLStr, myscroll, left, top, width, height)
{

  if(popUpWin)
  {

    if(!popUpWin.closed) popUpWin.close();
  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=yes,scrollbars='+myscroll+',width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

var external=0;

function externallink(URLStr, left, top)
{

  if(external)
  {



    if(!external.closed) external.close();



  }



  external = open(URLStr, 'external', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width='+screen.width+',height='+screen.height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');



}



function numb (inputString)



{



  return isNaN(inputString);



}



function checkconv(stat)
{
	var idlong = document.getElementById("long");
	var idshort = document.getElementById("short");
	if(stat=="show")
	{
		idlong.style.display = "";
		idshort.style.display = "none";
	} else {
		idshort.style.display = "";
		idlong.style.display = "none";
	}
}

function convstat(stat)
{

	var idshow = document.getElementById("converter");
	var idhide = document.getElementById("mini");

	if(stat=="show")
	{
        alwaysOnTop.hidediv('mini')
        alwaysOnTop.init({
                targetid: 'converter',
                orientation: 3,
                position: [25, 0],
                fadeduration: [0, 0],
                frequency: 1,
                hideafter: 0
        })
	} else {
        alwaysOnTop.hidediv('converter')
        alwaysOnTop.init({
                targetid: 'mini',
                orientation: 4,
                position: [25, 0],
                fadeduration: [0, 0],
                frequency: 1,
                hideafter: 0
        })
	}

}

/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var promo_one=new Array()
promo_one[0]=["img/promo_2000server.gif", "javascript:void(0)", ""]

var promo_two=new Array()
promo_two[0]=["img/promo_98fpp.gif", "javascript:void(0)", ""]

var fadebgcolor="white"

////NO need to edit beyond here/////////////

var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers

var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all

function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){

this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")

theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images

for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}

var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2

if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')

if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}


function fadepic(obj){

if (obj.degree<100){

obj.degree+=10

if (obj.tempobj.filters&&obj.tempobj.filters[0]){

if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+

obj.tempobj.filters[0].opacity=obj.degree

else //else if IE5.5-

obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"

}

else if (obj.tempobj.style.MozOpacity)

obj.tempobj.style.MozOpacity=obj.degree/101

else if (obj.tempobj.style.KhtmlOpacity)

obj.tempobj.style.KhtmlOpacity=obj.degree/100

}

else{

clearInterval(fadeclear[obj.slideshowid])

obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"

obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)

obj.populateslide(obj.tempobj, obj.nextimageindex)

obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0

setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)

}

}

fadeshow.prototype.populateslide=function(picobj, picindex){

var slideHTML=""

if (this.theimages[picindex][1]!="") //if associated link exists for image

slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'

slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'

if (this.theimages[picindex][1]!="") //if associated link exists for image

slideHTML+='</a>'

picobj.innerHTML=slideHTML

}

fadeshow.prototype.rotateimage=function(){

if (this.pausecheck==1) //if pause onMouseover enabled, cache object

var cacheobj=this

if (this.mouseovercheck==1)

setTimeout(function(){cacheobj.rotateimage()}, 100)

else if (iebrowser&&dom||dom){

this.resetit()

var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

crossobj.style.zIndex++

fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)

this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"

}

else{

var ns4imgobj=document.images['defaultslide'+this.slideshowid]

ns4imgobj.src=this.postimages[this.curimageindex].src

}

this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0

}

fadeshow.prototype.resetit=function(){

this.degree=10

var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

if (crossobj.filters&&crossobj.filters[0]){

if (typeof crossobj.filters[0].opacity=="number") //if IE6+

crossobj.filters(0).opacity=this.degree

else //else if IE5.5-

crossobj.style.filter="alpha(opacity="+this.degree+")"

}

else if (crossobj.style.MozOpacity)

crossobj.style.MozOpacity=this.degree/101

else if (crossobj.style.KhtmlOpacity)

crossobj.style.KhtmlOpacity=obj.degree/100

}

fadeshow.prototype.startit=function(){

var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)

this.populateslide(crossobj, this.curimageindex)

if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER

var cacheobj=this

var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)

crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}

crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}

}

this.rotateimage()

}

// End of Slide Show



//** Stay on Top content script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** Script available at usage terms at http://www.dynamicdrive.com
//** v1.0 (May 12th, 09')

var alwaysOnTop={

	dsettings: {
		targetid: '',
		orientation: 2,
		position: [10, 30],
		externalsource: '',
		frequency: 1,
		hideafter: 0,
		fadeduration: [500, 500],
		display: 0 //internal setting on whether to display target element at all (based on frequency setting)
  },

	settingscache: {},

	positiontarget:function($target, settings){
		var fixedsupport=!document.all || document.all && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
		var posoptions={position:fixedsupport? 'fixed':'absolute', visibility:'visible'}
		if (settings.fadeduration[0]>0) //if fade in
			posoptions.opacity=0
		posoptions[(/^[13]$/.test(settings.orientation))? 'left' : 'right']=settings.position[0]
		posoptions[(/^[12]$/.test(settings.orientation))? 'top' : 'bottom']=settings.position[1]
		if (document.all && !window.XMLHttpRequest) //loose check for IE6 and below
			posoptions.width=$target.width() //IE6- seems to require an explicit width on a DIV
		$target.css(posoptions)
		if (!fixedsupport){
			this.keepfixed($target, settings)
			var evtstr='scroll.' + settings.targetid + ' resize.'+settings.targetid
			jQuery(window).bind(evtstr, function(){alwaysOnTop.keepfixed($target, settings)})
		}
		this.revealdiv($target, settings, fixedsupport)
		if (settings.hideafter>0){ //if hide timer enabled
			setTimeout(function(){
				alwaysOnTop.hidediv(settings.targetid)
			}, settings.hideafter+settings.fadeduration[0])
		}
	},

	keepfixed:function($target, settings){
		var $window=jQuery(window)
		var is1or3=/^[13]$/.test(settings.orientation)
		var is1or2=/^[12]$/.test(settings.orientation)
		var x=$window.scrollLeft() + (is1or3? settings.position[0] : $window.width()-$target.outerWidth()-settings.position[0])
		var y=$window.scrollTop() + (is1or2? settings.position[1] : $window.height()-$target.outerHeight()-settings.position[1])
		$target.css({left:x+'px', top:y+'px'})
	},

	revealdiv:function($target, settings){
		if (settings.fadeduration[0]>0) //if fade in
			$target.show().animate({opacity:1}, settings.fadeduration[0])
		else
			$target.show()
		if (settings.frequency=="session") //set session only cookie (name: 'sots' + targetid)?
			this.setCookie('sots'+settings.targetid, 'shown')
		else if (/^\d+ day/i.test(settings.frequency)){ //set persistent cookie (name: 'sotp' + targetid)?
			var persistdays=parseInt(settings.frequency)
			this.setCookie('sotp'+settings.targetid, persistdays, persistdays)
		}
	},

	hidediv:function(targetid){ //public function
		var $target=jQuery('#'+targetid)
		if ($target.css('display')=='none') //if target hidden already
			return
		var settings=this.settingscache[targetid]
		if (settings.fadeduration[1]>0) //if fade out
			$target.animate({opacity:0}, settings.fadeduration[1], function(){$target.hide()})
		else
			$target.hide()
		var evtstr='scroll.' + settings.targetid + ' resize.'+settings.targetid
		jQuery(window).unbind(evtstr)
	},

	loadajaxcontent:function($, settings){
		$.ajax({
			url: settings.externalsource,
			error:function(ajaxrequest){
				alert('Error fetching Ajax content.\nServer Response: '+ajaxrequest.responseText)
			},
			success:function(content){
				var $target=$(content)
				if ($target.get(0).id==settings.targetid)
					alwaysOnTop.positiontarget($target.appendTo('body'), settings)
				else
					alert('Error: The value you have entered for "targetid" ('+settings.targetid+') '
						+ 'doesn\'t match the ID of your remote content\'s DIV container ('+$target.get(0).id+'). This must be corrected'
					)
			}
		})
	},

	init:function(options){
		var settings={}
  	settings=jQuery.extend(settings, this.dsettings, options)
		this.settingscache[settings.targetid]=settings
		if (typeof settings.frequency=="number") //value of 1=show, 0=hide
			settings.display=(settings.frequency>Math.random())? 1 : 0
		else if (settings.frequency=="session")
			settings.display=(this.getCookie('sots'+settings.targetid)=='shown')? 0 : 1 //session cookie name: 'sots' + targetid
		else if (/^\d+ day/i.test(settings.frequency)){ //match 'xx days'
			//If admin has changed number of days to persist from current cookie records, reset persistence by deleting cookie
			if (parseInt(this.getCookie('sotp'+settings.targetid))!= parseInt(settings.frequency))
				this.setCookie('sotp'+settings.targetid, '', -1)
			settings.display=(this.getCookie('sotp'+settings.targetid)!=null)? 0 : 1 //persistent cookie name: 'sotp' + targetid
		}
		jQuery(document).ready(function($){
			if (settings.externalsource!='' && settings.display){ //if ajax content
					alwaysOnTop.loadajaxcontent($, settings)
			}
			else if (settings.externalsource==''){ //inline content
				var $target=$('#'+settings.targetid)
				if (!settings.display){ //if hide content (based on frequency setting)
					$target.hide()
					return false
				}
				else{
					alwaysOnTop.positiontarget($target, settings)
				}
			}
		}) //end ready
	},

	getCookie:function(Name){
		var re=new RegExp(Name+"=[^;]*", "i"); //construct RE to search for target name/value pair
		if (document.cookie.match(re)) //if cookie found
			return document.cookie.match(re)[0].split("=")[1] //return its value
		return null
	},

	setCookie:function(name, value, days){
		if (typeof days!="undefined"){ //if set persistent cookie
			var expireDate = new Date()
			var expstring=expireDate.setDate(expireDate.getDate()+days)
			document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()
		}
		else
			document.cookie = name+"="+value+"; path=/"
	}
}
