
function openAppWin(URL, name){
var wid = ((screen.width - 850) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 850 + ",height=" + hig); 
} 

function openSkipton(){
var wid = ((screen.width - 800) / 2);
var hig = (screen.height - 100); 
window.open("https://secure.skipton.co.uk/ejaws/jadehttp.dll?EInvestments&_funder=SBS","top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 800 + ",height=" + hig); 
} 

function openConWin(URL, name){
var wid = ((screen.width - 1100) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 1100 + ",height=" + hig); 
} 

function openIllWin(URL, name){
var wid = ((screen.width - 850) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 850 + ",height=" + hig); 
} 

function openCallbackWin(URL, name){
var wid = ((screen.width - 850) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 850 + ",height=" + hig); 
} 

function openConverterWin(URL, name){
var wid = ((screen.width - 850) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 850 + ",height=" + hig); 
} 

function openOLAWin(URL, name){
var wid = ((screen.width - 1000) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 1000 + ",height=" + hig); 
}

function openPopUp(URL, name){
var wid = ((screen.width - 450) / 2);
var hig = ((screen.height - 450) / 2);
aWindow=window.open(URL,name,"top=" + hig + ",left=" + wid + ",resizable=no,scrollbars=yes,status=no"+ ",width=450" + ",height=450");
}

function openSurvey(URL, name){
var wid = ((screen.width - 5) / 2);
var hig = ((screen.height - 5) / 2); 
var scrwidth = ((screen.width - 100));
var scrheight = ((screen.height - 100));
window.open(URL,name,"top=5,left=5" + ",resizable=yes,scrollbars=yes,status=no"+ ",width=scrwidth" + ",height=scrheight "); 
}

function openGoogleMap(URL, name){
var wid = ((screen.width - 1000) / 2);
var hig = (screen.height - 100); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=yes,scrollbars=yes,status=yes"+ ",width=" + 1000 + ",height=" + hig); 
} 

function openSkiptonWin(URL, name){
var wid = ((screen.width - 750) / 2);
var hig = (screen.height - 600); 
window.open(URL,name,"top=0,left=" + wid + ",resizable=no,scrollbars=yes,status=yes"+ ",width=" + 750 + ",height=" + 600); 
} 
function openWarning(){

	//************************************************************************************************************
	//This message can be used in the days/weeks running up to the end of the current tax year
	//NOTE - You will need to confirm with Marketing what day in April is to be considered the "cut-off" date 
	//and amend the wording/and if statement accordingly
	//Make sure you change all references to the tax year and the Day Name and Day Number as relevant!
	//************************************************************************************************************
	//On the day before the "cut-off" the message will be changes to the "more urgent" message
	//
	//NOTE - Make sure you amend the productDetailPagePopup.ascx to load this message...
	//************************************************************************************************************
	
	var WorkingDate = new Date();

	// Set up some working variables...
	
	var DayInMonth;
	DayInMonth = WorkingDate.getDate();
	
	alert("PLEASE NOTE\n\n" +
	"We'll need to receive your application form before 5pm on the 3rd April if you wish to invest in the 2008/09 tax year. If we receive your application form after 5pm on Friday 3 April, we will not be able to process it for the 2008/09 tax year and your application will be returned. Proof of posting does not confirm proof of receipt. To invest in the new 2009/10 tax year, please call us on 0845 88 22 999.");
		
	//If we identity that today is the 2nd (April 2009) - then switch the message to the more urgent one!
	//NOTE - CHANGE OF PLAN BY MARKETING (26 MARCH 2009 - JUST THE ONE MESSAGE UNTIL THURSDAY NOW
	//if (DayInMonth != 2)   {
	//
	//	alert("PLEASE NOTE\n\n" +
	//	"We'll need to receive your application form before 5pm on the 3rd April if you wish to invest in the 2008/09 tax year. If we receive your application form after 5pm on Friday 3 April, we will not be able to process it for the 2008/09 tax year and your application will be returned. Proof of posting does not confirm proof of receipt. To invest in the new 2009/10 tax year, please call us on 0845 88 22 999.");
	//}else{
	//
	//	alert("PLEASE NOTE\n\n" +
	//	"We'll need to receive your application form before 5pm tomorrow, 3 April if you wish to invest in the 2008/09 tax year. If we receive your application form after 5pm on Friday 3 April, we will not be able to process it for the 2008/09 tax year and your application will be returned. Proof of posting does not confirm proof of receipt. To invest in the new 2009/10 tax year, please call us on 0845 88 22 999");
	//}
}


function openWarning2(){

	//**************************************************************************************************************
	//This message can be used after the "cut-off" date for the current tax year
	//NOTE - You will need to confirm with Marketing what day in April is to be considered the "cut-off" date 
	//and amend the wording/and if statement accordingly
	//Make sure you change all references to the tax year and the Day Name and Day Number as relevant!
	//**************************************************************************************************************
	//NOTE - Make sure you amend the productDetailPagePopup.ascx to load this message...
	//**************************************************************************************************************
	
	alert("PLEASE NOTE\n\n" +
	"Unfortunately, it's now too late to invest in the 2008/09 tax year. Our web pages have been updated for the new tax year - so invest early and make the most of your 2009/10 ISA allowance.");
		
}

function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.display = the_change;
  }
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}

function openAdvent(URL){

	alert("Click 'OK' to download your child's fun Advent calendar.\n\n" +
	"Your child can personalise their calendar by writing their name in the space provided and colour in a picture every day in the exciting countdown to Christmas!");
	window.open (URL, '_blank');
}