var submenu2stat = '';

//change color ****************************************************************
function ccolor(nm,clr) {
	document.all[nm].style.color = clr;
}

//show layer ****************************************************************
function show(name) {
	document.all[name].style.visibility = 'visible';
}

//hide layer ****************************************************************
function hide(name) {
	document.all[name].style.visibility = 'hidden';
}

//create topbar ****************************************************************
function topbar() {
	topbartable = '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td height="70" background="images/771x70_BG.jpg">&nbsp;</td></tr><tr><td height="23" bgcolor="#f3f4f8">&nbsp;</td></tr><tr><td height="20">&nbsp;</td></tr><tr><td height="20">&nbsp;</td></tr></table>'
	document.write(topbartable)
}

//create footer ****************************************************************
//function footnote() {
//	disclaimer = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="54" colspan="7">&nbsp;</td></tr><tr><td width="171">&nbsp;</td><td width="441"><p class="Footnote">&copy; 2008 Manabat Sanagustin & Co., certified public accountants, a professional partnership established under Philippine law, is a member firm of the KPMG network of independent member firms affiliated with KPMG International, a Swiss cooperative.<br>All rights reserved.</p><p class="footnote"><a href="javascript:window.open(\'http://www.kpmg.com/onlinedisclaimer.html\',\'\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=500,screenX=0,screenY=0,left=100,top=100\');void(\'\');">KPMG Online Privacy Statement and Disclaimer</a></p></td><td width="159">&nbsp;</td><td>&nbsp;</td></tr></table>'
//	document.write(disclaimer)
//}


//function footnote() {
//	disclaimer = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="54" colspan="7">&nbsp;</td></tr><tr><td width="171">&nbsp;</td><td width="441"><p class="footnote">&copy; 2010 Manabat Sanagustin & Co., CPAs, a Philippine partnership and a member firm of the KPMG network of independent member firms affiliated with KPMG International, a Swiss cooperative. All rights reserved.</p><p><a href="javascript:window.open(\'http://www.kpmg.com/Global/pages/onlinedisclaimer.aspx\',\'\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=500,screenX=0,screenY=0,left=100,top=100\');void(\'\');">Legal</a>&nbsp;|&nbsp;<a href="javascript:window.open(\'http://www.kpmg.com/Global/pages/privacy.aspx\',\'\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=500,screenX=0,screenY=0,left=100,top=100\');void(\'\');">Privacy</a></p></td><td width="159">&nbsp;</td><td>&nbsp;</td></tr></table>'
//	document.write(disclaimer)
//}

function footnote() {
	disclaimer = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="54" colspan="7">&nbsp;</td></tr><tr><td width="171">&nbsp;</td><td width="441"><p class="footnote">&copy; 2010 Manabat Sanagustin & Co., CPAs, a Philippine partnership and a member firm of the KPMG network of independent member firms affiliated with KPMG International, a Swiss cooperative. All rights reserved.</p><p><a href="javascript:window.open(\' http://www.kpmg.com/OnlineDisclaimer.html\',\'\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=500,screenX=0,screenY=0,left=100,top=100\');void(\'\');">Privacy & Disclaimer</a></p></td><td width="159">&nbsp;</td><td>&nbsp;</td></tr></table>'
	document.write(disclaimer)
}




//create layers function ****************************************************************
function createLay(idname,z,l,t,w,h,bi,bc,v,content) {
	if (v) {
		vis = 'visible';
	} else {
		vis = 'hidden';
	}

	layerStr = '<div id="'+idname+'" style="POSITION: absolute; z-index:'+z+'; left: '+l+'; top: '+t+';'

	if (w != 0) {
		layerStr = layerStr + ' width: '+w+'px;'
	}
	if (h != 0) {
		layerStr = layerStr + ' height: '+h+'px;'
	}
	if (bi != '') {
		layerStr = layerStr + ' background-image: url(images/'+b+'); layer-background-image: url(images/'+b+');'
	}
	if (bc != '') {
		layerStr = layerStr + ' background-color: #'+bc+'; layer-background-color: #'+bc+';'
	}

	layerStr = layerStr + ' border: 1px none #000000; visibility: '+vis+';">'+content+'</div>'

	document.write(layerStr)
}

