/*
Common JavaScript functions to be included accross the site
*/
function changeLanguage(){
	var strLoc = window.location.toString();
	var strAltLoc;
	//replace first instance of /hbc/or /hbcf with the alternate version
	if(strLoc.indexOf("/hbc/")){strAltLoc=strLoc.replace(/hbc/i,"hbcf")}
	else if(strLoc.indexOf("/hbcf/")){strAltLoc=strLoc.replace(/hbcf/i,"hbc")}
	//alert(strAltLoc);
	location.href=strAltLoc;
}
function PlayVideo(size) {
	(size =="lo"? loc = "/hbc/about/strategy/video/play.asp?version=lo":loc = "/hbc/about/strategy/video/play.asp?version=hi")
	vidWin = window.open(loc, 'HbcVideo', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=380,height=500');
}	
function open_Photo(intImageId,intImageVersion,strCurrentLanguage)
{
	var loc ="/hbc/mediacentre/gallery/photo.asp?intImageId="+intImageId+"&intImageVersion="+intImageVersion+"&strCurrentLanguage="+strCurrentLanguage;
	var popleft=((document.body.clientWidth - this.ImagePageWidth) / 2)+window.screenLeft;
	var poptop=(((document.body.clientHeight - this.ImagePageHeight) / 2))+window.screenTop-40;	
	var newWin = window.open(loc,"NewWindow","scrollbars=YES,width=600,height=600,left="+popleft+",top="+poptop+",resizable");
}
function open_Press(squery,strCurrentLanguage) 
{
  var loc = "/"+strCurrentLanguage+"/include/tellafriend.asp?"+squery;
  var popupWin = window.open(loc, "", "width=520,height=410,left=20,top=20");
}