//################################################################################
//#			NAME: 		functionLoader
//#			CALLED BY:	Page Layout Manager (Post Form) [WebGUI Template]
//#			PURPOSE:	A single function that launches all necessary functions
//#						to run the form. Keeps the form page a little cleaner.
//################################################################################
function functionLoader(titleVal) {
	parseFields(1);
	parseFields(2);
	parseFields(3);
	parseFields(4);
	parseFields(5);
	populateMe(titleVal);
	attachValidation();
	validateForm();
	backgroundImages(document.getElementById('themeName').value,'miniLayout',320);
}


//################################################################################
//#			NAME: 		updateFields
//#			CALLED BY:	functionLoader, validateForm
//#			PURPOSE:	Obtains the values of a given layout, top, left and width
//#						and concatenates them into a single value, and assigns 
//#						them to a user defined variable. Secondly, it feeds these
//#						values to the miniLayout function.
//################################################################################
function updateFields(positionVal) {
	var topVal = document.getElementById('top' + positionVal).value;
	var leftVal = document.getElementById('left' + positionVal).value;
	var widthVal = document.getElementById('width' + positionVal).value;	
	
	var combineEm = topVal + "," + leftVal + "," + widthVal;
	
	document.getElementById("userDefined" + positionVal + "_formId").value = combineEm;
	miniLayout(positionVal,topVal,leftVal,widthVal);
}


//################################################################################
//#			NAME: 		parseFields
//#			CALLED BY:	functionLoader
//#			PURPOSE:	Grabs the concatenated top, left and width values and
//#						splits them up again to populate the input boxes when the
//#						page is loaded.
//################################################################################
function parseFields(userField) {
	var valArray = document.getElementById("userDefined" + userField + "_value").value.split(",");
	var elementArray = new Array(document.getElementById('top' + userField),document.getElementById('left' + userField),document.getElementById('width' + userField));
	for(i=0;i<valArray.length;i++) {
		elementArray[i].value = valArray[i];	
	}
	
}


//################################################################################
//#			NAME: 		populateMe
//#			CALLED BY: 	functionLoader
//#			PURPOSE:	Two WebGUI navigation assets create two javascript arrays
//#						that contain all of the names of user created themes, and
//#						then the names of themes to not be displayed. The function
//#						takes the values from the arrays and uses them to populate
//#						a dropdown box
//################################################################################
function populateMe(noTitle) {
	var themeNames = new Array("Theme ManagerLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","green_designLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","libraryLayout","green_carLayout","power_cellLayout","protecting_oceansLayout","bikesLayout","bikes2Layout","presidential_summitLayout");		//Supplies the populated themeNames array
	var usedLayouts = new Array("obamaLayout","identityLayout","climatechangeLayout","surveillanceLayout","swinefluLayout","financecorruptionLayout","dissentLayout","anticorruptionLayout","cairoLayout","revivetradeLayout","chinausLayout","nationalparksLayout","cabinetLayout","aidsLayout","topuniversitiesLayout","endangeredLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","green_designLayout","digitallibraryLayout","digitallibraryLayout","libraryLayout","green_carLayout","power_cellLayout","protecting_oceansLayout","bikesLayout","presidential_summitLayout");		//Supplies the populated usedLayouts array
	var themeName = document.getElementById('themeName').options;
	
	if(noTitle != 'Thread') {
		themeName[themeName.length] = new Option(noTitle, noTitle);
		themeName[themeName.length] = new Option("", "");
	}
	
	for (i=1;i<themeNames.length; i++) {
		if(noTitle != themeNames[i]) {
			for(x=0;x<usedLayouts.length;x++) {
				if(usedLayouts[x] == themeNames[i]) {
					repeatedLayout = 1;
					break;				
				}
				else
					repeatedLayout = 0;
			}
			if(!repeatedLayout) 
				themeName[themeName.length] = new Option(themeNames[i],themeNames[i]);	
		}
	}
}


//################################################################################
//#			NAME: 		miniLayout
//#			CALLED BY:	updateFields
//#			PURPOSE:	Positions boxes on a mock layout that is 1/3rd the scale
//#						of an actual america.gov layout
//################################################################################
function miniLayout(miniVal,topVal,leftVal,widthVal) {
	var miniVal = document.getElementById("mini" + miniVal);
	if((topVal != '') && (leftVal != '') && (widthVal != '')) {
		miniVal.style.top = Math.round(topVal / 3) + "px";
		miniVal.style.left = Math.round(leftVal / 3) + "px";
		miniVal.style.width = Math.round(widthVal / 3) + "px";
		miniVal.style.display = "block";
	}
	else {
		miniVal.style.top = "0px";
		miniVal.style.left = "0px";
		miniVal.style.width = "0px";
		miniVal.style.display = "none";
	}
}


//################################################################################
//#			NAME: 		validateForm
//#			CALLED BY: 	attachValidation, functionLoader
//#			PURPOSE:	Primarily this is to validate that each layout has all 3
//#						necessary values, left, top and width when the submit
//#						button is pressed. Error notifications are displayed in 
//#						red. This is also called to initially place the boxes
//#						in the mini layout.
//################################################################################
function validateForm() {
	var numOf = 5;
	var valid = true;
	var errorVal = document.getElementById('errorConsole');
	errorVal.innerHTML = '';
	
	for(i=1;i<=numOf;i++) {
		var topVal = document.getElementById('top' + i).value;
		var leftVal = document.getElementById('left' + i).value;
		var widthVal = document.getElementById('width' + i).value;
		var labelVal = document.getElementById('label' + i);
		
		if((topVal == '') || (leftVal == '') || (widthVal == '')) {
			if((topVal == '') && (leftVal == '') && (widthVal == '')) {
				//No values were entered, so don't do anything
			}
			else
			{	
				errorVal.style.color = 'red';
				errorVal.innerHTML = errorVal.innerHTML + "<div style='padding:5px 15px'>You must enter left, top and width values for layout " + i + "</div>"
				labelVal.style.color = 'red';
				valid = false;
			}
		}
		else {
			labelVal.style.color = 'black';
			updateFields(i);
			continue;
		}
		
	}
	//alert(valid);
	return valid;
}
	

//################################################################################
//#			NAME: 		attachValidation
//#			CALLED BY: 	functionLoader
//#			PURPOSE:	Attachs an onsubmit event to fire off the validateForm
//#						function
//################################################################################
function attachValidation() {
	var attachForm = document.getElementById('layoutManagerPost');	
	attachForm = attachForm.getElementsByTagName('form');
	attachForm[0].onsubmit = function () { return validateForm(); };
}


