// JavaScript Document

// AY Online  --  MP and Mayor  text enlargement script
// Copyright A Y Online 2009
// ==========================================================================================
//
//  NOTE : 
//  The text and images are set in the document and variables are passed throught this script to alter the MP and Mayor pics and text


function enlargeMP(){
// make the MAYOR divs small first
	document.getElementById("mid_mayor").style.width = "95px";
	document.getElementById("MayorTitle").style.width = "88px";
	document.getElementById("MayorTitle").style.paddingLeft = "2px";
	document.getElementById("mid_mayorContent").style.width = "90px";
	document.getElementById("MayorContent").style.width = "90px"; //picture width
	document.getElementById("MayorContent").style.overflow = "hidden"; //picture width
// remove the mayor text	
	document.getElementById("MAYORmessageText").innerHTML = ('&nbsp;');
// add the restore pic to MAYOR a tag
	document.getElementById("MAYORpix").innerHTML = ('<a name="mayz" id="mayz" href="#mayz" onclick="restoreOrigMP()">' + MAYpix + '</a>');
	document.getElementById("MAYORpix").style.padding = '0px';	

//enlarge the MP divs
	document.getElementById("mid_MP").style.width = "315px";
	document.getElementById("mid_MPContent").style.width = "305px";
	document.getElementById("MPtitle").style.width = "295px";
	document.getElementById("MPtitle").innerHTML = ('<a name="mayz" id="mayz" href="#mayz" onclick="restoreOrigMP()"><img src="/assets/images/pages/SMcancel.gif" alt="Close" style="border:none; float:right; margin-right:10px;" align="right" /></a>Aylesbury\'s MP');
	document.getElementById('MPcontent').style.width = "300px";
	document.getElementById('MPcontent').style.overflow = "hidden"; //content text box
// adjust height of boxes
	document.getElementById('mid_MP').style.height = "254px"; 
	document.getElementById('MPcontent').style.height = "220px"; 
	document.getElementById('mid_MPContent').style.height = "247px"; 

	document.getElementById('mid_mayorMPwrapper').style.height = "260px"; 
	document.getElementById('pageMiddle_col2').style.height = "1010px"; 
	document.getElementById('pageMiddle').style.height = "1010px"; 
	document.getElementById("MPmessageTextz").style.paddingTop = "5px";

// alter text to full version MP text
	document.getElementById("MPmessageTextz").innerHTML = MMPtext;
//	document.getElementById("MPmessageTextz").innerHTML = ('<strong>Welcome to Aylesbury!</strong><p> As the local MP, I am here to help you with your problems and represent you in Parliament. If I can ever be of any help, please do write to me at the House of Commons or book an appointment at one of my regular advice surgeries.</p><p>All the best, David</p><p><a href="http://www.davidlidington.co.uk" target="_blank">Click here to visit my web site.</a></p>');

// extend the page height
	/*document.getElementById('pageWrapper').style.height = "1439px"; //1369
	document.getElementById('container').style.height = "1670px"; //1600
	document.getElementById('navWrapper').style.height = "1370px"; //1210
	document.getElementById('nav').style.height = "1400px"; //1378  //1238
	*/
	
	document.getElementById('pageWrapper').style.height = "1459px"; //1439  1369
	document.getElementById('container').style.height = "1690px"; //1670  1600
	document.getElementById('navWrapper').style.height = "1370px"; //1350  1210
	document.getElementById('nav').style.height = "1398px"; //1378  1238

// the container needs to be 10px longer for opera and safari
	switch (BrowserDetect.browser){
		case 'Firefox':
			//instructions for Firefox
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
		case 'Opera':
			//instructions for Opera
	document.getElementById('container').style.height = "1700px"; //1670  1600
		break;
		case 'Safari':
			//instructions for Safari
	document.getElementById('container').style.height = "1700px"; //1670  1600
		break;
		case 'Chrome':
			//instructions for Chrome
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
		
		case 'Explorer':
			//instructions for Explorer
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
	}//end switch


}//end function




