// MIGRATIONS OFFER  - Contact your current provider list

function changetext(ind) {
document.theform.display.value = textBlocks[ind];
}


var textBlocks = new Array()

textBlocks[0]="Phone number";
textBlocks[1]="0844 499 5555";
textBlocks[2]="0800 085 2819";
textBlocks[3]="0845 600 7020";
textBlocks[4]="0800 328 6738";
textBlocks[5]="0845 272 2333";
textBlocks[6]="0845 122 4111";
textBlocks[7]="0845 122 4333";
textBlocks[8]="0871 230 9312";
textBlocks[9]="0844 395 0830";
textBlocks[10]="0871 230 9300";
textBlocks[11]="0844 871 0079";
textBlocks[12]="0800 230 0202";
textBlocks[13]="0871 663 3300";
textBlocks[14]="0844 241 0515";
textBlocks[15]="0870 444 1820";
textBlocks[16]="0845 077 4488";
textBlocks[17]="0845 454 1111";
textBlocks[18]="0845 058 9009";


// MIGRATIONS OFFER  - MONTHLY OR ANNUAL OPTIONS (NOW REMOVED FROM THE PORTAL)

function premoffer(){
window.location=document.form1.premform.options[document.form1.premform.selectedIndex].value
}


//MIGRATIONS OFFER PRODUCT DROP DOWN OPTIONS

function setOptions(o) 
{ 

var select2 = document.form1.select2;
var select3 = document.form1.select3;
var select4 = document.form1.select4;

var HomePhoneBox = document.getElementById('HomePhoneMigration');

// Sets dropdowns to no entrys
select2.options.length = 0;
select3.options.length = 0;
select4.options.length = 0;

if (o == "0") 
{
// Product default
select2.options[0] = new Option('Product selection');
select2.options[0].value = 'no product selected';

// Contracts default
select3.options[0] = new Option('Contract selection');
select3.options[0].value = 'no contract selected';

// Home Phone default
HomePhoneBox.style.display = "none";
select4.options[0] = new Option('Home Phone selection');
select4.options[0].value = 'no home phone selected';
}
 
if (o == "1") 
{
// Residential products
select2.options[0] = new Option('Option 1 £9.99');
select2.options[0].value = 'OPTION1';

select2.options[1] = new Option('Option 2 £14.99');
select2.options[1].value = 'OPTION2';

select2.options[2] = new Option('Option 3 £19.99');
select2.options[2].value = 'OPTION3';

select2.options[3] = new Option('Option 4 £29.99');
select2.options[3].value = 'OPTION4';

// Contracts available on a residential product
select3.options[0] = new Option('Monthly');
select3.options[0].value = 'MONTHLY';

// Home phone on a residential product
HomePhoneBox.style.display = "block";

select4.options[0] = new Option('No Home Phone');
select4.options[0].value = 'NOHOMEPHONE';

select4.options[1] = new Option('Evenings & Weekends £11.00');
select4.options[1].value = 'EVENINGWEEKEND';

select4.options[2] = new Option('Anytime+ £15.00');
select4.options[2].value = 'ANYTIMEPLUS';
}

if (o == "2") 
{ 
// Business products
select2.options[0] = new Option('Teleworker PAYG £13.61');
select2.options[0].value = 'TELEWORKER_PAYG';

select2.options[1] = new Option('Teleworker Premier (up to 8Mb) £21.27');
select2.options[1].value = 'TELEWORKER_PREMIER';

select2.options[2] = new Option('Small Business PAYG £19.99');
select2.options[2].value = 'SMALL_BUSINESS_PAYG';

select2.options[3] = new Option('Small Business Premier (up to 8Mb) £26.99');
select2.options[3].value = 'SMALL_BUSINESS_PREMIER';

select2.options[4] = new Option('Business Premier (up to 8Mb) £34.99');
select2.options[4].value = 'BUSINESS_PREMIER';

// Contracts available on a business product
select3.options[0] = new Option('Annual');
select3.options[0].value = 'ANNUAL';

// Home phone on a business product
HomePhoneBox.style.display = "none";

select4.options[0] = new Option('Not Available');
select4.options[0].value = 'NOTAVAILABLE';
} 

}


// MIGRATIONS OFFER PRODUCT VALUES for each product you must change the 'sdi' number according to the product ( gather from development ) and change the portal address for each 'assets/migrations.js' respectivley.