//################################################################################
//#			NAME: 		backgroundImages
//#			CALLED BY: 	Page Layout Manager (Thread), functionLoader()
//#			PURPOSE:	Places the correct background image for the layout. This 
//#						function is AssetProxied into the updatefields.js Snippet
//#						because it is actually a Collaboratoin System template,
//#						so its MIME type isn't text/javascript
//################################################################################
function backgroundImages(themeName,elementId,bckImgWidth) {
	//var themeName = themeName;
	var counter = 200;
	var themeArray = new Array(200);
	var imgHeight;
			
	for(i=0;i<counter;i++)
		themeArray[i] = new Array(2);
			
	
	themeArray[1-1][0] = "presidential_summitLayout";			//Theme Name	
	themeArray[1-1][1] = "/mgck/uploads/T_/sD/T_sDKvfRQpQVTzDYU8NLJA/ent_summit_bg_new.jpg";		//Background Image
	
	themeArray[2-1][0] = "bikesLayout";			//Theme Name	
	themeArray[2-1][1] = "/mgck/uploads/CB/Ev/CBEv7I35pR-5UTUrufuwzg/ch-BikesfortheWorld-bkgd.jpg";		//Background Image
	
	themeArray[3-1][0] = "bikes2Layout";			//Theme Name	
	themeArray[3-1][1] = "/mgck/uploads/R-/2T/R-2TQllhVyhkYwH_FVZh4Q/ch-BikesfortheWorld-bkgd.jpg";		//Background Image
	
	themeArray[4-1][0] = "protecting_oceansLayout";			//Theme Name	
	themeArray[4-1][1] = "/mgck/uploads/xb/j-/xbj-VIHt6HQGTor_FmpsSg/CH_ocean_bkgd.jpg";		//Background Image
	
	themeArray[5-1][0] = "power_cellLayout";			//Theme Name	
	themeArray[5-1][1] = "/mgck/uploads/9I/9Z/9I9ZkAvy4CPNJnmOFiG7CA/CH_mobile_bkgd.jpg";		//Background Image
	
	themeArray[6-1][0] = "libraryLayout";			//Theme Name	
	themeArray[6-1][1] = "/mgck/uploads/Vm/ZV/VmZVw2SlTwGUBs_iJZQ_2w/digitallibrary_bkgd_mgck.jpg";		//Background Image
	
	themeArray[7-1][0] = "green_carLayout";			//Theme Name	
	themeArray[7-1][1] = "/mgck/uploads/2A/6i/2A6iBpz3CRSkdK_n6hMKtA/CH_carsshifttogreen_bkgd.jpg";		//Background Image
	
	themeArray[8-1][0] = "green_designLayout";			//Theme Name	
	themeArray[8-1][1] = "/mgck/uploads/8b/fa/8bfaXZtQE-k--WPKRzy3GA/grnbdg-bkgd-chinese-copy.jpg";		//Background Image
	
	themeArray[9-1][0] = "foiaLayout";			//Theme Name	
	themeArray[9-1][1] = "/mgck/uploads/DF/CP/DFCPvfS47Mb3GMtv2VFigQ/freedomofinformationact_bg.jpg";		//Background Image
	
	themeArray[10-1][0] = "foiaLayout";			//Theme Name	
	themeArray[10-1][1] = "/mgck/uploads/nw/Yz/nwYzPi4SkqX1nEnoaXQxAw/freedomofinformationact_bg.jpg";		//Background Image
	
	themeArray[11-1][0] = "meet_obama_chLayout";			//Theme Name	
	themeArray[11-1][1] = "/mgck/uploads/tz/Ka/tzKaG8xLeAVsZcXQPw2XDA/ch_meetbarack_bkgrd.jpg";		//Background Image
	
	themeArray[12-1][0] = "meet_obama_chLayout";			//Theme Name	
	themeArray[12-1][1] = "/mgck/uploads/TH/Cn/THCnECcSkyEtUsRR43D75Q/ch_meetbarack_bkgrd.jpg";		//Background Image
	
	themeArray[13-1][0] = "meet_obama_chLayout";			//Theme Name	
	themeArray[13-1][1] = "/mgck/uploads/Qv/HU/QvHUt20kotDCXAcdiuMcXw/ch_meetbarack_bkgrd.jpg";		//Background Image
	
	themeArray[14-1][0] = "meet_obama_chLayout";			//Theme Name	
	themeArray[14-1][1] = "/mgck/uploads/8L/P9/8LP9ZFv-59jdEJn42c3ZgQ/ch_meetbarack_bkgrd.jpg";		//Background Image
	
	themeArray[15-1][0] = "vanishing_act_chLayout";			//Theme Name	
	themeArray[15-1][1] = "/mgck/uploads/wS/uE/wSuEy8SmvBKkNoBP3l3s8g/vanishing-act_final.jpg";		//Background Image
	
	themeArray[16-1][0] = "vanishing_act_chLayout";			//Theme Name	
	themeArray[16-1][1] = "/mgck/uploads/Qn/-k/Qn-kMHoSuvmbePVHX1-a4w/vanishing-act_final.jpg";		//Background Image
	
	themeArray[17-1][0] = "vanishing_act_chLayout";			//Theme Name	
	themeArray[17-1][1] = "/mgck/uploads/p1/c9/p1c9mbkDsXvtA3n-6Knu4g/vanishing-act_final.jpg";		//Background Image
	
	themeArray[18-1][0] = "vanishing_act_chLayout";			//Theme Name	
	themeArray[18-1][1] = "/mgck/uploads/eV/e0/eVe0WxZTxwDcPnzv0_3jYA/vanishing-act_final.jpg";		//Background Image
	
	themeArray[19-1][0] = "disease_surveillance_chLayout";			//Theme Name	
	themeArray[19-1][1] = "/mgck/uploads/p_/eK/p_eKYn3AOha6JF-Rjk-Cpw/CH_surveillance_bkgd.jpg";		//Background Image
	
	themeArray[20-1][0] = "disease_surveillance_chLayout";			//Theme Name	
	themeArray[20-1][1] = "/mgck/uploads/WU/uj/WUuj5lHIBiNiX4Qs7CSoIg/CH_surveillance_bkgd.jpg";		//Background Image
	
	themeArray[21-1][0] = "disease_surveillance_chLayout";			//Theme Name	
	themeArray[21-1][1] = "/mgck/uploads/8b/Kg/8bKgyuyaObyf4lul8x77CA/CH_surveillance_bkgd.jpg";		//Background Image
	
	themeArray[22-1][0] = "disease_surveillance_chLayout";			//Theme Name	
	themeArray[22-1][1] = "/mgck/uploads/PW/i2/PWi2TKz0oUzYyjE9-eMclw/CH_surveillance_bkgd.jpg";		//Background Image
	
	themeArray[23-1][0] = "tracking_H1N1_chLayout";			//Theme Name	
	themeArray[23-1][1] = "/mgck/uploads/oq/sW/oqsWyaz5gYXTxK4qQf6mrg/CH_h1n1_bkgd.jpg";		//Background Image
	
	themeArray[24-1][0] = "tracking_H1N1_chLayout";			//Theme Name	
	themeArray[24-1][1] = "/mgck/uploads/9U/HS/9UHSyecSpMgXyDmE7qLmxA/CH_h1n1_bkgd.jpg";		//Background Image
	
	themeArray[25-1][0] = "tracking_H1N1_chLayout";			//Theme Name	
	themeArray[25-1][1] = "/mgck/uploads/uU/B0/uUB0mb74xXOZLJCT6bCqEA/CH_h1n1_bkgd.jpg";		//Background Image
	
	themeArray[26-1][0] = "tracking_H1N1_chLayout";			//Theme Name	
	themeArray[26-1][1] = "/mgck/uploads/f0/1W/f01WWu6pcZz8zb_CJJzKsA/CH_h1n1_bkgd.jpg";		//Background Image
	
	themeArray[27-1][0] = "demo_dev_chLayout";			//Theme Name	
	themeArray[27-1][1] = "/mgck/uploads/DB/OU/DBOUC5P6173AL1qPdXr4wQ/CH_dd_bkgd.jpg";		//Background Image
	
	themeArray[28-1][0] = "demo_dev_chLayout";			//Theme Name	
	themeArray[28-1][1] = "/mgck/uploads/zV/SR/zVSRNZ21ZORDfxujz5rTtA/CH_dd_bkgd.jpg";		//Background Image
	
	themeArray[29-1][0] = "demo_dev_chLayout";			//Theme Name	
	themeArray[29-1][1] = "/mgck/uploads/qn/1x/qn1xsNAK0BD2RqeILO2C6w/CH_dd_bkgd.jpg";		//Background Image
	
	themeArray[30-1][0] = "demo_dev_chLayout";			//Theme Name	
	themeArray[30-1][1] = "/mgck/uploads/Gq/he/GqhepXfpI95gnYPXIo4ANg/CH_dd_bkgd.jpg";		//Background Image
	
	themeArray[31-1][0] = "climate_change_chLayout";			//Theme Name	
	themeArray[31-1][1] = "/mgck/uploads/QF/s3/QFs3pv4l9PGno6gsCiangg/CH_climate_bkgd.jpg";		//Background Image
	
	themeArray[32-1][0] = "climate_change_chLayout";			//Theme Name	
	themeArray[32-1][1] = "/mgck/uploads/Am/m-/Amm-XJ-HyOg5xYqOUKVALg/CH_climate_bkgd.jpg";		//Background Image
	
	themeArray[33-1][0] = "climate_change_chLayout";			//Theme Name	
	themeArray[33-1][1] = "/mgck/uploads/Yr/5C/Yr5CeVNwdWD-UoOeZ7l9rg/CH_climate_bkgd.jpg";		//Background Image
	
	themeArray[34-1][0] = "climate_change_chLayout";			//Theme Name	
	themeArray[34-1][1] = "/mgck/uploads/l2/U-/l2U-ls0FOJ_uX6besGWtTw/CH_climate_bkgd.jpg";		//Background Image
	
	themeArray[35-1][0] = "human_rights_chLayout";			//Theme Name	
	themeArray[35-1][1] = "/mgck/uploads/AW/Uj/AWUjnaauZ4cxlyfvYjz3qA/CH_undhr_bkgd.jpg";		//Background Image
	
	themeArray[36-1][0] = "human_rights_chLayout";			//Theme Name	
	themeArray[36-1][1] = "/mgck/uploads/7O/o_/7Oo_RMXXqxdxq0UIEryRxg/CH_undhr_bkgd.jpg";		//Background Image
	
	themeArray[37-1][0] = "human_rights_chLayout";			//Theme Name	
	themeArray[37-1][1] = "/mgck/uploads/up/AZ/upAZos0iuCUNJ-5Lhsy73A/CH_undhr_bkgd.jpg";		//Background Image
	
	themeArray[38-1][0] = "human_rights_chLayout";			//Theme Name	
	themeArray[38-1][1] = "/mgck/uploads/hc/T-/hcT-aJTu9qSUiOA9x5hnww/CH_undhr_bkgd.jpg";		//Background Image
	
	themeArray[39-1][0] = "dissent_chLayout";			//Theme Name	
	themeArray[39-1][1] = "/mgck/uploads/zI/cf/zIcfOGdLgC4LhnmB1O6_Xw/CH_dissent_bkgd.jpg";		//Background Image
	
	themeArray[40-1][0] = "dissent_chLayout";			//Theme Name	
	themeArray[40-1][1] = "/mgck/uploads/5E/iJ/5EiJQzuCd0-N4xrru6q2vQ/CH_dissent_bkgd.jpg";		//Background Image
	
	themeArray[41-1][0] = "dissent_chLayout";			//Theme Name	
	themeArray[41-1][1] = "/mgck/uploads/4l/IS/4lISOIdDFPRu8o73QmGBOg/CH_dissent_bkgd.jpg";		//Background Image
	
	themeArray[42-1][0] = "dissent_chLayout";			//Theme Name	
	themeArray[42-1][1] = "/mgck/uploads/6P/YE/6PYEWGXIV-5TYE1o-CU1Yw/CH_dissent_bkgd.jpg";		//Background Image
	
	themeArray[43-1][0] = "innovation_nation_chLayout";			//Theme Name	
	themeArray[43-1][1] = "/mgck/uploads/hr/NC/hrNCYDMXIh5V7XA2I8xaFg/ch_innovation_bkgd.jpg";		//Background Image
	
	themeArray[44-1][0] = "innovation_nation_chLayout";			//Theme Name	
	themeArray[44-1][1] = "/mgck/uploads/WR/Ho/WRHoJS3GA6bJkZUEMhr88w/ch_innovation_bkgd.jpg";		//Background Image
	
	themeArray[45-1][0] = "innovation_nation_chLayout";			//Theme Name	
	themeArray[45-1][1] = "/mgck/uploads/ek/vB/ekvBFlRpcWKTkFmHQjrbkA/ch_innovation_bkgd.jpg";		//Background Image
	
	themeArray[46-1][0] = "innovation_nation_chLayout";			//Theme Name	
	themeArray[46-1][1] = "/mgck/uploads/G1/VF/G1VFdkLP4Sth9i9cq38jSw/ch_innovation_bkgd.jpg";		//Background Image
	
	themeArray[47-1][0] = "cabinetLayout";			//Theme Name	
	themeArray[47-1][1] = "/mgck/uploads/Gt/CE/GtCECE0gzORxePvvYA_j7g/ch_cabinet_bkgd.jpg";		//Background Image
	
	themeArray[48-1][0] = "cabinetLayout";			//Theme Name	
	themeArray[48-1][1] = "/mgck/uploads/un/-m/un-mb0FVFmwu62HIaQc8Kw/ch_cabinet_bkgd.jpg";		//Background Image
	
	themeArray[49-1][0] = "cabinetLayout";			//Theme Name	
	themeArray[49-1][1] = "/mgck/uploads/Wj/9E/Wj9E6iOnH5ARBLlU2ViL0A/ch_cabinet_bkgd.jpg";		//Background Image
	
	themeArray[50-1][0] = "cabinetLayout";			//Theme Name	
	themeArray[50-1][1] = "/mgck/uploads/4q/9J/4q9JcfB1Ncdem2GD0eTN_g/ch_cabinet_bkgd.jpg";		//Background Image
	
	themeArray[51-1][0] = "cairoLayout";			//Theme Name	
	themeArray[51-1][1] = "/mgck/uploads/zV/J1/zVJ1uvZew208Vn6VNX10EQ/CH_cairo_bkgd.jpg";		//Background Image
	
	themeArray[52-1][0] = "cairoLayout";			//Theme Name	
	themeArray[52-1][1] = "/mgck/uploads/KW/7J/KW7Jlvbid2_q8WV3LQGSkA/CH_cairo_bkgd.jpg";		//Background Image
	
	themeArray[53-1][0] = "cairoLayout";			//Theme Name	
	themeArray[53-1][1] = "/mgck/uploads/_n/-U/_n-Uv7Ki2mhrlqIxct6QdA/CH_cairo_bkgd.jpg";		//Background Image
	
	themeArray[54-1][0] = "cairoLayout";			//Theme Name	
	themeArray[54-1][1] = "/mgck/uploads/PJ/5t/PJ5tyfrXD69W-OZK0POZMA/CH_cairo_bkgd.jpg";		//Background Image
	
	themeArray[55-1][0] = "chinausLayout";			//Theme Name	
	themeArray[55-1][1] = "/mgck/uploads/yF/Nr/yFNrYh6qj4vkV_3VhuUwUA/CH_pandas_bkgd.jpg";		//Background Image
	
	themeArray[56-1][0] = "chinausLayout";			//Theme Name	
	themeArray[56-1][1] = "/mgck/uploads/j4/LO/j4LOKflMRvh23Pa3sWry-w/CH_pandas_bkgd.jpg";		//Background Image
	
	themeArray[57-1][0] = "chinausLayout";			//Theme Name	
	themeArray[57-1][1] = "/mgck/uploads/LS/ri/LSriD6PASolYXIP8E-6vLg/CH_pandas_bkgd.jpg";		//Background Image
	
	themeArray[58-1][0] = "chinausLayout";			//Theme Name	
	themeArray[58-1][1] = "/mgck/uploads/CH/XV/CHXVu8sgZYtW0283zbiZSA/CH_pandas_bkgd.jpg";		//Background Image
	
	themeArray[59-1][0] = "aids_chLayout";			//Theme Name	
	themeArray[59-1][1] = "/mgck/uploads/5B/iW/5BiWH6mk_OC7MJJxNQswEQ/ch_hands_bkgd.jpg";		//Background Image
	
	themeArray[60-1][0] = "aids_chLayout";			//Theme Name	
	themeArray[60-1][1] = "/mgck/uploads/Af/QW/AfQWy-NEzymRdbG0K5EM6A/ch_hands_bkgd.jpg";		//Background Image
	
	themeArray[61-1][0] = "aids_chLayout";			//Theme Name	
	themeArray[61-1][1] = "/mgck/uploads/7E/BW/7EBWiP7K39Ye7HdHRbMyDQ/ch_hands_bkgd.jpg";		//Background Image
	
	themeArray[62-1][0] = "aids_chLayout";			//Theme Name	
	themeArray[62-1][1] = "/mgck/uploads/FD/Db/FDDbW2wZ8UyiqBhuG8HuEw/ch_hands_bkgd.jpg";		//Background Image
	
	themeArray[63-1][0] = "corruption_chLayout";			//Theme Name	
	themeArray[63-1][1] = "/mgck/uploads/8k/Ul/8kUlXC5r6R9Sk5aau1Eiug/CH_corruption_bkgd.jpg";		//Background Image
	
	themeArray[64-1][0] = "corruption_chLayout";			//Theme Name	
	themeArray[64-1][1] = "/mgck/uploads/u8/4o/u84om4QG5X73c-ZuOiQcgQ/CH_corruption_bkgd.jpg";		//Background Image
	
	themeArray[65-1][0] = "corruption_chLayout";			//Theme Name	
	themeArray[65-1][1] = "/mgck/uploads/7r/gu/7rguS9y_oH-jwnMCuppg0Q/CH_corruption_bkgd.jpg";		//Background Image
	
	themeArray[66-1][0] = "corruption_chLayout";			//Theme Name	
	themeArray[66-1][1] = "/mgck/uploads/F9/gc/F9gcHIUU2h43uvKbtOccUg/CH_corruption_bkgd.jpg";		//Background Image
	
	themeArray[67-1][0] = "reviving_trade_chLayout";			//Theme Name	
	themeArray[67-1][1] = "/mgck/uploads/BD/Yo/BDYoPg0eM37Hh3ca_RClgw/CH_trade_bkgd.jpg";		//Background Image
	
	themeArray[68-1][0] = "reviving_trade_chLayout";			//Theme Name	
	themeArray[68-1][1] = "/mgck/uploads/OL/Jn/OLJnpiTjHa5BXuAc4c4hxw/CH_trade_bkgd.jpg";		//Background Image
	
	themeArray[69-1][0] = "reviving_trade_chLayout";			//Theme Name	
	themeArray[69-1][1] = "/mgck/uploads/A6/yp/A6ypZsStqt8DC3O0sVY0pA/CH_trade_bkgd.jpg";		//Background Image
	
	themeArray[70-1][0] = "reviving_trade_chLayout";			//Theme Name	
	themeArray[70-1][1] = "/mgck/uploads/jT/ah/jTahQR3MUPWiFn5_HZuO4A/CH_trade_bkgd.jpg";		//Background Image
	
	themeArray[71-1][0] = "university_prog_chLayout";			//Theme Name	
	themeArray[71-1][1] = "/mgck/uploads/bo/_k/bo_kRpwam201otWd7DNBew/Top_UniversityDesignBG-copy.jpg";		//Background Image
	
	themeArray[72-1][0] = "university_prog_chLayout";			//Theme Name	
	themeArray[72-1][1] = "/mgck/uploads/CU/ve/CUveNnTYLwDR2McLceCdyw/Top_UniversityDesignBG-copy.jpg";		//Background Image
	
	themeArray[73-1][0] = "university_prog_chLayout";			//Theme Name	
	themeArray[73-1][1] = "/mgck/uploads/ad/LR/adLRcA2dXRtoPpCzH7MwnQ/Top_UniversityDesignBG-copy.jpg";		//Background Image
	
	themeArray[74-1][0] = "university_prog_chLayout";			//Theme Name	
	themeArray[74-1][1] = "/mgck/uploads/RH/1j/RH1jtxG48y0MG7acSHFCNA/Top_UniversityDesignBG-copy.jpg";		//Background Image
	
	themeArray[75-1][0] = "gateway_commcoll_chLayout";			//Theme Name	
	themeArray[75-1][1] = "/mgck/uploads/mD/-4/mD-4AdHZAMslPys9CjbAcA/CH_opportunity_bkgd.jpg";		//Background Image
	
	themeArray[76-1][0] = "gateway_commcoll_chLayout";			//Theme Name	
	themeArray[76-1][1] = "/mgck/uploads/9W/pe/9WpewEVaQ_c9pdu35yD1TA/CH_opportunity_bkgd.jpg";		//Background Image
	
	themeArray[77-1][0] = "gateway_commcoll_chLayout";			//Theme Name	
	themeArray[77-1][1] = "/mgck/uploads/0s/tB/0stBf8vI2tYqldu8N_ST-A/CH_opportunity_bkgd.jpg";		//Background Image
	
	themeArray[78-1][0] = "gateway_commcoll_chLayout";			//Theme Name	
	themeArray[78-1][1] = "/mgck/uploads/Jv/My/JvMyD1PXUSwc07iLJo3fqg/CH_opportunity_bkgd.jpg";		//Background Image
	
	themeArray[79-1][0] = "national_park_chLayout";			//Theme Name	
	themeArray[79-1][1] = "/mgck/uploads/_n/Fr/_nFrfXNFn0bzFn6ILDw2bQ/CH_parks_bkgd.jpg";		//Background Image
	
	themeArray[80-1][0] = "national_park_chLayout";			//Theme Name	
	themeArray[80-1][1] = "/mgck/uploads/1o/-i/1o-iUuMFcoZYoO0dnfouGA/CH_parks_bkgd.jpg";		//Background Image
	
	themeArray[81-1][0] = "national_park_chLayout";			//Theme Name	
	themeArray[81-1][1] = "/mgck/uploads/0z/7T/0z7TEztenQgFi32vbmtTig/CH_parks_bkgd.jpg";		//Background Image
	
	themeArray[82-1][0] = "national_park_chLayout";			//Theme Name	
	themeArray[82-1][1] = "/mgck/uploads/Bm/EY/BmEYnVfu2wal1mQ_gSN_Pw/CH_parks_bkgd.jpg";		//Background Image
	
	themeArray[83-1][0] = "patchwork_chLayout";			//Theme Name	
	themeArray[83-1][1] = "/mgck/uploads/-J/UO/-JUOE2siQRzXCyi3LNvZDg/CH_identity_bkgd.jpg";		//Background Image
	
	themeArray[84-1][0] = "patchwork_chLayout";			//Theme Name	
	themeArray[84-1][1] = "/mgck/uploads/FE/m0/FEm0dIcnmcAGMmJ5LFxIGg/CH_identity_bkgd.jpg";		//Background Image
	
	themeArray[85-1][0] = "patchwork_chLayout";			//Theme Name	
	themeArray[85-1][1] = "/mgck/uploads/Sb/rr/SbrrbHUHAFhQjEK9ACp6Qw/CH_identity_bkgd.jpg";		//Background Image
	
	themeArray[86-1][0] = "patchwork_chLayout";			//Theme Name	
	themeArray[86-1][1] = "/mgck/uploads/gS/Y2/gSY2PnKvSLEnvrZi8R_M8w/CH_identity_bkgd.jpg";		//Background Image
	
	themeArray[87-1][0] = "obamaghanaLayout";			//Theme Name	
	themeArray[87-1][1] = "/mgck/uploads/NJ/hm/NJhm0kpRVMJphsh70eBlfA/Ghana-Obama3-bkgd.jpg";		//Background Image
	
	themeArray[88-1][0] = "obamaghanaLayout";			//Theme Name	
	themeArray[88-1][1] = "/mgck/uploads/KB/qm/KBqmSaDtGURL_-pCiSLo_w/Ghana-Obama3-bkgd.jpg";		//Background Image
	
	themeArray[89-1][0] = "obamaghanaLayout";			//Theme Name	
	themeArray[89-1][1] = "/mgck/uploads/P9/hp/P9hp9UbOeuIhvC64xXtzWw/Ghana-Obama3-bkgd.jpg";		//Background Image
	
	themeArray[90-1][0] = "obamaghanaLayout";			//Theme Name	
	themeArray[90-1][1] = "/mgck/uploads/dB/zl/dBzl9au0OCccKbxXTeUT6g/Ghana-Obama3-bkgd.jpg";		//Background Image
	
	themeArray[91-1][0] = "july4th2009Layout";			//Theme Name	
	themeArray[91-1][1] = "/mgck/uploads/64/1Y/641YZAu03MaeQP96gavL2A/4thofjuly-bkgd.jpg";		//Background Image
	
	themeArray[92-1][0] = "july4th2009Layout";			//Theme Name	
	themeArray[92-1][1] = "/mgck/uploads/ZT/D6/ZTD6oh9BX0Mz8soSEVXXkQ/4thofjuly-bkgd.jpg";		//Background Image
	
	themeArray[93-1][0] = "july4th2009Layout";			//Theme Name	
	themeArray[93-1][1] = "/mgck/uploads/zt/1k/zt1knP5l6hb52o5GhKIPrg/4thofjuly-bkgd.jpg";		//Background Image
	
	themeArray[94-1][0] = "july4th2009Layout";			//Theme Name	
	themeArray[94-1][1] = "/mgck/uploads/OE/mp/OEmpLYeNbhQIIyVZwVPayw/4thofjuly-bkgd.jpg";		//Background Image
	
	themeArray[95-1][0] = "carbonLayout";			//Theme Name	
	themeArray[95-1][1] = "/mgck/uploads/HP/ah/HPahqvjhyjVkJoAGDVTfIQ/cc_map_cycle_01.jpg";		//Background Image
	
	themeArray[96-1][0] = "carbonLayout";			//Theme Name	
	themeArray[96-1][1] = "/mgck/uploads/t3/wT/t3wTkxbaS8ylINd4UY_fSw/cc_map_cycle_01.jpg";		//Background Image
	
	themeArray[97-1][0] = "carbonLayout";			//Theme Name	
	themeArray[97-1][1] = "/mgck/uploads/iT/RE/iTRE7q-WfvpnhdtTG7W9Bg/cc_map_cycle_01.jpg";		//Background Image
	
	themeArray[98-1][0] = "carbonLayout";			//Theme Name	
	themeArray[98-1][1] = "/mgck/uploads/iz/rS/izrS3SkpTRrNDL5jyfRSQw/cc_map_cycle_01.jpg";		//Background Image
	
	themeArray[99-1][0] = "obamaLayout";			//Theme Name	
	themeArray[99-1][1] = "/mgck/uploads/af/_N/af_NwHI8Tkb9_h7hc-sOYA/MeetBarackObama_bkgd.jpg";		//Background Image
	
	themeArray[100-1][0] = "obamaLayout";			//Theme Name	
	themeArray[100-1][1] = "/mgck/uploads/sf/ZK/sfZKWeWTR_e-cIlZk-LWPw/MeetBarackObama_bkgd.jpg";		//Background Image
	
	themeArray[101-1][0] = "obamaLayout";			//Theme Name	
	themeArray[101-1][1] = "/mgck/uploads/PH/mt/PHmtK4uSzlB4zLD9z13bnQ/MeetBarackObama_bkgd.jpg";		//Background Image
	
	themeArray[102-1][0] = "obamaLayout";			//Theme Name	
	themeArray[102-1][1] = "/mgck/uploads/63/32/6332NTFt4LgL5Pi-tVGevQ/MeetBarackObama_bkgd.jpg";		//Background Image
	
	themeArray[103-1][0] = "digitallibraryLayout";			//Theme Name	
	themeArray[103-1][1] = "/mgck/uploads/2J/HQ/2JHQDQ14r-gSt33oryntNA/digitallibrary-bkgd.jpg";		//Background Image
	
	themeArray[104-1][0] = "digitallibraryLayout";			//Theme Name	
	themeArray[104-1][1] = "/mgck/uploads/4Y/85/4Y85lTqiTAJ3VoJIuN9p4g/digitallibrary-bkgd.jpg";		//Background Image
	
	themeArray[105-1][0] = "digitallibraryLayout";			//Theme Name	
	themeArray[105-1][1] = "/mgck/uploads/sk/-6/sk-6fMx4Z7tfWOfR1Fgtyw/digitallibrary-bkgd.jpg";		//Background Image
	
	themeArray[106-1][0] = "digitallibraryLayout";			//Theme Name	
	themeArray[106-1][1] = "/mgck/uploads/_d/UI/_dUIar9wT72gsFykcu1hAA/digitallibrary-bkgd.jpg";		//Background Image
	
	themeArray[107-1][0] = "waterusageLayout";			//Theme Name	
	themeArray[107-1][1] = "/mgck/uploads/0x/lw/0xlwvTHb01KOrLpCPDg-rw/coloradoriver6-bkgd.jpg";		//Background Image
	
	themeArray[108-1][0] = "waterusageLayout";			//Theme Name	
	themeArray[108-1][1] = "/mgck/uploads/9f/IE/9fIEvULhnI4CmytprEA3Dw/coloradoriver6-bkgd.jpg";		//Background Image
	
	themeArray[109-1][0] = "waterusageLayout";			//Theme Name	
	themeArray[109-1][1] = "/mgck/uploads/uG/_o/uG_oin_oCTD9TWAD3acKpw/coloradoriver6-bkgd.jpg";		//Background Image
	
	themeArray[110-1][0] = "waterusageLayout";			//Theme Name	
	themeArray[110-1][1] = "/mgck/uploads/VI/2u/VI2uZnEAPQg68rU_LjAOtw/coloradoriver6-bkgd.jpg";		//Background Image
	
	themeArray[111-1][0] = "space_commercializationLayout";			//Theme Name	
	themeArray[111-1][1] = "/mgck/uploads/4S/OQ/4SOQirVjWq9TQ-T0HD3X0Q/space3-bkgd.jpg";		//Background Image
	
	themeArray[112-1][0] = "space_commercializationLayout";			//Theme Name	
	themeArray[112-1][1] = "/mgck/uploads/ye/5p/ye5p8bqbtcY8KVFk3KFMkA/space3-bkgd.jpg";		//Background Image
	
	themeArray[113-1][0] = "space_commercializationLayout";			//Theme Name	
	themeArray[113-1][1] = "/mgck/uploads/Gn/IA/GnIAqTiObSn66UUwawlIWg/space3-bkgd.jpg";		//Background Image
	
	themeArray[114-1][0] = "space_commercializationLayout";			//Theme Name	
	themeArray[114-1][1] = "/mgck/uploads/TQ/ic/TQicCyS2ehY0F2EXnTI_xA/space3-bkgd.jpg";		//Background Image
	
	themeArray[115-1][0] = "revivetradeLayout";			//Theme Name	
	themeArray[115-1][1] = "/mgck/uploads/Ww/0m/Ww0mBVwHJ2uthLAPnQ7DZA/tradefinance-bkgd.jpg";		//Background Image
	
	themeArray[116-1][0] = "revivetradeLayout";			//Theme Name	
	themeArray[116-1][1] = "/mgck/uploads/BX/zF/BXzFs0OcAJH52Qfxw4lLIw/tradefinance-bkgd.jpg";		//Background Image
	
	themeArray[117-1][0] = "revivetradeLayout";			//Theme Name	
	themeArray[117-1][1] = "/mgck/uploads/pG/YW/pGYW0cA0xjjZ5Fu3D-csTA/tradefinance-bkgd.jpg";		//Background Image
	
	themeArray[118-1][0] = "revivetradeLayout";			//Theme Name	
	themeArray[118-1][1] = "/mgck/uploads/dU/lv/dUlvaRwIpWScN8c8EK2ZzA/tradefinance-bkgd.jpg";		//Background Image
	
	themeArray[119-1][0] = "piracyLayout";			//Theme Name	
	themeArray[119-1][1] = "/mgck/uploads/ro/VV/roVV8rPV5oHVVZBpbx2N2g/combatingpiracy-bkgd.jpg";		//Background Image
	
	themeArray[120-1][0] = "piracyLayout";			//Theme Name	
	themeArray[120-1][1] = "/mgck/uploads/Wp/xF/WpxFA1rnjtKtyi5tfOocxg/combatingpiracy-bkgd.jpg";		//Background Image
	
	themeArray[121-1][0] = "piracyLayout";			//Theme Name	
	themeArray[121-1][1] = "/mgck/uploads/Kb/YO/KbYOdoJHVW0Kfu-WuPqwKQ/combatingpiracy-bkgd.jpg";		//Background Image
	
	themeArray[122-1][0] = "piracyLayout";			//Theme Name	
	themeArray[122-1][1] = "/mgck/uploads/xE/FO/xEFOabSCuET1k5y_2tXHHg/combatingpiracy-bkgd.jpg";		//Background Image
	
	themeArray[123-1][0] = "anticorruptionLayout";			//Theme Name	
	themeArray[123-1][1] = "/mgck/uploads/v5/1M/v51McDamwwgSb8iMyFT80w/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[124-1][0] = "anticorruptionLayout";			//Theme Name	
	themeArray[124-1][1] = "/mgck/uploads/lk/UU/lkUUHl6bPL0yo0xISmELrg/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[125-1][0] = "anticorruptionLayout";			//Theme Name	
	themeArray[125-1][1] = "/mgck/uploads/YP/sm/YPsmcjN_VMS0OolGGV3dTA/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[126-1][0] = "anticorruptionLayout";			//Theme Name	
	themeArray[126-1][1] = "/mgck/uploads/a3/qF/a3qFMi4dGM6QvKBzpe5dQw/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[127-1][0] = "financecorruptionLayout";			//Theme Name	
	themeArray[127-1][1] = "/mgck/uploads/ww/2v/ww2vnwHYgDqpmROCKR80xw/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[128-1][0] = "financecorruptionLayout";			//Theme Name	
	themeArray[128-1][1] = "/mgck/uploads/mR/BW/mRBWpSQkguTqgUyZw612ww/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[129-1][0] = "financecorruptionLayout";			//Theme Name	
	themeArray[129-1][1] = "/mgck/uploads/xb/EO/xbEOpaHKrKR_8IwE7ZLGgA/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[130-1][0] = "financecorruptionLayout";			//Theme Name	
	themeArray[130-1][1] = "/mgck/uploads/F6/tu/F6tuJRbfSBztJj_S3gUdQQ/corruption-bkgd3b.jpg";		//Background Image
	
	themeArray[131-1][0] = "womencourageLayout";			//Theme Name	
	themeArray[131-1][1] = "/mgck/uploads/17/kg/17kgBsfdvuBxHtoxoJtHKg/womenofcourage-bkgd.jpg";		//Background Image
	
	themeArray[132-1][0] = "womencourageLayout";			//Theme Name	
	themeArray[132-1][1] = "/mgck/uploads/I7/iU/I7iUoLgAKKFBEpGqantnKg/womenofcourage-bkgd.jpg";		//Background Image
	
	themeArray[133-1][0] = "womencourageLayout";			//Theme Name	
	themeArray[133-1][1] = "/mgck/uploads/C9/05/C905H88fHBmiDClB6Sm43A/womenofcourage-bkgd.jpg";		//Background Image
	
	themeArray[134-1][0] = "womencourageLayout";			//Theme Name	
	themeArray[134-1][1] = "/mgck/uploads/NM/h6/NMh6NGos3tp9CT1I6iglEg/womenofcourage-bkgd.jpg";		//Background Image
	
	themeArray[135-1][0] = "swinefluLayout";			//Theme Name	
	themeArray[135-1][1] = "/mgck/uploads/Eg/XR/EgXRNTcauMuTvqcJdJiPNQ/swineflu-bkgd_2.jpg";		//Background Image
	
	themeArray[136-1][0] = "swinefluLayout";			//Theme Name	
	themeArray[136-1][1] = "/mgck/uploads/Qp/Al/QpAlib4yoADBXnOpgidyBw/swineflu-bkgd_2.jpg";		//Background Image
	
	themeArray[137-1][0] = "swinefluLayout";			//Theme Name	
	themeArray[137-1][1] = "/mgck/uploads/bX/eZ/bXeZZl77zsfsNPJ-jrH8jQ/swineflu-bkgd_2.jpg";		//Background Image
	
	themeArray[138-1][0] = "swinefluLayout";			//Theme Name	
	themeArray[138-1][1] = "/mgck/uploads/NB/yT/NByTb92xIlMKDBFv-hYUOg/swineflu-bkgd_2.jpg";		//Background Image
	
	themeArray[139-1][0] = "contrastscapitalismLayout";			//Theme Name	
	themeArray[139-1][1] = "/mgck/uploads/yj/07/yj07iEZW1IAZELWq7s9bhA/contrastincapitalism4-bkgd.jpg";		//Background Image
	
	themeArray[140-1][0] = "contrastscapitalismLayout";			//Theme Name	
	themeArray[140-1][1] = "/mgck/uploads/z2/0C/z20ChVx_xW6AWDa6nsg4BA/contrastincapitalism4-bkgd.jpg";		//Background Image
	
	themeArray[141-1][0] = "contrastscapitalismLayout";			//Theme Name	
	themeArray[141-1][1] = "/mgck/uploads/5f/Tm/5fTm7SBq5A1JsI887dc38A/contrastincapitalism4-bkgd.jpg";		//Background Image
	
	themeArray[142-1][0] = "contrastscapitalismLayout";			//Theme Name	
	themeArray[142-1][1] = "/mgck/uploads/6b/sj/6bsjysQiwqTTwSC6xE4euQ/contrastincapitalism4-bkgd.jpg";		//Background Image
	
	themeArray[143-1][0] = "constitutionLayout";			//Theme Name	
	themeArray[143-1][1] = "/mgck/uploads/rf/Pd/rfPdtGw-j1wX31Te35gw7g/constitution-bkgd4.jpg";		//Background Image
	
	themeArray[144-1][0] = "constitutionLayout";			//Theme Name	
	themeArray[144-1][1] = "/mgck/uploads/RU/FP/RUFPKTLnOz2w2SKjWBLn-w/constitution-bkgd4.jpg";		//Background Image
	
	themeArray[145-1][0] = "constitutionLayout";			//Theme Name	
	themeArray[145-1][1] = "/mgck/uploads/WJ/De/WJDeGdjJOJfWkcXntlENLQ/constitution-bkgd4.jpg";		//Background Image
	
	themeArray[146-1][0] = "constitutionLayout";			//Theme Name	
	themeArray[146-1][1] = "/mgck/uploads/m6/dz/m6dzx6zCAKIZfU0RrKhaJQ/constitution-bkgd4.jpg";		//Background Image
	
	themeArray[147-1][0] = "passportsLayout";			//Theme Name	
	themeArray[147-1][1] = "/mgck/uploads/Dz/zc/DzzchIOEhlXQpms4mtmEpQ/passportvisas-bkgd.jpg";		//Background Image
	
	themeArray[148-1][0] = "passportsLayout";			//Theme Name	
	themeArray[148-1][1] = "/mgck/uploads/kc/qw/kcqwaZZRX1tzS9msabMl5A/passportvisas-bkgd.jpg";		//Background Image
	
	themeArray[149-1][0] = "passportsLayout";			//Theme Name	
	themeArray[149-1][1] = "/mgck/uploads/gt/9x/gt9xxejAB4Dflry32p9rjg/passportvisas-bkgd.jpg";		//Background Image
	
	themeArray[150-1][0] = "passportsLayout";			//Theme Name	
	themeArray[150-1][1] = "/mgck/uploads/m_/JO/m_JOjJnyfk7FNGW9I2qShQ/passportvisas-bkgd.jpg";		//Background Image
	
	themeArray[151-1][0] = "moneytransfersLayout";			//Theme Name	
	themeArray[151-1][1] = "/mgck/uploads/6m/w-/6mw-fvf1wAAO0G3FZPpp7A/remittances2.jpg";		//Background Image
	
	themeArray[152-1][0] = "moneytransfersLayout";			//Theme Name	
	themeArray[152-1][1] = "/mgck/uploads/Rh/oU/RhoUacK8fVG6baiDh-Arcg/remittances2.jpg";		//Background Image
	
	themeArray[153-1][0] = "moneytransfersLayout";			//Theme Name	
	themeArray[153-1][1] = "/mgck/uploads/DN/1N/DN1NJNIzECVAnHpMqiR01Q/remittances2.jpg";		//Background Image
	
	themeArray[154-1][0] = "moneytransfersLayout";			//Theme Name	
	themeArray[154-1][1] = "/mgck/uploads/WD/cU/WDcUsZiC3P1c14LwPWuwDQ/remittances2.jpg";		//Background Image
	
	themeArray[155-1][0] = "climatechangeLayout";			//Theme Name	
	themeArray[155-1][1] = "/mgck/uploads/6e/UL/6eULe3LSJlovHYPA02B31Q/Campaign-climate-bkgd-2.jpg";		//Background Image
	
	themeArray[156-1][0] = "climatechangeLayout";			//Theme Name	
	themeArray[156-1][1] = "/mgck/uploads/4S/mx/4SmxlRqGBh1aWqBltTvG1w/Campaign-climate-bkgd-2.jpg";		//Background Image
	
	themeArray[157-1][0] = "climatechangeLayout";			//Theme Name	
	themeArray[157-1][1] = "/mgck/uploads/2t/WO/2tWO5KXbKxwz10LY6msW4A/Campaign-climate-bkgd-2.jpg";		//Background Image
	
	themeArray[158-1][0] = "climatechangeLayout";			//Theme Name	
	themeArray[158-1][1] = "/mgck/uploads/Gx/nR/GxnR6JZ7Gtg2sQiS0tQmrw/Campaign-climate-bkgd-2.jpg";		//Background Image
	
	themeArray[159-1][0] = "summitLayout";			//Theme Name	
	themeArray[159-1][1] = "/mgck/uploads/-s/Rc/-sRcg-T-vsHMVkA2K0jTNw/summit_americas_bkgnd.jpg";		//Background Image
	
	themeArray[160-1][0] = "summitLayout";			//Theme Name	
	themeArray[160-1][1] = "/mgck/uploads/I1/Ao/I1AoJGOIbEoAmPlfMIqyoQ/summit_americas_bkgnd.jpg";		//Background Image
	
	themeArray[161-1][0] = "summitLayout";			//Theme Name	
	themeArray[161-1][1] = "/mgck/uploads/cb/Le/cbLe5V60969-KNU_2qXEOQ/summit_americas_bkgnd.jpg";		//Background Image
	
	themeArray[162-1][0] = "summitLayout";			//Theme Name	
	themeArray[162-1][1] = "/mgck/uploads/Ta/sQ/TasQkSMmFjK9blrAze-Zfg/summit_americas_bkgnd.jpg";		//Background Image
	
	themeArray[163-1][0] = "nonviolenceLayout";			//Theme Name	
	themeArray[163-1][1] = "/mgck/uploads/Ov/Zj/OvZjQVX9RBxHPmTJwITm3A/nonviolence_bkgnd.jpg";		//Background Image
	
	themeArray[164-1][0] = "nonviolenceLayout";			//Theme Name	
	themeArray[164-1][1] = "/mgck/uploads/aE/QK/aEQKDLz2l6x1ChKp4ZaoIg/nonviolence_bkgnd.jpg";		//Background Image
	
	themeArray[165-1][0] = "nonviolenceLayout";			//Theme Name	
	themeArray[165-1][1] = "/mgck/uploads/AK/F8/AKF8TV1s4hJvKINeT6EG-g/nonviolence_bkgnd.jpg";		//Background Image
	
	themeArray[166-1][0] = "nonviolenceLayout";			//Theme Name	
	themeArray[166-1][1] = "/mgck/uploads/lU/az/lUazOEFIo10RpTPwiOVHzw/nonviolence_bkgnd.jpg";		//Background Image
	
	themeArray[167-1][0] = "americanindiansLayout";			//Theme Name	
	themeArray[167-1][1] = "/mgck/uploads/5e/Mi/5eMiP7SYWky_htj06DFx2w/AmericaIndian_layout_final_.jpg";		//Background Image
	
	themeArray[168-1][0] = "americanindiansLayout";			//Theme Name	
	themeArray[168-1][1] = "/mgck/uploads/Rf/eb/RfebCbYmQPW_fucGg-TovQ/AmericaIndian_layout_final_.jpg";		//Background Image
	
	themeArray[169-1][0] = "americanindiansLayout";			//Theme Name	
	themeArray[169-1][1] = "/mgck/uploads/W0/XI/W0XIwkO5rn9Jd6GgBmpuww/AmericaIndian_layout_final_.jpg";		//Background Image
	
	themeArray[170-1][0] = "americanindiansLayout";			//Theme Name	
	themeArray[170-1][1] = "/mgck/uploads/aJ/Tj/aJTjgWLeZZt9Eo5nSCnCog/AmericaIndian_layout_final_.jpg";		//Background Image
	
	themeArray[171-1][0] = "natoLayout";			//Theme Name	
	themeArray[171-1][1] = "/mgck/uploads/hU/z9/hUz93TmNR2pzBj2s8AkqDQ/nato_bckgrnd.jpg";		//Background Image
	
	themeArray[172-1][0] = "natoLayout";			//Theme Name	
	themeArray[172-1][1] = "/mgck/uploads/-Y/KN/-YKNtfD0d9QU_IuECNIRTg/nato_bckgrnd.jpg";		//Background Image
	
	themeArray[173-1][0] = "natoLayout";			//Theme Name	
	themeArray[173-1][1] = "/mgck/uploads/0z/-0/0z-0L67m0fIKx70P9Q0p9w/nato_bckgrnd.jpg";		//Background Image
	
	themeArray[174-1][0] = "natoLayout";			//Theme Name	
	themeArray[174-1][1] = "/mgck/uploads/b0/HP/b0HPAElj_nb2gRARqMHgDA/nato_bckgrnd.jpg";		//Background Image
	
	themeArray[175-1][0] = "undeclarationLayout";			//Theme Name	
	themeArray[175-1][1] = "/mgck/uploads/sn/zJ/snzJfPt3soPljp9RoJ1RGw/UN_declaration2_bkgnd.jpg";		//Background Image
	
	themeArray[176-1][0] = "undeclarationLayout";			//Theme Name	
	themeArray[176-1][1] = "/mgck/uploads/8q/f-/8qf-iSQyu1wWJJyWn2rfiw/UN_declaration2_bkgnd.jpg";		//Background Image
	
	themeArray[177-1][0] = "undeclarationLayout";			//Theme Name	
	themeArray[177-1][1] = "/mgck/uploads/-o/-3/-o-3CCF0btcbdkEpOreWAg/UN_declaration2_bkgnd.jpg";		//Background Image
	
	themeArray[178-1][0] = "undeclarationLayout";			//Theme Name	
	themeArray[178-1][1] = "/mgck/uploads/Ou/Pu/OuPuRBPGWPtyXGp-2nkWyA/UN_declaration2_bkgnd.jpg";		//Background Image
	
	themeArray[179-1][0] = "womeningovtLayout";			//Theme Name	
	themeArray[179-1][1] = "/mgck/uploads/vM/r8/vMr8nRSt-yLCCTiMPR6B6Q/Campaign-cracking-bkgd.jpg";		//Background Image
	
	themeArray[180-1][0] = "womeningovtLayout";			//Theme Name	
	themeArray[180-1][1] = "/mgck/uploads/UX/2O/UX2O_wRrOmCWl-VqhZeFVw/Campaign-cracking-bkgd.jpg";		//Background Image
	
	themeArray[181-1][0] = "womeningovtLayout";			//Theme Name	
	themeArray[181-1][1] = "/mgck/uploads/sd/K-/sdK-sJ7Ze1qYQC8oyank0Q/Campaign-cracking-bkgd.jpg";		//Background Image
	
	themeArray[182-1][0] = "womeningovtLayout";			//Theme Name	
	themeArray[182-1][1] = "/mgck/uploads/fW/Ol/fWOlCe8f1MIvg_t5-zXYEg/Campaign-cracking-bkgd.jpg";		//Background Image
	
	themeArray[183-1][0] = "flushingLayout";			//Theme Name	
	themeArray[183-1][1] = "/mgck/uploads/WN/D1/WND11uAV2oLt0VId4mmH0g/flushing_bkgnd2.jpg";		//Background Image
	
	themeArray[184-1][0] = "flushingLayout";			//Theme Name	
	themeArray[184-1][1] = "/mgck/uploads/z1/Pl/z1PliIItpXpUBaZhIHpooQ/flushing_bkgnd2.jpg";		//Background Image
	
	themeArray[185-1][0] = "flushingLayout";			//Theme Name	
	themeArray[185-1][1] = "/mgck/uploads/XC/yp/XCyp-pX2UY8zJ35AGd-y4Q/flushing_bkgnd2.jpg";		//Background Image
	
	themeArray[186-1][0] = "flushingLayout";			//Theme Name	
	themeArray[186-1][1] = "/mgck/uploads/yN/3M/yN3MTkfobrJR9-RDlfSHHA/flushing_bkgnd2.jpg";		//Background Image
	
	themeArray[187-1][0] = "identityLayout";			//Theme Name	
	themeArray[187-1][1] = "/mgck/uploads/p-/oc/p-oc2OLIRsxaJk5Y5uHGPw/Identity_bkgd.jpg";		//Background Image
	
	themeArray[188-1][0] = "identityLayout";			//Theme Name	
	themeArray[188-1][1] = "/mgck/uploads/Mr/CL/MrCLOn1aHPhbdQLegeDPlg/Identity_bkgd.jpg";		//Background Image
	
	themeArray[189-1][0] = "identityLayout";			//Theme Name	
	themeArray[189-1][1] = "/mgck/uploads/fp/GV/fpGVwC_t9JlZTZ7aF8YO9w/Identity_bkgd.jpg";		//Background Image
	
	themeArray[190-1][0] = "identityLayout";			//Theme Name	
	themeArray[190-1][1] = "/mgck/uploads/_v/3T/_v3TitJugyp2Wx-adBBhnQ/Identity_bkgd.jpg";		//Background Image
	
	themeArray[191-1][0] = "topuniversitiesLayout";			//Theme Name	
	themeArray[191-1][1] = "/mgck/uploads/-X/Au/-XAuZs6W9XnGkUQJaeX3fA/TopUniversity_bkgd.jpg";		//Background Image
	
	themeArray[192-1][0] = "topuniversitiesLayout";			//Theme Name	
	themeArray[192-1][1] = "/mgck/uploads/v7/9Q/v79QKAmpllUNdOnqFsK3LA/TopUniversity_bkgd.jpg";		//Background Image
	
	themeArray[193-1][0] = "topuniversitiesLayout";			//Theme Name	
	themeArray[193-1][1] = "/mgck/uploads/bc/7E/bc7EekEno6PLBJpbhw8pzQ/TopUniversity_bkgd.jpg";		//Background Image
	
	themeArray[194-1][0] = "topuniversitiesLayout";			//Theme Name	
	themeArray[194-1][1] = "/mgck/uploads/Lw/7t/Lw7tXrmIsbI_lLMRISA0jQ/TopUniversity_bkgd.jpg";		//Background Image
	
	themeArray[195-1][0] = "nationalparksLayout";			//Theme Name	
	themeArray[195-1][1] = "/mgck/uploads/gN/Yy/gNYyQhpWX0NdRG--Fm-Vcw/Campaign-passports-bkgd.jpg";		//Background Image
	
	themeArray[196-1][0] = "nationalparksLayout";			//Theme Name	
	themeArray[196-1][1] = "/mgck/uploads/45/PT/45PT5f6dGJfmhTKSx7oybQ/Campaign-passports-bkgd.jpg";		//Background Image
	
	themeArray[197-1][0] = "nationalparksLayout";			//Theme Name	
	themeArray[197-1][1] = "/mgck/uploads/IL/SE/ILSEDbjj_nyGqZ9YzyDM4g/Campaign-passports-bkgd.jpg";		//Background Image
	
	themeArray[198-1][0] = "nationalparksLayout";			//Theme Name	
	themeArray[198-1][1] = "/mgck/uploads/6V/PL/6VPLGl-NUAF-Ibb78d9eJg/Campaign-passports-bkgd.jpg";		//Background Image
	
	themeArray[199-1][0] = "surveillanceLayout";			//Theme Name	
	themeArray[199-1][1] = "/mgck/uploads/Up/GN/UpGNYlPrJe6JVlbFQ3b-AQ/campaign-ids-bkgd2.jpg";		//Background Image
	
	themeArray[200-1][0] = "surveillanceLayout";			//Theme Name	
	themeArray[200-1][1] = "/mgck/uploads/l7/1S/l71SRHovgYnaxHqVJmNNuA/campaign-ids-bkgd2.jpg";		//Background Image
	
	
	
	for(i=0;i<counter;i++)		
		if(themeName == themeArray[i][0]) {			
			var bckImg = document.getElementById(elementId);
			var ifImage = bckImg.getElementsByTagName('img');
			if(ifImage.length > 0)
				bckImg.removeChild(ifImage[0])
			var newImg = document.createElement('img');
			newImg.setAttribute('src',themeArray[i][1]);
			newImg.setAttribute('style','z-index:0;position:relative;top:0px;left:0px;');
			newImg.setAttribute('width',bckImgWidth);
			//imgHeight = (bckImgWidth < 500) ? '33%' : '100%';	
			newImg.setAttribute('height','*');			
			bckImg.appendChild(newImg);
		}
}