function enlargeMayor(){
// make the MP divs small first
	document.getElementById("mid_MP").style.width = "95px";
	document.getElementById("MPtitle").style.width = "85px";
	document.getElementById("MPtitle").style.paddingLeft = "5px";
	document.getElementById("MPtitle").innerHTML = ('Our MP');
	document.getElementById("mid_MPContent").style.width = "90px";
	document.getElementById("MPcontent").style.width = "90px"; //picture width
	document.getElementById("MPcontent").style.overflow = "hidden"; //picture width
	document.getElementById("MPpix").style.padding = '0px';	
	document.getElementById("MPcontent").style.paddingLeft = "0px";
// remove the MP text	
	document.getElementById("MPmessageTextz").innerHTML = ('');
// add the restore pic to MP a tag
	document.getElementById("MPpix").innerHTML = ('<a href="#mpp" name="mpp" id="mpp" onclick="restoreOrigMP()">' + MMPpix + '</a>');
	

//enlarge the MAYOR divs
	document.getElementById("mid_mayor").style.width = "315px";
	document.getElementById("mid_mayorContent").style.width = "305px";
	document.getElementById("MayorTitle").style.width = "295px";
	document.getElementById("MayorTitle").innerHTML = ('<a href="#mpp" name="mpp" id="mpp" onclick="restoreOrigMP()"><img src="/assets/images/pages/SMcancel.gif" alt="Close" style="border:none; float:right; margin-right:10px;" align="right" /></a>Town Mayor');
	document.getElementById("MayorContent").style.width = "305px";
	document.getElementById("MayorContent").style.overflow = "hidden"; //content text box
	document.getElementById("MayorContent").style.height = "220px"; 

	document.getElementById("MAYORmessageText").style.paddingLeft = "5px";
	document.getElementById("MAYORmessageText").style.paddingRight = "5px";
	document.getElementById("MAYORmessageText").style.paddingTop = "5px";
	
// alter text to full version MAYOR text

	document.getElementById("MAYORmessageText").innerHTML = MAYtext;
//	document.getElementById("MAYORmessageText").innerHTML = ('<strong>Welcome to Aylesbury!</strong><p>There was an article a short time ago in the Evening Standard which said that Aylesbury was one of the ten best towns to move to because of the Shopping opportunities, a new theatre soon to be built and the natural countryside surrounding the town. </p><p>If you want details about Aylesbury Town Council, <a href="http://www.aylesburytowncouncil.gov.uk" target="_blank">click here to visit our web site.</a></p>');

// adjust height of boxes
	document.getElementById('mid_mayor').style.height = "254px"; 
	document.getElementById('MayorContent').style.height = "220px"; 
	document.getElementById('mid_mayorContent').style.height = "247px"; 

	document.getElementById('mid_mayorMPwrapper').style.height = "260px"; 
	document.getElementById('pageMiddle_col2').style.height = "1010px"; 
	document.getElementById('pageMiddle').style.height = "1010px"; 

// extend the page height
	document.getElementById('pageWrapper').style.height = "1459px"; //1439  1369
	document.getElementById('container').style.height = "1690px"; //1670  1600
	document.getElementById('navWrapper').style.height = "1370px"; //1350  1210
	document.getElementById('nav').style.height = "1398px"; //1378  1238

// the container needs to be 10px longer for opera and safari
	switch (BrowserDetect.browser){
		case 'Firefox':
			//instructions for Firefox
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
		case 'Opera':
			//instructions for Opera
	document.getElementById('container').style.height = "1700px"; //1670  1600
		break;
		case 'Safari':
			//instructions for Safari
	document.getElementById('container').style.height = "1700px"; //1670  1600
		break;
		case 'Chrome':
			//instructions for Chrome
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
		
		case 'Explorer':
			//instructions for Explorer
	document.getElementById('container').style.height = "1690px"; //1670  1600
		break;
	}//end switch

}//end function





