// JavaScript Document
function init() {
if (TransMenu.isSupported()) {
TransMenu.initialize();
//document.getElementById('nav5').onmouseover = function () { ms.hideCurrent() };
}
}
if (TransMenu.isSupported()) {
var ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft);
}
function render() {
if (TransMenu.isSupported()) {
if (document.getElementById("nav1")) {
var menu1 = ms.addMenu(document.getElementById("nav1"));
menu1.addItem('Company Profile', '../aboutus.php?aboutus_id=1');menu1.addItem('Vision, Mission, Values', '../aboutus.php?aboutus_id=2');menu1.addItem('President's Report', '../aboutus.php?aboutus_id=4');menu1.addItem('Board of Directors', '../aboutus.php?aboutus_id=7');menu1.addItem('Management Team', '../aboutus.php?aboutus_id=8'); }
if (document.getElementById("nav2")) {
var menu2 = ms.addMenu(document.getElementById("nav2"));
menu2.addItem('Petroleum Exploration & Production', '../business.php?id=2');var submenu2 = menu2.addMenu(menu2.items[0]);submenu2.addItem('Natural Gas Production', '../business.php?sub=1&id=6');var submenu20 = submenu2.addMenu(submenu2.items[0]);submenu20.addItem('SC 37 - San Antonio Gas Power Plant', '../business.php?main=1&id=4');submenu20.addItem('SC 38 - Malampaya Project', '../business.php?main=1&id=1');submenu2.addItem('Petroleum Exploration & Development', '../business.php?sub=1&id=15');var submenu21 = submenu2.addMenu(submenu2.items[1]);submenu21.addItem('SC 43 Ragay Gulf', '../business.php?main=1&id=3');submenu21.addItem('SC 47 - Offshore Mindoro', '../business.php?main=1&id=6');submenu21.addItem('SC 57 - Calamian', '../business.php?main=1&id=9');submenu21.addItem('SC 58 - West Calamian', '../business.php?main=1&id=10');submenu21.addItem('SC 59 - West Balabac', '../business.php?main=1&id=11');submenu21.addItem('SC 63 - East Sabina', '../business.php?main=1&id=12');submenu21.addItem('CMOL - Camago-Malampaya Oil Leg Project', '../business.php?main=1&id=14');submenu2.addItem('Natural Gas Development Projects', '../business.php?sub=1&id=16');var submenu22 = submenu2.addMenu(submenu2.items[2]);submenu22.addItem('Batman 1 Project', '../business.php?main=1&id=17');submenu22.addItem('Batman 2 Project', '../business.php?main=1&id=18');menu2.addItem('Coal Exploration & Production', '../business.php?id=3');var submenu2 = menu2.addMenu(menu2.items[1]);submenu2.addItem('COC No. 41 - Malangas', '../business.php?sub=1&id=17');submenu2.addItem('COC 122 & 141 - Isabela', '../business.php?sub=1&id=18');submenu2.addItem('COC 140 - Surigao del Sur', '../business.php?sub=1&id=19');submenu2.addItem('Indonesia Coal Project', '../business.php?sub=1&id=20');submenu2.addItem('Coal Marketing & Trading', '../business.php?sub=1&id=21');menu2.addItem('Energy Supply Base', '../business.php?id=6');menu2.addItem('Corporate Social Responsibility', '../business.php?id=1'); }
if (document.getElementById("nav3")) {
var menu3 = ms.addMenu(document.getElementById("nav3"));
menu3.addItem('Structured Reports', '../investor.php?id=5');var submenu3 = menu3.addMenu(menu3.items[0]);submenu3.addItem('Annual Reports', '../investor.php?sub=1&id=5');submenu3.addItem('Quarterly Reports', '../investor.php?sub=1&id=7');submenu3.addItem('Top 100 Stockholders', '../investor.php?sub=1&id=8');submenu3.addItem('Report of No. of Shareholders', '../investor.php?sub=1&id=9');submenu3.addItem('Certificates on Directors Attendance', '../investor.php?sub=1&id=10');submenu3.addItem('Others', '../investor.php?sub=1&id=11');menu3.addItem('Unstructured Reports', '../investor.php?id=7');var submenu3 = menu3.addMenu(menu3.items[1]);submenu3.addItem('Clarification Letters (Unusual price movement of shares)', '../investor.php?sub=1&id=12');submenu3.addItem('Corporate Disclosures', '../investor.php?sub=1&id=14');submenu3.addItem('Press Releases', '../investor.php?sub=1&id=13'); }
TransMenu.renderAll();
}
}
function showf(fid)
{
v = document.getElementById(fid).style.display;
if (v=='none')
{
document.getElementById(fid).style.display = '';
document.getElementById(fid + 'pic' ).src = 'images/b1.gif';
}
else
{
document.getElementById(fid).style.display = 'none'
document.getElementById(fid + 'pic' ).src = 'images/b2.gif';
}
}
function printpage()
{
lk = '&';
url = window.location + '';
surl = url.indexOf('#');
if (surl>0) url = url.substring(0,surl);
//turl = url.substring(url.length-3,url.length);
turl = url.indexOf('?')
if (turl<=0) lk = '?'
nw = window.open(url + lk + 'print=1','','top=0,left=0,width=800,height=600,scrollbars=1');
nw.focus();
}
function filterE(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
return false
}
if (str.indexOf(at,(lat+1))!=-1){
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
return false
}
if (str.indexOf(dot,(lat+2))==-1){
return false
}
if (str.indexOf(" ")!=-1){
return false
}
return true
}
function verifyE(obj)
{
if (filterE(obj.value)==false)
{
document.getElementById('ErrEmail').innerHTML = 'Please enter a valid email address';
obj.style.border = '1px solid red';
obj.focus();
return false;
}
else
{
obj.style.border = '1px solid #b8c1c8';
document.getElementById('ErrEmail').innerHTML = '';
}
return true;
}
function verify(fobj)
{
if (fobj.value=='')
{
fobj.style.border = '1px solid red';
fobj.focus();
return false;
} fobj.style.border = '1px solid #555';
return true;
}
function bgray(obj)
{
obj.style.border = '1px solid gray';
}
function filterR(str)
{
var regexp = /[^0-9-()+]/;
var usname = new String();
usname = str.value;
do
{
nv = usname
usname = usname.replace(regexp,"");
}
while (nv!=usname);
str.value = usname;
return true;
}
// Added elements
function txtSearch(xfind)
{
obj = document.getElementById('content');
var current = new String();
var reg1 = new RegExp('(?!<.*?)('+xfind+')(?![^<>]*?>)','g');
var reg2 = new RegExp('(?!<.*?)('+xfind.toLowerCase()+')(?![^<>]*?>)','g');
var reg3 = new RegExp('(?!<.*?)('+xfind.toUpperCase()+')(?![^<>]*?>)','g');
current = obj.innerHTML;
current = current.replace(reg1,''+xfind+'');
current = current.replace(reg2,''+xfind.toLowerCase()+'');
current = current.replace(reg3,''+xfind.toUpperCase()+'');
obj.innerHTML = current;
}
function x(obj)
{
obj.className = '';
}
function listDays(m,sd)
{
ndays="Day "
obj = document.getElementById("sday");
obj.innerHTML = ndays;
}
var ef;
var cn;
function news(id,e){
var url = 'news.post';
if (e) url = 'events.post';
var pars = 'id='+id;
var target = '';
var myAjax = new Ajax.Updater(target, url, {method: 'post', onComplete: showNews, parameters: pars});
$('news').style.display = 'none';
ef = new Effect.Appear('load',{duration:0.3, queue: 'end'});
cn = id;
}
function showNews(req)
{
rk = req.responseText;
$('newsitem').innerHTML = rk;
setTimeout('slideNews()','1000');
}
function slideNews()
{
ef = new Effect.Fade('load',{duration:0.3, queue: 'end'});
ef = new Effect.Appear('news',{duration:1.0, queue: 'end'});
ef = new Effect.ScrollTo('news',{duration:1.0, queue: 'end'});
}
function getNews(e)
{
var url = new String();
url = '' + window.location;
arr = url.split('#');
if (arr[1]&&arr[1]!=cn)
{
news(arr[1],e);
}
if(!arr[1]&&cn!=dn) news(dn,e);
setTimeout('getNews(e)',1000);
}
function showMain()
{
new Effect.Appear('mainpic',{duration:1.0, queue: 'end'});
}