function clock() {
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "a.m";
if (hours > 11) amOrPm = "p.m";
if (hours > 18) amOrPm = "a.m";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
document.getElementById('pendule').innerHTML = dispTime;
setTimeout("clock()", 1000);
}
window.onload=clock;
function mainmenu(){
jQuery(" #nav ul ").css({display: "none"}); // Opera Fix
jQuery(" #nav li").hover(function(){
jQuery(this).find('ul:first:hidden').css({visibility: "visible",display: "none"}).fadeIn(100);
},function(){
jQuery(this).find('ul:first').fadeOut(50);
});
}
 
jQuery(document).ready(function(){					
mainmenu();
});
jQuery(document).ready(
/*
This function gets loaded when all the HTML, not including the portlets, is
loaded.
*/
function() {
}
);
Liferay.Portlet.ready(
/*
This function gets loaded after each and every portlet on the page.
portletId: the current portlet's id
jQueryObj: the jQuery wrapped object of the current portlet
*/
function(portletId, jQueryObj) {
}
);
jQuery(document).last(
/*
This function gets loaded when everything, including the portlets, is on
the page.
*/
function() {
}
);
/*********start accessibilty***************/
function toggle (id) {
var post = document.getElementById(id);
if (post.className=="portletshown") { 
post.className="portlethidden"; 
} else { 
post.className="portletshown"; 
}
}
function changeLocation (targetURL) {
window.location = targetURL;
}
/*********besarkan saiz tulisan**************/	
function setFontPlus(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 13;
} else {
size = size.substr(0,2);
}
if(size < 15) {
if(size == 14) {
size = eval(size) + 2;
} else {
size = eval(size) + 1;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
changecss('#nav li a','font-size',fontSize);
changecss('.portlet-title','font-size',fontSize);
changecss('.cms_content','font-size',fontSize);
changecss('.cms_header','font-size',fontSize);
changecss('.journal-content-article','font-size',fontSize);
}
}// end setFontPlus
/*********kecilkan saiz tulisan*************/
function setFontMinus(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 10; 
} else {
size = size.substr(0,2);
} 
if(size > 10) {
if(size == 16) {
size = eval(size) - 2;
} else {
size = eval(size) - 1;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
changecss('#nav li a','font-size',fontSize);
changecss('.portlet-title','font-size',fontSize);
changecss('.cms_content','font-size',fontSize);
changecss('.cms_header','font-size',fontSize);
}
}
/**********kembalikan warna asal*************/
function revertStyles(){
changecss('.cms_content','color','000000');
changecss('.cms_header','color','000000');
changecss('.portlet-title','color','white');
changecss('#p_p_id_73_INSTANCE_TFq1_ a','color','#000000');
changecss('.portlet-boundary.portlet-boundary_73_.portlet-breadcrumb a','color','#000000');
changecss('#column-2 .td-dof-title ','color','#000000');
changecss('.nav-menu h3 a','color','#000000');
changecss('#nav li','color','#ffffff');
changecss('#nav li a','color','#ffffff');
changecss('#nav a','color','#000000');
changecss('#nav li ul li','color','#000000');
changecss('#nav li ul li a','color','#000000');
changecss('body','color','#000000');
changecss('.nav-menu li a.selected','color','#000000');
changecss('a:link','color','#003366');
changecss('a:visited','color','#003366');
changecss('a:hover','color','#000000');
changecss('body','color','black');
changecss('a','color','#000000');
changecss('span','color','#ffffff');
changecss('element.style','color','#ffffff');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','black');
}
/********kembalikan saiz huruf kepada asal************/
function revertFontStyles(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 11; 
} else {
size = size.substr(0,2);
} 
if(size > 10) {
if(size == 16) {
size = 11;
} else {
size = 11;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
}
changecss('.portlet-title','font-size','12px');
changecss('#nav li a','font-size','11px');
changecss('.cms_content','font-size','12px');
changecss('.cms_header','font-size','14px');
changecss('.journal-content-article','font-size','10px');
}
function changecss(theClass,element,value) {
//Last Updated on May 21, 2008
//documentation for this script at
//http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
 var cssRules;
 if (document.all) {
 cssRules = 'rules';
 }
 else if (document.getElementById) {
 cssRules = 'cssRules';
 }
 var added = false;
 for (var S = 0; S < document.styleSheets.length; S++){
 for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
 if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
 if(document.styleSheets[S][cssRules][R].style[element]){
 document.styleSheets[S][cssRules][R].style[element] = value;
 added=true;
 break;
 }
 }
 }
 if(!added){
 if(document.styleSheets[S].insertRule){
 document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
 }
 else if (document.styleSheets[S].addRule) {
 document.styleSheets[S].addRule(theClass,element+': '+value+';');
 }
 }
 }
}
// end function changecss
/*************tukar warna tulisan kepada warna merah**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontRed(){
changecss('.cms_content','color','red');
changecss('.cms_header','color','red');
changecss('.portlet-title','color','red');
changecss('#p_p_id_73_INSTANCE_TFq1_ a','color','red');
changecss('.portlet-boundary.portlet-boundary_73_.portlet-breadcrumb a','color','red');
changecss('#column-2 .td-dof-title ','color','red');
changecss('.nav-menu h3 a','color','red');
changecss('ul li','color','red');
changecss('ol li','color','red');
changecss('#nav li ul a','color','red');
changecss('#nav li a:hover','color','red');
changecss('#nav li','color','red');
changecss('li.parent-nav-item-main a','color','red');
changecss('#nav li ul li ul li a','color','red');
changecss('#nav ul','color','red');
changecss('#nav li a','color','red');
changecss('#nav li ul li','color','red');
changecss('#nav li ul li a','color','red');
changecss('body','color','red');
changecss('a','color','red');
changecss('#nav a','color','red');
changecss('.nav-menu li a.selected','color','red');
changecss('a:link','color','red');
changecss('a:visited','color','red');
changecss('a:hover','color','blue');
changecss('span','color','red');
changecss('li.selected_main','color','red');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','red');
}
/*************tukar warna tulisan kepada warna biru**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontBlue(){
changecss('.cms_content','color','blue');
changecss('.cms_header','color','blue');
changecss('#p_p_id_73_INSTANCE_TFq1_ a','color','blue');
changecss('.portlet-boundary.portlet-boundary_73_.portlet-breadcrumb a','color','blue');
changecss('#column-2 .td-dof-title ','color','blue');
changecss('.nav-menu h3 a','color','blue');
changecss('#nav li','color','blue');
changecss('#p_p_id_56_INSTANCE_Wkk3_ a','color','blue');
changecss('#p_p_id_101_INSTANCE_nLnN_ a','color','blue');
changecss('#p_p_id_101_INSTANCE_RQmD_ a','color','blue');
changecss('#p_p_id_56_INSTANCE_h2b3_ a','color','blue');
changecss('#p_p_id_56_INSTANCE_K36w_ a','color','blue');
changecss('#nav li a','color','blue');
changecss('#nav li ul li','color','blue');
changecss('#nav li ul li a','color','blue');
changecss('.nav-menu li a.selected','color','blue');
changecss('a:link','color','blue');
changecss('a:visited','color','blue');
changecss('.portlet-title','color','blue');
changecss('body','color','blue');
changecss('a','color','blue');
changecss('#nav a','color','blue');
changecss('a:hover','color','red');
changecss('span','color','blue');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','blue');
}
/*************tukar warna tulisan kepada warna green **********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontGreen(){
changecss('.cms_content','color','green');
changecss('.cms_header','color','green');
changecss('#p_p_id_73_INSTANCE_TFq1_ a','color','green');
changecss('.portlet-boundary.portlet-boundary_73_.portlet-breadcrumb a','color','green');
changecss('#column-2 .td-dof-title ','color','green');
changecss('.nav-menu h3 a','color','green');
changecss('#nav li','color','green');
changecss('#p_p_id_56_INSTANCE_Wkk3_ a','color','green');
changecss('#p_p_id_101_INSTANCE_nLnN_ a','color','green');
changecss('#p_p_id_101_INSTANCE_RQmD_ a','color','green');
changecss('#p_p_id_56_INSTANCE_h2b3_ a','color','green');
changecss('#p_p_id_56_INSTANCE_K36w_ a','color','green');
changecss('#nav li a','color','green');
changecss('#nav li ul li','color','green');
changecss('#nav li ul li a','color','green');
changecss('.portlet-title','color','green');
changecss('body','color','green');
changecss('#nav a','color','green');
changecss('.nav-menu li a.selected','color','green');
changecss('a:link','color','green');
changecss('a:visited','color','green');
changecss('a','color','green');
changecss('a:hover','color','blue');
changecss('span','color','green');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','green');
}
/*************tukar warna tulisan kepada warna orange**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontOrange(){
changecss('.portlet-title','color','orange');
changecss('body','color','orange');
changecss('#nav a','color','orange');
changecss('a','color','orange');
changecss('a:hover','color','blue');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','orange');
}
/*******end accessibility************/
/*******start tab menu************/
function MM_findObj(n, d) { //v4.0
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 && document.getElementById) x=document.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v='hide')?'none':v; }
obj.display=v; }
}
var layers=["echo","sonar","rsw"];
function toggle_layer_2(div_id){
layer = div_id;
for(i=0;i<layers.length;i++){
MM_showHideLayers(layers[i],'','hide')
}
MM_showHideLayers(layer,'','show')
}
function randomDisplay(){
layer=layers[new Date().getTime()%layers.length]
MM_showHideLayers(layer,'','show')
} 
/*******end tab menu************/
/***********************************************
Advertisement footer slider
***********************************************/
var persistclose= 1 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 0 //set x offset of bar in pixels
var startY = 0 //set y offset of bar in pixels
var verticalpos="frombottom" //enter "fromtop" or "frombottom"
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}
function staticbar(){
barheight=document.getElementById("topbar").offsetHeight
var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
var d = document;
function ml(id){
var el=d.getElementById(id);
if (!persistclose || persistclose && get_cookie("remainclosed")=="")
el.style.visibility="visible"
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function(){
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : iecompattest().scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("topbar");
stayTopLeft();
}
if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar