function foff() {
var newURL;
var gotoURL;
var oldPage;
	  
	newURL = location.href;
	
    // find the start of the page name
         
    r = newURL.search('.nb.ca');
    // add 5 to encompass .net/
    r = r + 7;
    y = newURL.search('.asp') + 4;
    // now i know where to begin the replacement.
    
    // get the first part of the new url
    startURL = newURL.substring(r,0);
    gotoURL = newURL.substring(r,y);
    gotoURL = gotoURL.substring(1,gotoURL.length);
    gotoURL = startURL + gotoURL;

	if (newURL.search('fpublications_view.asp') > 0 ) {
		gotoURL = 'http://www.officiallanguages.nb.ca/publications.asp';
	}
	
	if (newURL.search('fnewsroom_view.asp') > 0 ) {
		gotoURL = 'http://www.officiallanguages.nb.ca/newsroom.asp';
	}
	    
    //alert (gotoURL);
	document.location.href=gotoURL; 

}


function poip() {
var newURL;
var gotoURL;
var oldPage;
	  
	newURL = location.href;
	
    // find the start of the page name
         
    r = newURL.search('.nb.ca');
    // add 5 to encompass .net/
    r = r + 7;
    y = newURL.search('.asp') + 4;
    // now i know where to begin the replacement.
    
    // get the first part of the new url
    startURL = newURL.substring(r,0);
    gotoURL = newURL.substring(r,y);
    gotoURL = startURL + 'f' + gotoURL;

	if (newURL.search('publications_view.asp') > 0 ) {
		gotoURL = 'http://www.officiallanguages.nb.ca/fpublications.asp';
	}

	if (newURL.search('newsroom_view.asp') > 0 ) {
		gotoURL = 'http://www.officiallanguages.nb.ca/fnewsroom.asp';
	}
	     
    //alert (gotoURL);
    document.location.href=gotoURL;

}