//################################################################################
//#			NAME: 		expandParent
//#			CALLED BY: 	Page Layout Manager (Thread)
//#			PURPOSE:	Resizes the containing element to allow all of the
//#						absolutely positioned items to not overflow
//################################################################################
function expandParent(parentEl) {
	var parentEl = document.getElementById(parentEl);
	var childEl = parentEl.getElementsByTagName('div');  
	var childImg = parentEl.getElementsByTagName('img');
	var dynaCells = new Array();
	var counter = 1;
	var finalVal = 0;
	var isProduction = 0;
	
	for(i=0;i<childEl.length;i++) {
		if(childEl[i].id.indexOf('dyna') != -1) isProduction = 1;
		if(childEl[i].className.indexOf('Layout') != -1) parentEl = childEl[i];
	}
			
	
	if(isProduction) {
		counter = 0;
		for(i=0;i<childEl.length;i++) {
			dynaCells[counter] = childEl[i].offsetTop + childEl[i].offsetHeight;
			counter++
		}
		counter = 1;
		
		for(i=0;i<dynaCells.length;i++) {
			if(i==dynaCells.length-1)
				counter = 0;
			
			if(dynaCells[i] >= dynaCells[counter]) {
				if(dynaCells[i] > finalVal)
					finalVal = dynaCells[i]
				
				//alert(i + "- " + dynaCells[i] + " vs." + dynaCells[counter] + " = " + finalVal);
			}
		}	

	}
	else {
		for(i=0;i<childEl.length;i++) {
			if(i==childEl.length - 1)
				counter = 0;
	
			if(childEl[i].offsetTop + childEl[i].offsetHeight > childEl[counter].offsetTop + childEl[counter].offsetHeight)
				finalVal = childEl[i].offsetTop + childEl[i].offsetHeight;
				
			counter++;			
		}
	}


	if(!isProduction)
		for(i=0;i<childImg.length;i++) {
			if(i==childImg.length -1)
				counter = 0;
				
			if(childImg[i].offsetHeight > finalVal) {
				finalVal = childImg[i].offsetHeight;		
				
			}
		}

	parentEl.setAttribute("style", "min-height:" + (finalVal + 16) + "px;height:auto !important;height:" + (finalVal + 16) + "px");
}


