function execJS() {
	if ( document.all ) {
		var tmpObj = document.getElementById("logo-c");
		tmpObj.style.border = "0px";
		
		var promoObj = document.getElementsByClassName("col3-adv-box");
		for ( var i=0; i<promoObj.length; i++ ) {
			promoObj[i].style.paddingBottom = "5px";
		}
	}
}

/**
 * Mouse over function
 */
var imgPath = "/static/BarCap/template/images/"

function goHover(hover) {
	var goObj = document.getElementById("goBtn");
	if ( hover > 0 ) {
		goObj.src = imgPath+"button-go2.gif";
	} else {
		goObj.src = imgPath+"button-go.gif";
	}
}

function hoverOut(obj) {
	var stylename = obj.className;
	obj.className = stylename;
}

function navIn(obj) {
	var stylename = obj.className;
	obj.className = stylename+"-hover";
}

function navOut(obj) {
	var stylename = obj.className;
	stylename = stylename.replace(/-hover/gi,"");
	obj.className = stylename;
}

/**
 * Open barclays group link
 */
function openBarclaysGroupLink(){
	var listBarcapGroups = document.getElementById("listBarcapGroups");
	if(listBarcapGroups!=null){
		if(listBarcapGroups.selectedIndex!=0){
			var url=listBarcapGroups.value;
			window.open(url);
		}
	}
}	

/**
 * Open new window
 */
function openNewWindow(uri){
	window.open(uri);
}

/**
 * Change introduction image
 */
function changeImage(){
	if(imageArray!=null){	
		var nodeCount = imageArray.length;
		var lookupId = "emptyImage";
		var image = document.getElementById(lookupId);
		if(image!=null){
			var random = Math.floor(Math.random()* nodeCount);
			var imageDetails = imageArray[random];
			var maxWidth = 571;
			var path = imageDetails["Path"];
			var width = imageDetails["Width"];
			var height = imageDetails["Height"];
			var altText = imageDetails["AltText"];
			var isPreview = imageDetails["IsPreview"];
			image.src = path;			
			image.title = altText;				
			image.alt = altText;
			if(width > maxWidth && isPreview == 'true'){
				image.className = "imageOversize";
				image.width = 569;
			}
		}
	}
}

/**
 * Change introduction two column image
 */
function changeIntroductionImageTwoColumn(){
	if(typeof imageArray != 'undefined'){	
		var nodeCount = imageArray.length;
		var lookupId = "emptyImage";
		var image = document.getElementById(lookupId);
		if(typeof image != 'undefined'){
			var random = Math.floor(Math.random()* nodeCount);
			var imageDetails = imageArray[random];
			var maxWidth = 797;
			var path = imageDetails["Path"];
			var width = imageDetails["Width"];
			var height = imageDetails["Height"];
			var altText = imageDetails["AltText"];
			var isPreview = imageDetails["IsPreview"];
			image.src = path;			
			image.title = altText;				
			image.alt = altText;
			image.width = width;
			image.height = height;
			if(width > maxWidth ){
				if(isPreview == 'true'){
					image.className = "imageOversize";
					image.width = 791;
				}else{
					image.width = 797;
				}
			}else{
				if(isPreview == 'true'){
					document.getElementById('introductionImageCaption').style.display = 'none'; 
				}
			}
		}
	}
}

/**
 * Change introduction image
 */
function changeIntroductionImageThreeColumn(){
	if(typeof imageArray != 'undefined'){	
		var nodeCount = imageArray.length;
		var lookupId = "emptyImage";
		var image = document.getElementById(lookupId);
		if(typeof image != 'undefined'){
			var random = Math.floor(Math.random()* nodeCount);
			var imageDetails = imageArray[random];
			var maxWidth = 584;
			var path = imageDetails["Path"];
			var width = imageDetails["Width"];
			var height = imageDetails["Height"];
			var altText = imageDetails["AltText"];
			var isPreview = imageDetails["IsPreview"];
			image.src = path;			
			image.title = altText;				
			image.alt = altText;
			image.width = width;
			image.height = height;
			if(width > maxWidth){
				if(isPreview == 'true'){
					image.className = "imageOversize";
					image.width = 578;
				}else{
					image.width = 584;
				}
			}else{
				if(isPreview == 'true'){
					document.getElementById('introductionImageCaption').style.display = 'none';
				} 
			}
		}
	}
}

/**
 * Change introduction image
 */
function changeIntroductionImage(){
	if(imageArray!=null){	
		var nodeCount = imageArray.length;		
		if(nodeCount > 0){
			var lookupId = "introductionImage";
			var div = document.getElementById(lookupId);
			if(div!=null){	
				var random = Math.floor(Math.random()* nodeCount);
				var imageDetails = imageArray[random];
				var path = imageDetails["Path"];
				div.style.backgroundImage = "url('" + path + "')";
			}
		}
	}
}

/*
 * Check tab strip
 */ 
function checkTabStrip(){
	var selectedItem = document.getElementById("selectedItemVCMId");	
	if(selectedItem!=null){
		var selectItemId = selectedItem.value;
		if(selectItemId!=""){
			var link = document.getElementById(selectItemId);	
			if(link!=null){
				link.href= "javascript:void(0)";
				link.className = "tabStripDisabled";
				link.style.color = "#000000";
				link.style.textDecoration = "none";
			}
		}
	}	
}

/**
 * GetElementByClassName
 */				 
document.getElementsByClassName = function(clsName){
	var retVal = new Array();
	var elements = document.getElementsByTagName("*");
	for(var i = 0;i < elements.length;i++){
		if(elements[i].className.indexOf(" ") >= 0){
			var classes = elements[i].className.split(" ");
			for(var j = 0;j < classes.length;j++){
				if(classes[j] == clsName)
					retVal.push(elements[i]);
			}
		}
		else if(elements[i].className == clsName)
			retVal.push(elements[i]);
	}
	return retVal;
}

/**
 * Toggle menu
 */
function toggleMenu(id, useId, path){
	var acStretchers = document.getElementsByClassName('acStretchOut');  
	var acTogglers = document.getElementsByClassName('acToggle');
	var selectedItem = null;
	var selectedH2 = null;	
	if(useId){
		selectedItem = document.getElementById(id);
		selectedH2 = document.getElementById(id + "_h2");
	}
	else{
		selectedItem = acStretchers[id];
		selectedH2 = acTogglers[id];
	}
	if(selectedItem!=null && selectedH2!=null){
		//Store item style for later use
		var currentItemStyle = selectedItem.style.display;		
		//Only collapse menu when we can retrieve the selected item menu so that in case of errors, user will still
		//be able to navigate via all expanded menu.
		collapseMenu(acStretchers, acTogglers, path);
		if(currentItemStyle.toUpperCase()== "NONE" || currentItemStyle.toUpperCase() == ""){
			selectedItem.style.display = "INLINE";						
			selectedH2.style.backgroundImage = "url(" + path + "images/L1_arrow_selected.gif)";
		}
		else{
			selectedItem.style.display = "NONE";						
			selectedH2.style.backgroundImage = "url(" + path + "images/L1_arrow.gif)";
		}	
	}
}

/**
 * Close all menu
 */
function collapseMenu(acStretchers, acTogglers, path){
	for(var i=0; i< acStretchers.length; i++){
		acStretchers[i].style["display"] = "NONE";						
	}
	for(var i=0; i< acTogglers.length; i++){
		acTogglers[i].style.backgroundImage = "url(" + path + "images/L1_arrow.gif)";
	}
}