function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
<!--new window-->
var win=null;
function OpenWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
win.focus()
}
/*____________________________________________________________________________________________________________ */
/*
 | Browser object
 */
function b3kb_Browser() {
 d=document;
 this.agt=navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.dom=(d.getElementById)?1:0; // true for ie6, ns6
 this.ns=(d.layers);
 this.ns4up=(this.ns && this.major >=4);
 this.ns6=(this.dom&&navigator.appName=="Netscape");
 this.op=(window.opera? 1:0);
 this.ie=(d.all);
 this.ie4=(d.all&&!this.dom)?1:0;
 this.ie4up=(this.ie && this.major >= 4);
 this.ie5=(d.all&&this.dom);
 this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
 this.mac=(this.agt.indexOf("mac")!=-1);
}

var oBw = new b3kb_Browser();

/* begin new */
function b3kb_getH(o) { return (oBw.ns)?((o.height)?o.height:o.clip.height):((oBw.op&&typeof o.style.pixelHeight!='undefined')?o.style.pixelHeight:o.offsetHeight); }
function b3kb_setH(o,h) { if(o.clip) o.clip.height=h; else if(oBw.op && typeof o.style.pixelHeight != 'undefined') o.style.pixelHeight=h; else o.style.height=h; }
function b3kb_getW(o) { return (oBw.ns)?((o.width)?o.width:o.clip.width):((oBw.op&&typeof o.style.pixelWidth!='undefined')?w=o.style.pixelWidth:o.offsetWidth); }
function b3kb_setW(o,w) { if(o.clip) o.clip.width=w; else if(oBw.op && typeof o.style.pixelWidth != 'undefined') o.style.pixelWidth=w; else o.style.width=w; }
function b3kb_getX(o) { return (oBw.ns)?o.left:((o.style.pixelLeft)?o.style.pixelLeft:o.offsetLeft); }
function b3kb_setX(o,x) {
	if(oBw.ns) { 
		o.left=x;
	} else if(typeof o.style.pixelLeft != 'undefined') {
		o.style.pixelLeft=x;
	} else {
		thisPos = parseInt(x);			// preventing NS UNcaught Exception Error in strict.dtd mode: converting value to integer in case passed as string
		thisPos += "px";
		o.style.left = thisPos;
	}
}
function b3kb_getY(o) { return (oBw.ns)?o.top:((o.style.pixelTop)?o.style.pixelTop:o.offsetTop); }
function b3kb_setY(o,y) {
	if(oBw.ns) {
		o.top=y;
	} else if(typeof o.style.pixelTop != 'undefined') {
		o.style.pixelTop=y;
	} else {
		thisPos = parseInt(y);			// preventing NS UNcaught Exception Error in strict.dtd mode: converting value to integer in case passed as string
		thisPos += "px";
		o.style.top = thisPos;
	}
}
function b3kb_getPageX(o) { var x=0; if(oBw.ns) x=o.pageX; else { while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } } return x; }
function b3kb_getPageY(o) { var y=0; if(oBw.ns) y=o.pageY; else { while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } } return y; }
function b3kb_getZ(o) { return (oBw.ns)?o.zIndex:o.style.zIndex; }
/* end new */

function b3kb_moveTo(o,x,y) { b3kb_setX(o,x);b3kb_setY(o,y); }
function b3kb_moveBy(o,x,y) { b3kb_setX(o,b3kb_getPageX(o)+x);b3kb_setY(o,b3kb_getPageY(o)+y); }

function b3kb_setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; }

function b3kb_setClip(o) { }

function b3kb_show(o,disp) { 
 (oBw.ns)? '':(!disp)? o.style.display="inline":o.style.display=disp;
 (oBw.ns)? o.visibility='show':o.style.visibility='visible';  
}
function b3kb_hide(o,disp) { 
 (oBw.ns)? '':(arguments.length!=2)? o.style.display="none":o.style.display=disp;
 (oBw.ns)? o.visibility='hide':o.style.visibility='hidden';  
}

function b3kb_setStyle(o,s,v) { if(oBw.ie5||oBw.dom) eval("o.style."+s+" = '" + v +"'"); }
function b3kb_getStyle(o,s) { if(oBw.ie5||oBw.dom) return eval("o.style."+s); }

function b3kb_getDocW() { }
function b3kb_getDocH() { }

function b3kb_addEvt(o,e,f,c){ if(o.addEventListener)o.addEventListener(e,f,c);else if(o.attachEvent)o.attachEvent("on"+e,f);else eval("o.on"+e+"="+f)}