function setSDI()
{

var select2 = document.form1.select2;
var select3 = document.form1.select3;
var select4 = document.form1.select4;

	// Set up form vars
	var SignupURL = 'https://signup.plus.net/Standard/';
	document.form1.action = '#';
	document.form1.strISP.value = 'plus.net';
	
	// Residential MONTHLY products + ANYTIME HOME PHONE
	if (select2.options[select2.options.selectedIndex].value == "OPTION1" && select3.options[select3.options.selectedIndex].value == "MONTHLY")
	{
		document.form1.intProductID.value = 6629;
		document.form1.intCBCFlexID.value = 47614;
		
		if(select4.options[select4.options.selectedIndex].value == "EVENINGWEEKEND")
		{
			document.form1.intHomePhoneProductID.value = 515;
		}
		else if(select4.options[select4.options.selectedIndex].value == "ANYTIMEPLUS")
		{
			document.form1.intHomePhoneProductID.value = 510;
		}
		
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "OPTION2" && select3.options[select3.options.selectedIndex].value == "MONTHLY")
	{
		document.form1.intProductID.value = 6630;
		document.form1.intCBCFlexID.value = 47621;
		
		if(select4.options[select4.options.selectedIndex].value == "EVENINGWEEKEND")
		{
			document.form1.intHomePhoneProductID.value = 515;
		}
		else if(select4.options[select4.options.selectedIndex].value == "ANYTIMEPLUS")
		{
			document.form1.intHomePhoneProductID.value = 510;
		}
		
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "OPTION3" && select3.options[select3.options.selectedIndex].value == "MONTHLY")
	{
		document.form1.intProductID.value = 6631;
		document.form1.intCBCFlexID.value = 47628;
		
		if(select4.options[select4.options.selectedIndex].value == "EVENINGWEEKEND")
		{
			document.form1.intHomePhoneProductID.value = 515;
		}
		else if(select4.options[select4.options.selectedIndex].value == "ANYTIMEPLUS")
		{
			document.form1.intHomePhoneProductID.value = 510;
		}
		
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "OPTION4" && select3.options[select3.options.selectedIndex].value == "MONTHLY")
	{
		document.form1.intProductID.value = 6632;
		document.form1.intCBCFlexID.value = 47642;
		
		if(select4.options[select4.options.selectedIndex].value == "EVENINGWEEKEND")
		{
			document.form1.intHomePhoneProductID.value = 515;
		}
		else if(select4.options[select4.options.selectedIndex].value == "ANYTIMEPLUS")
		{
			document.form1.intHomePhoneProductID.value = 510;
		}
		
		document.form1.action = SignupURL;
	}
	
	// BUSINESS products
	else if (select2.options[select2.options.selectedIndex].value == "TELEWORKER_PAYG")
	{
		document.form1.intProductID.value = 6607;
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "TELEWORKER_PREMIER")
	{
		document.form1.intProductID.value = 5582;
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "SMALL_BUSINESS_PAYG")
	{
		document.form1.intProductID.value = 6628;
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "SMALL_BUSINESS_PREMIER")
	{
		document.form1.intProductID.value = 5600;
		document.form1.action = SignupURL;
	}
	
	else if (select2.options[select2.options.selectedIndex].value == "BUSINESS_PREMIER")
	{
		document.form1.intProductID.value = 5618;
		document.form1.action = SignupURL;
	}
}


//ROLLOVER IMAGE AND RESTORE IMAGE
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


// start ticketing script
/***********************************************
* Switch Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

<!--

// function getStyleObject(string) -> returns style object
//  given a string containing the id of an object
//  the function returns the stylesheet of that object
//  or false if it can't find a stylesheet.  Handles
//  cross-browser compatibility issues.
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  if(document.getElementById && document.getElementById(objectId)) {
  return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
  return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
  return document.layers[objectId];
   } else {
  return false;
   }
}

function changeObjectDisplay(objectId, newDisplay) {
    // first get a reference to the cross-browser style object 
    // and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
  styleObject.display = newDisplay;
  return true;
    } else {
  // we couldn't find the object, so we can't change its visibility
  return false;
    }
}

// -->

// Function to add a page as a bookmark
function addBookmark(title, url)
{
	var ie      = false;
	var command = 'Ctrl+D';
	var agt     = navigator.userAgent.toLowerCase();

	if (agt.indexOf("opera") != -1 ||
	    agt.indexOf("staroffice") != -1 ||
	    agt.indexOf("webtv") != -1 ||
	    agt.indexOf("chimera") != -1 ||
	    agt.indexOf("netpositive") != -1 ||
	    agt.indexOf("phoenix") != -1 ||
	    agt.indexOf("skipstone") != -1)
	{ 
		command = 'Ctrl+D';
	}
	else if (agt.indexOf("safari") != -1)
	{
		command = 'Ctrl+T';
	}
	else if (agt.indexOf("msie") != -1)
	{ 
		ie = true;
	} 

	if (ie)
	{
		window.external.AddFavorite(url, title);
	}
	else
	{
		alert("Please press " + command + " to bookmark this page");
	}
}
