// General javascript utilities

function budMaf(){
    var docTitle = document.title;
    var forLoc = "/forward/index.php";
    var forURL = forLoc + "?title=" + docTitle +"&section=careers";
    sPop(forURL, "forward", 580, 560);
    return;
}

function budMafNews(){
    //var docTitle = document.title;
    //var forLoc = "/bgl group/forward/index.php";
    //var forURL = forLoc + "?title=" + docTitle +"&section=news";
		forURL = 'about:blank';
    sPop(forURL, "forward", 580, 560);
    return;
}
function FixReferer() {	
	var atags = document.getElementsByTagName('a');
	for(var i=0;i<atags.length;i++) 
		if(atags[i].href=='javascript:budMafNews();') { 
			atags[i].href = '/forward/index.php?title=' + document.title + '&section=news';
			atags[i].target = 'forward';
			atags[i].onclick = budMafNews;
			break;
		}
}
function addLoadEvent(func){var oldonload=window.onload;if (typeof window.onload !='function'){    	window.onload=func;} else{window.onload=function(){oldonload();func();}}}
//added to load on swapcss.js

function roll(imageName, imageSrc){
  document[imageName].src=imageSrc;
}

function pop(url, name){
  newWindow = window.open(url, name);
  if (window.focus) {newWindow.focus()};
}

function sPop(url, name, width, height){
    newWindow = window.open(url, name, 'width=' + width + ',height=' + height + ',menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes');
    if (window.focus) {newWindow.focus()};
}

function addSiteToFavourites(theName, theUrl){
  if (window.external && (!document.createTextNode || (typeof(window.external.AddFavorite)=='unknown'))){
    window.external.AddFavorite(theUrl, theName);
  } else if (window.sidebar) {
    window.sidebar.addPanel(theName, theUrl,"");
  }
}

function addPageToFavourites(){
	var theURL = document.URL;
	var theName = document.title;
	if (window.external && (!document.createTextNode || (typeof(window.external.AddFavorite)=='unknown'))){
    window.external.AddFavorite(theURL, theName);
  } else if (window.sidebar) {
    window.sidebar.addPanel(theName, theURL,"");
  }
}


function setTextSize(newSize){
	document.body.style.fontSize = newSize;
	return;
}

function open_win(url_add){
   window.open(url_add,'welcome','width=580,height=560,menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes');
   }