//change submenus page status ****************************************************************
function submenustatus() {
	if ('submenu101' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu102' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu103' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu104' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu105' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu106' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu107' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu201' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
	if ('submenu202' == 'submenu'+pageid) {document.all['submenu'+pageid].style.color='#FA9A00';}
}

//change submenu2 onclick status ****************************************************************
function submenu2clk(layerid) {

if (layerid != submenu2stat)
{
	if('contactus' == layerid)
	{
		ccolor('submenu203','#FA9A00');
		ccolor('submenu204','#00349c');
		show('contactus');
		hide('countryselector');
		submenu2stat = layerid;
	}
	if('countryselector' == layerid)
	{
		ccolor('submenu203','#00349c');
		ccolor('submenu204','#FA9A00');
		hide('contactus');
		show('countryselector');
		submenu2stat = layerid;
	}
}
else if (layerid == submenu2stat)
{
	if('contactus' == layerid)
	{
		ccolor('submenu203','#00349c');
		ccolor('submenu204','#00349c');
		hide('contactus');
		hide('countryselector');
		submenu2stat = '';
	}
	if('countryselector' == layerid)
	{
		ccolor('submenu203','#00349c');
		ccolor('submenu204','#00349c');
		hide('contactus');
		hide('countryselector');
		submenu2stat = '';
	}
}
}

//country selector ****************************************************************
function jumpURL() {	
	target = document.forms['jumpCountry'].elements[0].selectedIndex;
	document.location.href = document.forms['jumpCountry'].elements[0].options[target].value;
}

//Clear window status ****************************************************************
function over(value) {
	if (value == 0) {
		window.status = " ";
		return true
	}
	else {
		window.status = value;
		return true
	}
}

//e-mail validation ****************************************************************
function formContactUs(send) {
	if (send) {
		if (document.forms['ContactUs'].elements['email'].value == '') {
			alert('Please enter your email address');
		}
		else if (document.forms['ContactUs'].elements['email'].value != '' &&  
				 (document.forms['ContactUs'].elements['email'].value.indexOf('@') == -1 ||
					document.forms['ContactUs'].elements['email'].value.indexOf('.') == -1)) {
						alert('Your email address is invalid'); 		
		}	
		else if (document.forms['ContactUs'].elements['topic'].value == '-1') {
			alert ('Please select a "Sub Topic"');
		}					
		else if (document.forms['ContactUs'].elements['questioncomment'].value == '') {
			alert ('Please enter your "Question / Comment"');
		}					
		else if (document.forms['ContactUs'].elements['contactname'].value == '') {
			alert ('Please enter your "Contact Name"');
		}					
		else {
			document.forms['ContactUs'].submit();
		}
	} 
	else {
		document.forms['ContactUs'].reset();
	}
}

//create left menu corner bar ****************************************************************
function lmenucornerbar() {
	cornerbar = '<p class="MenuCorner" style="top:133px;"></p>'
	document.write(cornerbar)
}

//create main table ****************************************************************
function maintable() {
	maintableStr = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td id="leftmenu" width="171" rowspan="2">&nbsp;</td><td id="breadcrumtrail" colspan="3" class="BreadcrumbTrail">&nbsp;</td><td width="6">&nbsp;</td><td>&nbsp;</td></tr><tr><td id="main" width="441">&nbsp;</td><td width="20">&nbsp;</td><td id="rightmenu" width="133">&nbsp;</td><td width="6">&nbsp;</td><td>&nbsp;</td></tr></table>'
	document.write(maintableStr)
}

//create right table ****************************************************************
function rightbl(content) {
	rightblstr = '<table width="133" border="0" cellpadding="0" cellspacing="0" class="MenuBracketLeft"><tr><td>'+content+'</td></tr></table><br>'
	document.write(rightblstr)
}


function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) 
		field.value = field.value.substring(0, maxlimit);
	else 
		countfield.value = maxlimit - field.value.length;
}

function ploc(site)
{
	parent.location = site
}