function b3kb_writeHTML(o,h) { 
 if(oBw.ns){var doc=o.document;doc.write(h);doc.close();return false;}
 if(o.innerHTML)o.innerHTML=h; 
}

// w - beforeBegin,afterBegin,beforeEnd,afterEnd
// width - for ns 4 only
function b3kb_insertHTML(o,h,w) {
 if (oBw.op) return;
 if (o.insertAdjacentHTML) { 
  o.insertAdjacentHTML(w,h);
  return;
 }
 if (oBw.ns) {
  b3kb_writeHTML(o,h);
  return;
 }


 // mozilla
 var r = o.ownerDocument.createRange();
	r.setStartBefore(o);
	var frag = r.createContextualFragment(h);
	b3kb_insertObj(o,w,frag)
}


function b3kb_insertObj(o,w,node) {
	switch (w){
	case 'beforeBegin':
		o.parentNode.insertBefore(node,o)
		break;
	case 'afterBegin':
		o.insertBefore(node,o.firstChild);
		break;
	case 'beforeEnd':
		o.appendChild(node);
		break;
	case 'afterEnd':
		if (o.nextSibling){
			o.parentNode.insertBefore(node,o.nextSibling);
		} else {
			o.parentNode.appendChild(node)
		}
		break;
	}
}

/*____________________________________________________________________________________________________________ */


function C_ShowLayer() { 
  var i,v,obj,args=C_ShowLayer.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=MM_findObj(args[i]))!=null) {
      if (obj.style) {
        obj=obj.style;
        obj.visibility='visible';
      }
      else {
        obj.visibility='show';
      }
    }
  }
}

function C_HideLayer() { 
  var i,v,obj,args=C_HideLayer.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=MM_findObj(args[i]))!=null) {
      if (obj.style) {
        obj=obj.style;
        obj.visibility='hidden';
      }
      else {
        obj.visibility='hide';
      }
    }
  }
}

function C_SetMenuPosition2() { 
var nLeft
if (document.body.clientWidth>1000){
	nLeft=165+((document.body.clientWidth-1000)/2);
}else{
	nLeft=165;
}
  var i,v,obj,args=C_SetMenuPosition2.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=MM_findObj(args[i]))!=null) {
      if (obj.style) {
        obj=obj.style;
        obj.left=nLeft+"px";
      }
      else {
        obj.left=nLeft+"px";
      }
    }
  }
}

function checkForm() {
	if (document.mf.realname.value.length <1) { alert("Sorry, but you haven\'t filled out all fields required.\nPlease enter your name."); document.mf.realname.focus(); return false;
	} else {
	if (document.mf.realname.value.length<4) { alert("Name should be at least 4 characters.\n");document.mf.realname.focus(); return false; 
		}
	}
	if (document.mf.email.value.length <1) { 
		alert("Sorry, but you haven\'t filled out all fields required.\nPlease enter your email address."); document.mf.email.focus(); return false; 
	}	
	else { 
		dmn = document.mf.email.value.substr(document.mf.email.value.indexOf("@")+1,document.mf.email.value.length);
		if((document.mf.email.value.indexOf("@")<1) ||(dmn.indexOf("@")>-1) || (dmn.indexOf(".")<1) || (dmn.indexOf(".")>dmn.length-2)) {
			alert("Please type a valid email address.\nEx : (email@domainname.com)."); document.mf.email.focus(); return false; 
		}
	}
	if (document.mf.comment.value.length <1) { alert("Sorry, but you haven\'t filled out all fields required.\nPlease enter your comment."); document.mf.comment.focus(); return false; }
	document.mf.submit();
}
function checkForm2() {
	if (document.mf.realname.value.length <1) { alert("Sorry, but you haven\'t filled out all fields required.\nPlease enter your name."); document.mf.realname.focus(); return false;
	} else {
	if (document.mf.realname.value.length<4) { alert("Name should be at least 4 characters.\n");document.mf.realname.focus(); return false; 
		}
	}
	if (document.mf.email.value.length <1) { 
		alert("Sorry, but you haven\'t filled out all fields required.\nPlease enter your email address."); document.mf.email.focus(); return false; 
	}	
	else { 
		dmn = document.mf.email.value.substr(document.mf.email.value.indexOf("@")+1,document.mf.email.value.length);
		if((document.mf.email.value.indexOf("@")<1) ||(dmn.indexOf("@")>-1) || (dmn.indexOf(".")<1) || (dmn.indexOf(".")>dmn.length-2)) {
			alert("Please type a valid email address.\nEx : (email@domainname.com)."); document.mf.email.focus(); return false; 
		}
	}
	document.mf.submit();
}

