function mainmenu(){
jQuery(" #nav li").hover(function(){
jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
},function(){
jQuery(this).find('ul:first').fadeOut(300);
});
}
 
jQuery(document).ready(function(){					
mainmenu();
});
jQuery(document).ready(function() {
jQuery('.eco-dev').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.eco-data').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.eco-research').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
jQuery(document).ready(function() {
jQuery('.publications').append('<span class="hover"></span>').each(function () {
  var $span = jQuery('> span.hover', this).css('opacity', 0);
  jQuery(this).hover(function () {
    $span.stop().fadeTo(500, 1);
  }, function () {
    $span.stop().fadeTo(500, 0);
  });
});
});
/* jQuery(document).ready(function(){
jQuery(".accordion h3:first").addClass("active");
jQuery(".accordion p:not(:first)").hide();
jQuery(".accordion h3").click(function(){
jQuery(this).next("p").slideDown("slow")
.siblings("p:visible").slideUp("slow");
jQuery(this).toggleClass("active");
jQuery(this).siblings("h3").removeClass("active");
});
}); */
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;
}
var size;
var defaultFontSize = 11;
var currentFontSize = size;
var Color;
var defaultColor = 'black';
var currentColor = Color;
var prefsLoaded = false;
/*********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('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','font-size',fontSize);
changecss('p','font-size',fontSize);
changecss('span','font-size',fontSize);
changecss('div#p_p_id_59_INSTANCE_x3NE_','font-size',fontSize);
changecss('strong','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('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','font-size',fontSize);
changecss('p','font-size',fontSize);
changecss('span','font-size',fontSize);
changecss('div#p_p_id_59_INSTANCE_x3NE_','font-size',fontSize);
changecss('strong','font-size',fontSize);
}
}
/********kembalikan saiz huruf dan warna 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('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','font-size','11px');
changecss('p','font-size',fontSize);
changecss('span','font-size',fontSize);
changecss('div#p_p_id_59_INSTANCE_x3NE_','font-size',fontSize);
changecss('strong','font-size',fontSize);
}
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
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=/";
};
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;
};
//setuseroption func
function setUserOptions(){
if(!prefsLoaded){
cookie = readCookie("fontSize");
size = cookie ? cookie : 12;
setFontSize(size);
cookieColor = readCookie("color");
Color = cookieColor ? cookieColor : 'black';
if(Color=='red'){
fontRed()
}
else if(Color=='blue')
{
fontBlue()
}
else if(Color=='green'){
fontGreen()}
else{
//revertStyles()
}
prefsLoaded = true;
}
}
//end func.
window.onunload = saveSettings;
function saveSettings()
{
 createCookie("color", Color, 365);
 createCookie("fontSize", size, 365);
}
function setFontSize(fontSize){
document.getElementById('wrapper').style.fontSize = fontSize + 'px';
};
/*************tukar warna tulisan kepada warna merah**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontRed(){
Color='red';
changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','color',Color);
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',Color);
changecss('p','color',Color);
changecss('span','color',Color);
changecss('div#p_p_id_59_INSTANCE_x3NE_','color',Color);
changecss('strong','color',Color);
}
/*************tukar warna tulisan kepada warna biru**********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontBlue(){
Color='blue';
changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','color',Color);
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',Color);
changecss('p','color',Color);
changecss('span','color',Color);
changecss('div#p_p_id_59_INSTANCE_x3NE_','color',Color);
changecss('strong','color',Color);
}
/*************tukar warna tulisan kepada warna green **********/
/****changecss('<nama class@ id>','<element>','<value>');*************/
function fontGreen(){
Color='green';
changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa a, div#date_info, div#hijri_date_info, div#location, div#solat_info','color',Color);
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',Color);
changecss('p','color',Color);
changecss('span','color',Color);
changecss('div#p_p_id_59_INSTANCE_x3NE_','color',Color);
changecss('strong','color',Color);
}
/*************tukar warna tulisan kepada warna orange**********/
/**********kembalikan warna asal*************/
function revertStyles(id){
Color='';
revertFontStyles(id);
changecss('body, a, #nav a, .portlet-title, #nav li ul li, #nav li ul li a, .bottommenu, #bahasa 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');
changecss('p','color','#000000');
changecss('span','color','#000000');
changecss('div#p_p_id_59_INSTANCE_x3NE_','color','#000000');
changecss('strong','color','#000000');
}
/*******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
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=600,height=370,scrollbars=yes,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes');
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 of vozme
