// lightbox photo gallery jQuery(document).ready(function(){jQuery(".lightbox").lightbox();});function mainmenu(){jQuery("#nav li").hover(function(){jQuery(this).find('ul:first:hidden').css({visibility: "visible",display: "none"}).fadeIn(200);},function(){jQuery(this).find('ul:first').fadeOut(200);});} 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() {}); var min=8;var max=18;function increaseFontSize() {   var p = document.getElementsByTagName('p');   for(i=0;i<p.length;i++) {      if(p[i].style.fontSize) {         var s = parseInt(p[i].style.fontSize.replace("px",""));      } else {         var s = 12;      }      if(s!=max) {         s += 1;      }      p[i].style.fontSize = s+"px"   }}function decreaseFontSize() {   var p = document.getElementsByTagName('p');   for(i=0;i<p.length;i++) {      if(p[i].style.fontSize) {         var s = parseInt(p[i].style.fontSize.replace("px",""));      } else {         var s = 12;      }      if(s!=min) {         s -= 1;      }      p[i].style.fontSize = s+"px"   }   }function show_page(page_no, total_pages) {//alert (page_no)for (var i=0; i<= total_pages; i++) {var page_id = 'page'+i;var link_id = 'link_' + i;if (i == page_no) {show_object1 (page_id);hilite_link (link_id)} else {hide_object ('page'+i);dim_link (link_id)}}}function show_page1(page_no, total_pages) {//alert (page_no)for (var i=0; i<= total_pages; i++) {var page_id = 'second_page'+i;var link_id = 'second_link_' + i;if (i == page_no) {show_object1 (page_id);hilite_link (link_id)} else {hide_object ('second_page'+i);dim_link (link_id)}}}function get_object (id) {return document.getElementById(id);		}function hide_object (id) {get_object(id).className = 'hidden';}function show_object1 (id) {get_object(id).className = 'display_block';}function show_object2 (id) {get_object(id).style.display = 'display_inline';}function hilite_link (id) {get_object (id).style.color = 'red';}function dim_link (id) {get_object (id).style.color = 'blue';}/*********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;}var size;var defaultFontSize = 11;var currentFontSize = size;	var Color;var defaultColor = 'black';var currentColor = Color;	var prefsLoaded = false;/*start setFontPlus*/function setFontPlus(id){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('.journal-content-article','font-size',fontSize);changecss('.content_font','font-size',fontSize);changecss('.title2_font','font-size',fontSize);changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, div#date_info, div#hijri_date_info, div#location, div#solat_info, .lala, .shadetabs','font-size',fontSize);}}// end setFontPlus/*start setfontminus*/function setFontMinus(id){size = document.getElementById(id).style.fontSize;if(size == "" || size == null) {size = 11; } else {size = size.substr(0,2);} if(size > 11) {if(size == 17) {size = eval(size) - 2;} else {size = eval(size) - 1;}var fontSize = size + "px";document.getElementById(id).style.fontSize=fontSizechangecss('.content_font','font-size',fontSize);changecss('.title2_font','font-size',fontSize);	changecss('#nav li a','font-size',fontSize);changecss('.portlet-title','font-size',fontSize);changecss('.journal-content-article','font-size',fontSize);changecss('#portlet-wrapper-56_INSTANCE_xaD8 .portlet-title,#portlet-wrapper-56_INSTANCE_ZDcF .portlet-title,#portlet-wrapper-56_INSTANCE_6cyX .portlet-title','font-size',fontSize);changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, div#date_info, div#hijri_date_info, div#location, div#solat_info, .lala, .shadetabs','font-size',fontSize);}}//end of font minus/********kembalikan saiz huruf kepada asal************/function revertFontStyles(id){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','11px');changecss('#portlet-wrapper-56_INSTANCE_xaD8 .portlet-title,#portlet-wrapper-56_INSTANCE_ZDcF .portlet-title,#portlet-wrapper-56_INSTANCE_6cyX .portlet-title','font-size','11px');changecss('#nav li a','font-size','11px');changecss('.journal-content-article','font-size','11px;');changecss('.content_font','font-size','11px;');changecss('.title2_font','font-size','11px;');changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, div#date_info, div#hijri_date_info, div#location, div#solat_info, .lala, .shadetabs','font-size','11px');}//end of new function size added on dec 7 2009function createCookie(name,value,days) {  if (days) {    var date = new Date();    date.setTime(date.getTime()+(days*24*60*60*1000));    var expires = "; expires="+date.toGMTString();  }  else expires = "";  document.cookie = name+"="+value+expires+"; path=/";};//start new functionfunction readCookie(name) {  var nameEQ = name + "=";  var ca = document.cookie.split(';');  for(var i=0;i < ca.length;i++) {    var c = ca[i];    while (c.charAt(0)==' ') c = c.substring(1,c.length);    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);  }  return null;};function setUserOptions(){if(!prefsLoaded){cookie = readCookie("fontSize");size = cookie ? cookie : 11;setFontSize(size);cookieColor = readCookie("color");Color = cookieColor ? cookieColor : 'black';if(Color=='red'){fontRed()}else if(Color=='blue'){fontBlue()}else if(Color=='green'){fontGreen()}else if(Color=='orange') {fontOrange()}else{//revertStyles()}//setFontSize(size);prefsLoaded = true;}}//window.onload = setUserOptions;window.onunload = saveSettings;function saveSettings(){createCookie("color", Color, 365);  createCookie("fontSize", size, 365); }function setFontSize(fontSize){document.getElementById('wrapper').style.fontSize = fontSize + 'px';//alert (document.body.style.fontSize);};//end of new function added on Dec 7 2009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try{ 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+';'); } } }}catch(err){// alert(err.description);}}// end function changecss//**********accordion*************ddaccordion.init({headerclass: "silverheader", //Shared CSS class name of headers groupcontentclass: "submenu", //Shared CSS class name of contents grouprevealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseovercollapseprev: true, //Collapse previous content (so only one open at any time)? true/falsedefaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no contentonemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)animatedefault: true, //Should contents open by default be animated into view?persiststate: true, //persist state of opened contents within browser session?toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"oninit:function(headers, expandedindices){ //custom code to run when headers have initalized//do nothing},onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed//do nothing}})//hok asal
/**********kembalikan warna asal*************/function revertStyles(){//Color='';changecss('.portlet-title','color','white');//revertFontStyles(id);changecss('#nav a','color','#ffffff');changecss('body','color','black');changecss('a','color','');changecss('a:hover','color','');changecss('.box_tajuk','color','white');changecss('#main-content .portlet-title','color','white');changecss('.shadetabs li a.selected','color','white');changecss('.shadetabs li a,.shadetabs li a:visited','color','white');changecss('#barleft .portlet-title,#perkhidmatan .portlet-title,#content-middle .portlet-title','color','white');changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','black');}/*************tukar warna tulisan kepada warna merah**********//****changecss('<nama class@ id>','<element>','<value>');*************/function fontRed(){Color='red';changecss('body','color',Color);changecss('a','color',Color);changecss('#nav a','color',Color);changecss('a:hover','color',Color);changecss('.box_tajuk','color',Color);changecss('#main-content .portlet-title','color',Color);changecss('.shadetabs li a.selected','color',Color);changecss('.shadetabs li a,.shadetabs li a:visited','color',Color);changecss('#barleft .portlet-title,#perkhidmatan .portlet-title,#content-middle .portlet-title','color',Color);changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color',Color);}/*************tukar warna tulisan kepada warna biru**********//****changecss('<nama class@ id>','<element>','<value>');*************/function fontBlue(){Color='blue';changecss('.portlet-title','color',Color);changecss('body','color',Color);changecss('a','color',Color);changecss('#nav a','color',Color);changecss('a:hover','color',Color);changecss('.box_tajuk','color',Color);changecss('#main-content .portlet-title','color',Color);changecss('.shadetabs li a.selected','color',Color);changecss('.shadetabs li a,.shadetabs li a:visited','color',Color);changecss('#barleft .portlet-title,#perkhidmatan .portlet-title,#content-middle .portlet-title','color',Color);changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color',Color);}/*************tukar warna tulisan kepada warna green **********//****changecss('<nama class@ id>','<element>','<value>');*************/function fontGreen(){Color='green';changecss('.portlet-title','color',Color);changecss('body','color',Color);changecss('#nav a','color',Color);changecss('a','color',Color);changecss('a:hover','color',Color);changecss('.box_tajuk','color',Color);changecss('#main-content .portlet-title','color',Color);changecss('.shadetabs li a.selected','color',Color);changecss('.shadetabs li a,.shadetabs li a:visited','color',Color);changecss('#barleft .portlet-title,#perkhidmatan .portlet-title,#content-middle .portlet-title','color',Color);changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color',Color);}/*************tukar warna tulisan kepada warna orange**********//****changecss('<nama class@ id>','<element>','<value>');*************/function fontOrange(){Color='orange';changecss('.portlet-title','color',Color);changecss('body','color',Color);changecss('#nav a','color',Color);changecss('a','color',Color);changecss('a:hover','color',Color);changecss('.box_tajuk','color',Color);changecss('#main-content .portlet-title','color',Color);changecss('.shadetabs li a.selected','color',Color);changecss('.shadetabs li a,.shadetabs li a:visited','color',Color);changecss('#barleft .portlet-title,#perkhidmatan .portlet-title,#content-middle .portlet-title','color',Color);changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color',Color);}/*******end accessibility************//****************datetime***************/function getthedate(){var mydate=new Date()var year=mydate.getYear()if (year < 1000)year+=1900var day=mydate.getDay()var month=mydate.getMonth()var daym=mydate.getDate()if (daym<10)daym="0"+daymvar hours=mydate.getHours()var minutes=mydate.getMinutes()var seconds=mydate.getSeconds()var dn="AM"if (hours>=12)dn="PM"if (hours>12){hours=hours-12}{ d = new Date(); Time24H = new Date(); Time24H.setTime(d.getTime() + (d.getTimezoneOffset()*60000) + 3600000); InternetTime = Math.round((Time24H.getHours()*60+Time24H.getMinutes()) / 1.44); if (InternetTime < 10) InternetTime = '00'+InternetTime; else if (InternetTime < 100) InternetTime = '0'+InternetTime;}if (hours==0)hours=12if (minutes<=9)minutes="0"+minutesif (seconds<=9)seconds="0"+seconds//change font size herevar cdate=dayarray[day]+", "+daym+" "+montharray[month]+" "+year+"  "+hours+":"+minutes+" "+dnif (document.all)document.all.clock.innerHTML=cdateelse if (document.getElementById)document.getElementById("clock").innerHTML=cdateelsedocument.write(cdate)}if (!document.all&&!document.getElementById)getthedate()function goforit(){if (document.all||document.getElementById)setInterval("getthedate()",1000)}window.onload=goforit/****************end datetime***************/// <<vozme>>*********text to speech**********function create_form(d,txt,lang,gn,tgt){fx_2g=d.createElement('form');d.body.appendChild(fx_2g);fx_2g.target=tgt;fx_2g.method='POST';fx_2g.action='http://vozme.com/text2voice.php';//textt=d.createElement('input');t.name='text';t.type='hidden';t.value=txt;fx_2g.appendChild(t);//langl=d.createElement('input');l.name='lang';l.type='hidden';l.value=lang;fx_2g.appendChild(l);//gng=d.createElement('input');g.name='gn';g.type='hidden';g.value=gn;fx_2g.appendChild(g);//interfacei=d.createElement('input');i.name='interface';i.type='hidden';i.value='full';fx_2g.appendChild(i);//submitwindow.open('', tgt, 'width=500,height=300,scrollbars=no,location=no,menubar=no,resizable=no,status=no,toolbar=no'); fx_2g.submit();delete fx_2g;return false;}function get_selection(){var lang = arguments[0] || '';var gn = arguments[1] || '';var tgt='voice_'+parseInt(Math.random()*100000);var d=window.document;if(window.getSelection){ txt=window.getSelection();} else if(d.getSelection){ txt=d.getSelection();} else if(d.selection){ txt=d.selection.createRange().text;} else{ txt='';}create_form(d,txt,lang,gn,tgt);return false;}function get_id(id){var lang = arguments[1] || '';var gn = arguments[2] || '';var tgt= arguments[3] || 'voice_'+parseInt(Math.random()*100000);var d=window.document;var txt='';txt=d.getElementById(id).innerHTML;create_form(d,txt,lang,gn,tgt);return false;}function get_blogger(id){var lang = arguments[1] || '';var gn = arguments[2] || '';var tgt='voice_'+parseInt(Math.random()*100000);var d=window.document;var txt='';pN=d.getElementsByName(id)[0].parentNode;for(n=0;n<pN.childNodes.length;n++){    if(pN.childNodes[n].className == 'post-title entry-title' || pN.childNodes[n].className == 'post-title' || pN.childNodes[n].className == 'post-body entry-content' || pN.childNodes[n].className == 'post-body'){        txt=txt + ' ' + pN.childNodes[n].innerHTML;    }}create_form(d,txt,lang,gn,tgt);return false;}//***********end vozme*******************