function restoreOrigMP(){
// reset the MAYOR divs 
	document.getElementById("mid_mayor").style.width = "205px";
	document.getElementById("MayorTitle").style.width = "188px";
	document.getElementById("MayorTitle").innerHTML = ('Town Mayor');
	document.getElementById("MayorTitle").style.paddingLeft = "10px";
	document.getElementById("mid_mayorContent").style.width = "198px";
	document.getElementById("MayorContent").style.width = "193px"; //picture width
	document.getElementById("MayorContent").style.height = "101px"; 
	document.getElementById("MayorContent").style.paddingRight = "5px"; 

	document.getElementById("MAYORmessageText").style.paddingLeft = "0px";
	document.getElementById("MAYORmessageText").style.paddingRight = "0px";
	document.getElementById("MAYORmessageText").style.paddingTop = "0px";

// reset the mayor text	
	document.getElementById("MAYORmessageText").innerHTML = MAYtease;
//	document.getElementById("MAYORmessageText").innerHTML = ('<strong>Welcome to Aylesbury</strong>,<br /> the Office of the Mayor would like to welcome.... <br /><a name="may" id="may" href="#may" onclick="enlargeMayor()">... read more ...</a>');
	document.getElementById("MAYORpix").style.paddingRight = '0px';	

	document.getElementById("MAYORpix").innerHTML = MAYpix;
//	document.getElementById("MAYORpix").innerHTML = ('<img border="0" vspace="1" hspace="1" src="assets/images/mayor.jpg" alt="Town Mayor, Aylesbury" width="86" height="98" />');
	
//reset the MP divs
	document.getElementById("mid_MP").style.width = "205px";
	document.getElementById("mid_MPContent").style.width = "198px";
	document.getElementById("MPtitle").style.width = "188px";
	document.getElementById("MPtitle").style.paddingLeft = "10px";
	document.getElementById("MPtitle").innerHTML = ('Aylesbury\'s MP');
	document.getElementById("MPcontent").style.width = "191px";
	document.getElementById("MPcontent").style.height = "101px";
	document.getElementById("MPcontent").style.paddingLeft = "5px";
// reset the MP text
	document.getElementById("MPmessageTextz").innerHTML = MPtease;
//	document.getElementById("MPmessageTextz").innerHTML = ('<strong>Welcome</strong>,<br />as the local MP, I am here to help you with your problems and.... <br /><a href="#mppq" name="mppq" id="mppq"onclick="enlargeMP()">... read more ...</a>');
	document.getElementById("MPpix").style.paddingLeft = '5px';	
	document.getElementById("MPpix").innerHTML = MMPpix;
//	document.getElementById("MPpix").innerHTML = ('<img vspace="1" hspace="1" src="assets/images/MPpicture.jpg" alt="David Liddington, MP Aylesbury" width="86" height="98"/>');
	document.getElementById("MPmessageTextz").style.paddingTop = "0px";
	
// adjust height of boxes
//	--MP
	document.getElementById('mid_MP').style.height = "135px"; 
	document.getElementById('MPcontent').style.height = "101px"; 
	document.getElementById('mid_MPContent').style.height = "128px"; 
	
//  --MAYOR	
	document.getElementById('mid_mayor').style.height = "135px"; 
	document.getElementById('MayorContent').style.height = "101px"; 
	document.getElementById('mid_mayorContent').style.height = "128px"; 
	
//   -- all other
	document.getElementById('mid_mayorMPwrapper').style.height = "140px"; 
	document.getElementById('pageMiddle_col2').style.height = "890px"; 
	document.getElementById('pageMiddle').style.height = "890px"; 

// restore the page height
	document.getElementById('pageWrapper').style.height = "1330px"; //1310  1369
	document.getElementById('navWrapper').style.height = "1300px"; //1280 1210
	document.getElementById('nav').style.height = "1328px"; //1308  1238



// the container needs to be 10px longer for opera and safari
	switch (BrowserDetect.browser){
		case 'Firefox':
			//instructions for Firefox
	document.getElementById('container').style.height = "1561px"; //1541  1600
		break;
		case 'Opera':
			//instructions for Opera
	document.getElementById('container').style.height = "1571px"; //1541  1600
		break;
		case 'Safari':
			//instructions for Safari
	document.getElementById('container').style.height = "1571px"; //1541  1600
		break;
		case 'Chrome':
			//instructions for Chrome
	document.getElementById('container').style.height = "1561px"; //1541  1600
		break;
		
		case 'Explorer':
			//instructions for Explorer
	document.getElementById('container').style.height = "1561px"; //1541  1600
		break;
	}//end switch

}//end function