//################################################################################
//#			NAME: 		macroLayout
//#			CALLED BY: 	Page Layout Manager (Thread)
//#			PURPOSE:	Positions the layout squares based on the info provided
//#						via the Post Form
//################################################################################
function macroLayout(posValues,itemId) {
	var itemId = document.getElementById(itemId);
	if(posValues != '') {
		var posArray = posValues.split(",");
		itemId.style.top = posArray[0] + "px";
		itemId.style.left = posArray[1] + "px";
		itemId.style.width = posArray[2] + "px";
		itemId.style.display = "block";	
	}	
}


//################################################################################
//#			NAME: 		initializeDelete
//#			CALLED BY: 	Page Layout Manager (Thread)
//#			PURPOSE:	Takes the 'confirmDelete' box from the template, clones it
//#						removes the original and then attaches the clone to the 
//#						body of the document. This allows the box to be centered
//#						on the page no matter what layout is used. It also creates
//#						the dropshadow div.
//################################################################################
function intializeDelete() {
	var newDiv = document.createElement('div');
	var confirmDelete = document.getElementById('confirmDelete');
	var confirmClone = confirmDelete.cloneNode(true);
	
	newDiv.setAttribute('id','overlay');
	newDiv.setAttribute('style','display:none');		
	document.body.appendChild(newDiv);	
	
	confirmDelete.parentNode.removeChild(confirmDelete);
	document.body.appendChild(confirmClone);
}