function OpenWindow(theImage,Width,Height,Caption) { //v2.0
  popUp=window.open('', '','width='+Width+',height='+Height);
  popUp.document.write("<HTML><HEAD><TITLE>Bloo Lagoon "+Caption+"</TITLE></HEAD><BODY bgcolor=F2F7FA leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");
  popUp.document.write("<IMG SRC=",theImage," width=",Width," height=",Height,"></BODY></HTML>");
  popUp.moveTo((screen.width-Width)/2,(screen.height-Height)/2)
}

/* untuk halaman Studio on click */
function b3k_popLayerGal(div,href,offx,offy) {
	var e = d.getElementById(div);
	if (e.className.indexOf('hiddenlayer') != -1) {
		// if current popup is hidden, make sure all others are hidden.
		b3k_setLayerLocation(div,href,offx,offy);		
		e.className = 'showlayer'; //show layer	
	}
}

function b3k_hideLayerGal(div) {
	var e = d.getElementById(div);
	if (e.className.indexOf('showlayer') != -1) {
		e.className = 'hiddenlayer';		
	} 
	MM_displayStatusMsg('');
}
function b3k_hideallLayerGal(n) {
	var i;
	for (var i=1; i <=n; i++) {
	b3k_hideLayerGal('gal'+i);
	}
}
function b3k_hideallLayerPackage(n) {
	var i;
	for (var i=1; i <=n; i++) {
	b3k_hideLayerGal('pckcon'+i);
	}
}

function b3k_setLayerLocation(div,href,offx,offy) {
//alert(div,href.name);
	var e = d.getElementById(div);
	//get position of link
	var x=b3kb_getPageX(href);
	var y=b3kb_getPageY(href);
	// check and set there is offset
	x= offx ? x + offx : x;
	y= offy ? y + offy : y;
	//move layer
	b3kb_moveTo(e,x,y);
}


/* untuk halaman gallery thumbnail 1*/
objMenuPopUpGal1 = null;
function b3k_popLayerGal1(div,href,offx,offy) {
	var e = d.getElementById(div);
	if (e.className.indexOf('hiddenlayer') != -1) {
		// if current popup is hidden, make sure all others are hidden.
		b3k_hidePopLayersGal1('div','showlayer','hiddenlayer');	
		b3k_setLayerLocation(div,href,offx,offy);		
		e.className = 'showlayer'; //show layer	
	}
}

function b3k_hideLayerGal1(div) {
	var e = d.getElementById(div);
	if (e.className.indexOf('showlayer') != -1) {
		e.className = 'hiddenlayer';		
	} 
	MM_displayStatusMsg('');
}

var aCh="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var dCh="0123456789-";
var sCh="ÀÂÃÄÅÆÇÈÉÊËÌÍÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿŠŒŽšœžŸ'_`~()^&*+-|=<>,./\{}[] ";
var asCh=aCh + dCh + "!\"#$%&'()*+,-./:;<=>?@[\]^_`{}~";

function isAlphaNum(S) {
	var AlphaNum=aCh + dCh;
	for (var i=0; i < S.length; i++) {
		if (AlphaNum.indexOf(S.charAt(i)) == -1)
			return false;
	}
	return true;
}

function isASCII(S) {
	for (var i=0; i < S.length; i++) {
		if (asCh.indexOf(S.charAt(i)) == -1)
			return false;
	}
	return true;
}

function isName(S) {
	var cName=aCh + dCh + sCh;
	for (var i=0; i < S.length; i++) {
		if (cName.indexOf(S.charAt(i)) == -1)
			return false;
	}
	return true;
}

function isEmail(S) {
	var pass=0;
	if (window.RegExp) {
		var tempS="a";
		var tempReg=new RegExp(tempS);
		if (tempReg.test(tempS)) pass=1;
	}
	if (!pass)
		return (S.indexOf(".") > 2) && (S.indexOf("@") > 0);

	var r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2=new RegExp("^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]*[a-zA-Z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(S) && r2.test(S));
}
function fPackage(url) {
window.open(url,null,"top=180,left=200,height=220,width=450,menubar=no,toolbar=no,scrollbars=no");  
}

