//Font resizer
//var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');
var tags = new Array( 'div','td','tr','p','b','table','strong','emphasis','a','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');

var pixelArray =  new Array('10','12','14','16');
var emArray =  new Array('0.7','0.9','1.0','1.5','2.0','2.5','3');
var initSize = 1;

function fontSizer(inc,unit)
{
	if (!document.getElementById) return;
	
	var size = initSize;
	size += inc;
	
	if (size < 1 )
	{
		size = 1;
	}
	
	if (size > 3 )
	{
		size = 3;
	}
		
	initSize = size;
	getBody = document.getElementsByTagName('body')[0];
	for (i = 0 ; i < tags.length ; i++ )
	{
		getallTags = getBody.getElementsByTagName(tags[i]);
		for (k = 0 ; k < getallTags.length ; k++) 
		{
				getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit: emArray[size]+unit;
		}
	}
}




//Getting it Right breadcrumb
function gettingItRightBreadCrumbs()
{
	output = "<a href=\"/\">Home</a>  &#187; <a href=\"/Repairs%20And%20Improvements/Getting%20it%20Right%20Selector/default.aspx\">Getting it Right Property Selector</a>";

	document.write(output);
}


//Breadcrumb function
function breadcrumbs()
{
	sURL = new String;
	bits = new Object;
	var x = 0;
	var stop = 0;
	var output = "<a href=\"/\">Home</a>  &#187;  ";
	sURL = location.href;
	sURL = sURL.slice(8,sURL.length);
	chunkStart = sURL.indexOf("/");
	sURL = sURL.slice(chunkStart+1,sURL.length)
	while(!stop)
	{
		chunkStart = sURL.indexOf("/");
		if (chunkStart != -1)
		{
		  bits[x] = sURL.slice(0,chunkStart)
		  sURL = sURL.slice(chunkStart+1,sURL.length);
		}else{
		  stop = 1;
		}
		x++;

	 }

	if (x == 1)
	{
		output = "<a href=\"/\">Home</a>";
		document.write(output);
		return;
	}

	for(var i in bits)
	{
		output += "<a href=\"";
		for(y=1;y<x-i;y++){
		  output += "../";
		}

		if (i < (x - 2))
		{
			output += bits[i] + "/\">" + processLinkText(bits[i]) + "</a>  &#187;  ";

		}
		else
		{
			output += bits[i] + "/\">" + processLinkText(bits[i]) + "</a>";
		}

	 }

	  document.write(output);
}

//Process link text for breadcrumb function
function processLinkText(inText)
{
	//Removes unwanted characters.
	//Add more lines to remove others
	//in general form:
	//inText = inText.replace(/<bit to be replaced>/g,"<bit to replace it with>");

	inText = inText.replace(/%20/g," "); //Replace %20 with a space
	inText = inText.replace(/%96/g,"-"); //Replace %96 with a hypen
	inText = inText.replace(/%92/g,"'"); //Replace %96 with a '
	inText = inText.replace(/Leasholders And Right To Buy/g,"Leaseholders And Right To Buy"); //Replace Leasholders And Right To Buy with Leaseholders And Right To Buy
	inText = inText.replace(/How to complain/g,"Comments and Complaints"); //Replace How to complain with Comments and Complaints
	inText = inText.replace(/PFI1/g,"PFI 1 and PFI 2"); //Replace PFI1 with PFI1 and PFI2
	inText = inText.replace(/PFI2/g,"PFI 1 and PFI 2"); //Replace PFI2 with PFI1 and PFI2
	inText = inText.replace(/Charges/g,"Service Charges"); //Replace Charges with Service Charges
	inText = inText.replace(/Tenancy Conditions/g,"Tenancy Information"); //Tenancy Conditions with Tenancy Information
	inText = inText.replace(/Transfers/g,"Transfers / Moving Home"); //Transfers with Transfers / Moving Home
	inText = inText.replace(/Your right to buy - Your questions and how to get answers/g,"Right to Buy"); //Your right to buy - Your questions and how to get answers with Right to Buy
	inText = inText.replace(/Changes to the right to buy/g,"Changes to the Right to Buy"); //Changes to the right to buy with Changes to the Right to Buy
	inText = inText.replace(/Independent advice/g,"Advice"); //Independent advice with Advice
	inText = inText.replace(/Insurance/g,"Building Insurance"); //Insurance with Building Insurance
	inText = inText.replace(/Head of Performance and Service Development/g,"Director Of Performance And Service Development"); //Head Of Performance And Service Development with Director Of Performance And Service Development
    inText = inText.replace(/Gas safety checks for tenants/g,"Gas Safety"); //Replace Gas safety checks for tenants with Gas Safety
	inText = inText.replace(/Actual Management Fees for 2006 - 07/g,"Actual Management Fees for 2007 - 08"); //Actual Management Fees for 2006 - 07 with Actual Management Fees for 2007 - 08
	inText = inText.replace(/Leaseholder forum/g,"Leaseholder Consultation"); //Leaseholder forum with Leaseholder Consultation
	inText = inText.replace(/Corgi Registered Contractors Useful Information/g,"Gas Safe Registered Contractors Useful Information"); //Corgi Registered Contractors Useful Information with Gas Safe Registered Contractors Useful Information
	inText = inText.replace(/Housing Area Changes/g,"Useful Information"); //Housing Area Changes with Useful Information
	inText = inText.replace(/News and Information/g,"News and Events"); //News and Information with News and Events
	inText = inText.replace(/Meeting Calendar and Reports/g,"Meetings Calendar"); //Meeting Calendar and Reports with Meetings Calendar
	inText = inText.replace(/Bulletins and HFI Publications/g,"Bulletins"); //Bulletins and HFI Publications with Bulletins
	inText = inText.replace(/Best Value Local Performance Indicators/g,"Local Performance Indicators"); //Best Value Local Performance Indicators with Local Performance Indicators
	inText = inText.replace(/Environment/g,"Energy & Environment"); //Environment with Energy & Environment
	inText = inText.replace(/Central Street Area/g,"Old Street Area"); //Central Street Area with Old Street Area
	inText = inText.replace(/Central Street Services/g,"Old Street Services"); //Central Street Services with Old Street Services
	inText = inText.replace(/Law and your Tenancy Agreement/g,"Gas Safety Checks for Residents"); //Law and your Tenancy Agreement with Gas Safety Checks for Residents
	inText = inText.replace(/Bright Sparks/g,"Bright Sparks - Repair, reuse and recycle!"); //Bright Sparks with Bright Sparks - Repair, reuse and recycle!

	
	myArray = inText.split(" ");

	for(var i in myArray)
	{
		myTemp = myArray[i].substring(0,1);
		myTemp = myTemp.toUpperCase();
		myTemp += myArray[i].substring(1);

		if (i == 0)
		{
			inText = myTemp;
		}
		else
		{
			inText += " " + myTemp;
		}
	}

	return inText;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