//################################################################################
//#			NAME: 		confirmDelete
//#			CALLED BY: 	Page Layout Manager (Thread)
//#			PURPOSE:	Handles the appearance of the confirmDelete box and its
//#						dropshadow
//################################################################################
function confirmDelete(titleVal) {
	var confirmDelete = document.getElementById('confirmDelete');
	var deleteMessage = document.getElementById('deleteMessage');
	var overlayDiv = document.getElementById('overlay');
	deleteMessage.innerHTML = "Are you sure you wish to delete " + titleVal + "?";
	
	overlayDiv.style.display = "block";
	confirmDelete.style.display = "block";
	
	overlayDiv.style.width = confirmDelete.offsetWidth + "px";
	overlayDiv.style.height = confirmDelete.offsetHeight + "px";
			
	confirmDelete.style.left = ((document.body.clientWidth / 2) - (confirmDelete.offsetWidth / 2)) + "px";
	confirmDelete.style.top = ((document.body.clientHeight / 2) - confirmDelete.offsetHeight) + "px";
	overlayDiv.style.left = eval(x=confirmDelete.style.left.split('p')[0]) + 5 + "px";
	overlayDiv.style.top = eval(x=confirmDelete.style.top.split('p')[0]) + 5 + "px";

}


function addLayoutLink() {
	var usedLayouts = new Array("obamaLayout","identityLayout","climatechangeLayout","surveillanceLayout","swinefluLayout","financecorruptionLayout","dissentLayout","anticorruptionLayout","cairoLayout","revivetradeLayout","chinausLayout","nationalparksLayout","cabinetLayout","aidsLayout","topuniversitiesLayout","endangeredLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","green_designLayout","digitallibraryLayout","digitallibraryLayout","libraryLayout","green_carLayout","power_cellLayout","protecting_oceansLayout","bikesLayout","presidential_summitLayout");		//Supplies the populated usedLayouts array
	var themeNames = new Array("Theme ManagerLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","green_designLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","exampleLayout","marsLayout","americanindiansLayout","flushingLayout","surveillanceLayout","chinausLayout","alternativeenergyLayout","dissentLayout","greensburgLayout","jazzLayout","childsoldiersLayout","aidsLayout","nationalparksLayout","womeningovtLayout","undeclarationLayout","topuniversitiesLayout","identityLayout","cabinetLayout","endangeredLayout","obamaLayout","landingLayout","natoLayout","nonviolenceLayout","summitLayout","climatechangeLayout","moneytransfersLayout","swinefluLayout","passportsLayout","contrastscapitalismLayout","constitutionLayout","financecorruptionLayout","womencourageLayout","waterusageLayout","carbonLayout","anticorruptionLayout","cairoLayout","piracyLayout","revivetradeLayout","space_commercializationLayout","digitallibraryLayout","july4th2009Layout","obamaghanaLayout","patchwork_chLayout","national_park_chLayout","meet_obama_chLayout","gateway_commcoll_chLayout","university_prog_chLayout","reviving_trade_chLayout","corruption_chLayout","dissent_chLayout","human_rights_chLayout","aids_chLayout","climate_change_chLayout","demo_dev_chLayout","tracking_H1N1_chLayout","innovation_nation_chLayout","vanishing_act_chLayout","disease_surveillance_chLayout","foiaLayout","libraryLayout","green_carLayout","power_cellLayout","protecting_oceansLayout","bikesLayout","bikes2Layout","presidential_summitLayout");		//Supplies the populated themeNames array
	
	var isUsed = 0;	
	
	for(i=1;i<themeNames.length;i++) {
		for(x=0;x<usedLayouts.length;x++)
			if(themeNames[i] == usedLayouts[x])	{	
				document.getElementById(usedLayouts[x] + 'Id').innerHTML = "<a href='/mgck/page-layout-manager/page-layout-manager/" + usedLayouts[x].toLowerCase() +".html?func=edit'  class='editLayout' target='_blank'>Edit Layout</a>";	
				isUsed = 1;
			}
		if(!isUsed)	
			document.getElementById(themeNames[i] + 'Id').innerHTML = "<a href='/mgck/page-layout-manager/page-layout-manager.html?func=add;class=WebGUI::Asset::Post::Thread' class='addLayout'>Add a Layout</a>";
			
		isUsed = 0;			
	}	
}









