﻿

function OpenPopupWindow(sUrl, sName, sProperties, iWidth, iHeight, iMoveX, iMoveY){
	var iX, iY;
	
	iX = iMoveX;
	if(iMoveX == 'left')
		iX = 0
	if(iMoveX == 'middle')
		iX = (screen.width / 2) - (iWidth / 2)
	if(iMoveX == 'right')
		iX = screen.width - iWidth - 10;
		
	iY = iMoveY;	
	if(iMoveY == 'top')
		iY = 0;
	if(iMoveY == 'middle')
		iY = ((screen.height - 56) / 2) - (iHeight / 2);
	if(iMoveY == 'bottom')
		iY = screen.height - 56 - iHeight;

	sProperties += ',width=' + iWidth + ',height=' + iHeight + ',screenX=' + iX + ', screenY=' + iY + ',left=' + iX + ',top=' + iY;
	window.open(sUrl, sName, sProperties);
}


function magnifyPhoto(photoName)
{
 htmlString = ''
 +'<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">'
 +'<img src="images/awards/awards/' + photoName + '" width="1000">'
 +'<br>'
 +'<table width="100%" cellspacing="0" cellpadding="3" border="0">'
 +'<tr>'
 +'<td><strong>PC</strong>: Right click on image to download<br>'
 +'<strong>Mac</strong>: Control+click on image to downlaod</td>'
 +'<td align="right"><A href="JavaScript:self.close();"><img src="http://www.euroweek.com/images/closewindow.gif" border="0" width="150" height="20"></a></td>'
 +'</tr>'
 +'</table>'
 +'</body>';
 
 magnifyWindow = window.open("", "aWIN", "width=1000 height=720");
 magnifyWindow.document.write(htmlString);
}

function invoiceAlert(oRadio) {
    alert('You will not have access to the site until the invoice is paid.\n\nIf you require instant access you should select the pay by credit card option.');
}

function showSecurityCode() {
	var newWindow3
	if (typeof(newWindow3) == 'object') {
		if (!newWindow2.closed) {
			newWindow3.close();
			newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
		} else {
			newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
		}
	} else {
		newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
	}
}
var iClickCOunt = 0;
function checkPageLoad() {
	if(document.getElementById("__EVENTVALIDATION")==null){
		iClickCOunt += 1;
		
		if(iClickCOunt >= 5) 
			if(confirm('This page has not fully loaded.\n\nClick OK to reload.'))
				location.reload(true);
				
		return false;
	}
		
    return true;
} 

//this function is to enable the default click button when you are within a text box e.g. search box
//to use this function do the following in the code behind:
//TextBox1.Attributes.Add("onkeypress", "return clickButton(event,'" + Button1.ClientID + "')")
//NS 19th May 2009
function clickButton(e, buttonid){ 
      var evt = e ? e : window.event;
      var bt = document.getElementById(buttonid);
      if (bt){ 
          if (evt.keyCode == 13){ 
                bt.click(); 
                return false; 
          } 
      } 
}