var sIssueDate='062011'; 

function doChangePic(aImagePath,aTd,aColor){
  var img = document.getElementById('idHeadlinePic');
  img.src=aImagePath;
  aTd.style.background=aColor;
}

function changeButtonColor(aObject,aColor){
  aObject.style.cursor='hand';
  aObject.style.background=aColor;
  //aObject.style.border='1px solid #000000';
  //aObject.style.color='#000000';
}

function changeTabColor(aObject){
  aObject.style.cursor='hand';
  aObject.style.background='#F1B426';
  aObject.style.border='1px solid #000000';
  aObject.style.color='#000000';
}

function revertTabColor(aObject,activeButton){
  if(activeButton){
    aObject.style.background='#F1B426';
	aObject.style.border='1px solid #000000';
	aObject.style.color='#000000';
  }else{
    aObject.style.background='#424242';
	aObject.style.border='0px';
	aObject.style.color='#ffffff';
  }
}
function getFooter(){
  document.write('<table width="100%" cellpadding="0" cellspacing="0">'+
	    '<tr><td style="height:20px"></td></tr>'+
	    //'<tr><td width="48%"></td><td style="font-family:arial;font-size:12px;color:#ffffff">COPYRIGHT © 2005  <b>Philippine Business Daily Mirror Publishing, Inc.</b></td></tr>'+
		//'<tr><td></td><td style="font-family:arial;font-size:12px;color:#ffffff">All rights reserved. Read our privacy guidelines. Hosting by web.com.ph</td></tr>'+
		'<tr><td style="height:10px"></td></tr>'+
	  '</table>');  
}
function doRedirect(aPage){
  window.location.href=aPage;
}

function escapeEmail(form,field,value){
  if(!isEmail(value)){
    eval("document." +form+ "." +field+ ".focus();");
	eval("document." +form+ "." +field+ ".value = \"\";");
	return false;
  }
  return true;
}

function isEmail( inputVal ) {
    var atsign = 0;
    var dot = 0;
    inputStr = inputVal.toString();
    for( var i = 0; i < inputStr.length; i++ ) {
        var ch = inputStr.charAt( i );
        if( i == 0 ) {
            if( ( ch == "@" ) || ( ch == "." ) ) {
                //window.alert("Please enter a valid email address.");
                return false;
            }
        }
        if( ch == "@" ) {
            atsign++;
        }
        if( ch == "." ) {
            dot++;
        }
        if( ch == "'" ) {
                //window.alert("Please enter a valid email address.");
               return false;
        }
        if( i == inputStr.length - 1 ) {
            if( ( ch == "@" ) || ( ch == "." ) ) {
                //window.alert("Please enter a valid email address.");
                return false;
            }
        }
    }
    if( ( atsign != 1 ) || ( dot < 1 ) ) {
        //window.alert("Please enter a valid email address.");
	    return false;
    }
    return true;    
}

function isNum(value){
	var newValue = "";
	for(var x=0; x<value.length; x++){
		if(!value.charAt(x).match(/[0-9.]/)){
			//alert("You entered an invalid character for a numeric format ("+value+"). Please validate.");
			//eval("document." +form+ "." +field+ ".focus();");
			//eval("document." +form+ "." +field+ ".value = \"\";");
			return false;
		}
	}
	return true;
}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=400,height=350,left=315,top=310,dependent=yes,scrollbars=yes');
return false;
} 


