/*********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('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','font-size','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('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','font-size','font-size',fontSize);
}
}
/**********kembalikan warna asal
function revertStyles(){
changecss('.portlet-title','color','white');
changecss('#nav a','color','#ffffff');
changecss('body','color','black');
changecss('a','color','#5078AA');
changecss('a:hover','color','#7EACD6');
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 dan warna kepada asal************/
function revertFontStyles(id){
var size = document.getElementById(id).style.fontSize;
if(size == "" || size == null) {
size = 12; 
} else {
size = size.substr(0,2);
} 
if(size > 10) {
if(size == 16) {
size = 12;
} else {
size = 12;
}
var fontSize = size + "px";
document.getElementById(id).style.fontSize=fontSize
}
changecss('body,#nav li a, 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','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','color','');
changecss('a:hover','color','#7EACD6');
changecss('input[type="text"], input[type="password"], input[type="file"],input[type="submit"], input[type="button"], input[type="reset"], select, textarea, .textarea','color','black');
}
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('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','color','red');
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','red');
}
/*************tukar warna tulisan kepada warna biru**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontBlue(){
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','color','blue');
changecss('a:hover','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','blue');
}
/*************tukar warna tulisan kepada warna green **********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontGreen(){
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','color','green');
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','green');
}
/*************tukar warna tulisan kepada warna orange**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontOrange(){
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','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************/
/****************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
/***********************************************
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		
// <<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*******************