/***********************************Change Location | Generic | Starts**********************/

function gotoURL(url){
    document.location.href=url;    
}
/***********************************Change Location | Generic | Starts**********************/

/************************************Set Top Nav Item Color | On Load | Starts***************/
function setTopnavId(){

	//document.getElementById("searchTextboxId").focus(); /*Set cursor on Search Textbox on load*/	
		
	URL = window.location.href;
    if(document.getElementById('thefirm')){
        var objt=document.getElementById('_7cde0f11-6bc7-4271-9564-2254b6ebb30c');
        objt.className="theFirmBg";
    }
	  else  if(document.getElementById('AssetManagement')){
        var objt=document.getElementById('_49411b04-fabd-4a09-b007-070b27757eb0');
        objt.className="assetManagementBg";
    }
    else  if(document.getElementById('IBanking')){
        var objt=document.getElementById('_78e202e2-a3d6-4b85-b32b-11cd531ca14W');
        objt.className="investBankingBg";
    }
    else  if(document.getElementById('LPartners')){
        var objt=document.getElementById('_c2ab8692-f588-418f-9d60-ddab9cbf6a64');
        objt.className="limitedPartnersBg";
    }
    else  if(document.getElementById('InvestorRelationship')){
        var objt=document.getElementById('_93c783f1-1227-4b06-b2ac-8ebadad59297');
        objt.className="investorRelationsBg";
    }
    else  if(document.getElementById('News')){
        var objt=document.getElementById('_e851293e-e670-48df-b473-9c429361f16a');
        objt.className="newsBg";
    }
    else  if(document.getElementById('Citizenship')){
        var objt=document.getElementById('_1706b396-d0b4-467e-b304-087a92ea3f70');
        objt.className="citizenShipBg";
    }
    else{}

	/*code to make last menu item nonclickable - start*/
	var lastMenuItem = document.getElementById('N_8962512a-0e5a-41a3-bf80-7aa28acc1220'); 
	lastMenuItem.setAttribute('href', "#");
	/*code to make last menu item nonclickable - start*/


	
	onLoadTabSelect();
	

}
function setTopnavOver(){
	 if(document.getElementById('thefirm')){
        var objt=document.getElementById('_7cde0f11-6bc7-4271-9564-2254b6ebb30c');
        objt.className="theFirmBg";
    }
	  else  if(document.getElementById('AssetManagement')){
        var objt=document.getElementById('_49411b04-fabd-4a09-b007-070b27757eb0');
        objt.className="assetManagementBg";
    }
    else  if(document.getElementById('IBanking')){
        var objt=document.getElementById('_78e202e2-a3d6-4b85-b32b-11cd531ca14W');
        objt.className="investBankingBg";
    }
    else  if(document.getElementById('LPartners')){
        var objt=document.getElementById('_c2ab8692-f588-418f-9d60-ddab9cbf6a64');
        objt.className="limitedPartnersBg";
    }
    else  if(document.getElementById('InvestorRelationship')){
        var objt=document.getElementById('_93c783f1-1227-4b06-b2ac-8ebadad59297');
        objt.className="investorRelationsBg";
    }
    else  if(document.getElementById('News')){
        var objt=document.getElementById('_e851293e-e670-48df-b473-9c429361f16a');
        objt.className="newsBg";
    }
    else  if(document.getElementById('Citizenship')){
        var objt=document.getElementById('_1706b396-d0b4-467e-b304-087a92ea3f70');
        objt.className="citizenShipBg";
    }
}
/************************************Set Top Nav Item Color | On Load | Starts***************/


/************************************Top Nav MouseOver & MouseOut Starts***************/
/*function activeColorIn(selectedItemID){    
        if(selectedItemID=="_9f5945c7-b05a-42b8-9a07-dd5636fc483f"){
			   var navItem=document.getElementById(selectedItemID);
               navItem.className='assetManagementBg';

        }
        else if(selectedItemID=="_3f971b6e-f113-40a2-8457-c22d55e6b111"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='investBankingBg';
        }
        else if(selectedItemID=="_2eac9632-8d4d-4f74-a160-5dd2c194f149"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='theFirmBg';
        }
        else if(selectedItemID=="_389bcb18-8d94-4112-b84e-03c0d8272946"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='limitedPartnersBg';
        }
        else if(selectedItemID=="_1b7bf2a8-d164-4e9a-9540-925ebd203e8d"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='investorRelationsBg';
        }
        else if(selectedItemID=="_078cedf2-8bbf-4475-8310-b420b2b7502f"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='newsBg';
        }
        else if(selectedItemID=="_8173099d-ab7a-4a9a-869b-d0822267707f"){
            var navItem=document.getElementById(selectedItemID);
               navItem.className='citizenShipBg';
        }
		setTopnavId();
}
function activeColorOut(selectedItemID){    
        var navItem=document.getElementById(selectedItemID);
        navItem.className="menuBox";
        setTopnavId();
}
*/

function activeColorIn(selectedItemID,bgColor){
	var navItem=document.getElementById(selectedItemID);
	/*navItem.style.backgroundColor=bgColor;*/
	navItem.className=bgColor;
}

function activeColorOut(selectedItemID){   
	var navItem=document.getElementById(selectedItemID);
	navItem.className="menuBox";
	setTopnavOver(selectedItemID);
}


/************************************Top Nav MouseOver & MouseOut Ends***************/





// Menu creation
var Spry;
if(!Spry)
{
    Spry = {};
}
if(!Spry.Widget)
{
    Spry.Widget = {};
}
// Constructor for Menu Bar
// element should be an ID of an unordered list (<ul> tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
{
    this.init(element, opts);
};
Spry.Widget.MenuBar.prototype.init = function(element, opts)
{
    this.element = this.getElement(element);
    // represents the current (sub)menu we are operating on
    this.currMenu = null;
    var isie = (typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE');
    if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (isie && typeof document.uniqueID == 'undefined'))
    {
        // bail on older unsupported browsers
        return;
    }
    // load hover images now
    if(opts)
    {
        for(var k in opts)
        {
            var rollover = new Image;
            rollover.src = opts[k];
        }
    }
    if(this.element)
    {
        this.currMenu = this.element;
        var items = this.element.getElementsByTagName('li');
        for(var i=0; i<items.length; i++)
        {
            this.initialize(items[i], element, isie);
            if(isie)
            {
                this.addClassName(items[i], "MenuBarItemIE");
                items[i].style.position = "static";
            }
        }
        if(isie)
        {
            if(this.hasClassName(this.element, "MenuBarVertical"))
            {
                this.element.style.position = "relative";
            }
            var linkitems = this.element.getElementsByTagName('a');
            for(var i=0; i<linkitems.length; i++)
            {
                linkitems[i].style.position = "relative";
            }
        }
    }
};
Spry.Widget.MenuBar.prototype.getElement = function(ele)
{
    if (ele && typeof ele == "string")
        return document.getElementById(ele);
    return ele;
};
Spry.Widget.MenuBar.prototype.hasClassName = function(ele, className)
{
    if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
    {
        return false;
    }
    return true;
};
Spry.Widget.MenuBar.prototype.addClassName = function(ele, className)
{
    if (!ele || !className || this.hasClassName(ele, className))
        return;
    ele.className += (ele.className ? " " : "") + className;
};
Spry.Widget.MenuBar.prototype.removeClassName = function(ele, className)
{
    if (!ele || !className || !this.hasClassName(ele, className))
        return;
    ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};
// addEventListener for Menu Bar
// attach an event to a tag without creating obtrusive HTML code
Spry.Widget.MenuBar.prototype.addEventListener = function(element, eventType, handler, capture)
{
    try
    {
        if (element.addEventListener)
        {
            element.addEventListener(eventType, handler, capture);
        }
        else if (element.attachEvent)
        {
            element.attachEvent('on' + eventType, handler);
        }
    }
    catch (e) {}
};
// createIframeLayer for Menu Bar
// creates an IFRAME underneath a menu so that it will show above form controls and ActiveX
Spry.Widget.MenuBar.prototype.createIframeLayer = function(menu)
{
    var layer = document.createElement('iframe');
    layer.tabIndex = '-1';
    layer.src = 'javascript:false;';
    menu.parentNode.appendChild(layer);
    
    layer.style.left = menu.offsetLeft + 'px';
    layer.style.top = menu.offsetTop + 'px';
    layer.style.width = menu.offsetWidth + 'px';
    layer.style.height = menu.offsetHeight + 'px';
};
// removeIframeLayer for Menu Bar
// removes an IFRAME underneath a menu to reveal any form controls and ActiveX
Spry.Widget.MenuBar.prototype.removeIframeLayer =  function(menu)
{
    var layers = menu.parentNode.getElementsByTagName('iframe');
    while(layers.length > 0)
    {
        layers[0].parentNode.removeChild(layers[0]);
    }
};
// clearMenus for Menu Bar
// root is the top level unordered list (<ul> tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
{
    var menus = root.getElementsByTagName('ul');
    for(var i=0; i<menus.length; i++)
    {
        this.hideSubmenu(menus[i]);
    }
    this.removeClassName(this.element, "MenuBarActive");
};
// bubbledTextEvent for Menu Bar
// identify bubbled up text events in Safari so we can ignore them
Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
{
    return (navigator.vendor == 'Apple Computer, Inc.' && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget)));
};
// showSubmenu for Menu Bar
// set the proper CSS class on this menu to show it
Spry.Widget.MenuBar.prototype.showSubmenu = function(menu)
{
    if(this.currMenu)
    {
        this.clearMenus(this.currMenu);
        this.currMenu = null;
    }
    
    if(menu)
    {
        this.addClassName(menu, "MenuBarSubmenuVisible");
        if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
        {
            if(!this.hasClassName(this.element, "MenuBarHorizontal") || menu.parentNode.parentNode != this.element)
            {
                menu.style.top = menu.parentNode.offsetTop + 'px';
            }
        }
        if(typeof document.uniqueID != "undefined")
        {
            this.createIframeLayer(menu);
        }
    }
    this.addClassName(this.element, "MenuBarActive");
};
// hideSubmenu for Menu Bar
// remove the proper CSS class on this menu to hide it
Spry.Widget.MenuBar.prototype.hideSubmenu = function(menu)
{
    if(menu)
    {
        this.removeClassName(menu, "MenuBarSubmenuVisible");
        if(typeof document.all != 'undefined' && typeof window.opera == 'undefined' && navigator.vendor != 'KDE')
        {
            menu.style.top = '';
            menu.style.left = '';
        }
        this.removeIframeLayer(menu);
    }
};
// initialize for Menu Bar
// create event listeners for the Menu Bar widget so we can properly
// show and hide submenus
Spry.Widget.MenuBar.prototype.initialize = function(listitem, element, isie)
{
    var opentime, closetime;
    var link = listitem.getElementsByTagName('a')[0];
    var submenus = listitem.getElementsByTagName('ul');
    var menu = (submenus.length > 0 ? submenus[0] : null);
    var hasSubMenu = false;
    if(menu)
    {
        this.addClassName(link, "MenuBarItemSubmenu");
        hasSubMenu = true;
    }
    if(!isie)
    {
        // define a simple function that comes standard in IE to determine
        // if a node is within another node
        listitem.contains = function(testNode)
        {
            // this refers to the list item
            if(testNode == null)
            {
                return false;
            }
            if(testNode == this)
            {
                return true;
            }
            else
            {
                return this.contains(testNode.parentNode);
            }
        };
    }
    
    // need to save this for scope further down
    var self = this;
    this.addEventListener(listitem, 'mouseover', function(e)
    {
        if(self.bubbledTextEvent())
        {
            // ignore bubbled text events
            return;
        }
        clearTimeout(closetime);
        if(self.currMenu == listitem)
        {
            self.currMenu = null;
        }
        // show menu highlighting
        self.addClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
        if(menu && !self.hasClassName(menu, "MenuBarSubmenuVisible"))
        {
            opentime = window.setTimeout(function(){self.showSubmenu(menu);}, 0);
        }
    }, false);
    this.addEventListener(listitem, 'mouseout', function(e)
    {
        if(self.bubbledTextEvent())
        {
            // ignore bubbled text events
            return;
        }
        var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
        if(!listitem.contains(related))
        {
            clearTimeout(opentime);
            self.currMenu = listitem;
            // remove menu highlighting
            self.removeClassName(link, hasSubMenu ? "MenuBarItemSubmenuHover" : "MenuBarItemHover");
            if(menu)
            {
                closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, 0);
            }
        }
    }, false);
};
//************************Show and Hide****************************/
function showHide(subNavID,otherID){
	document.getElementById(subNavID).style.display="block";
	document.getElementById(otherID).style.display="none";
	}


//rounded buttons
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			if (oldonload) {
			    oldonload();
			}
			func();
		}
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function insertAfter(newElement, targetElement) {
	var parent = targetElement.parentNode;
	if (parent.lastChild == targetElement) {
		parent.appendChild(newElement);
	}
	else {
		parent.insertBefore(newElement, targetElement.nextSibling);
	}
}

function buttonEndings() {
	if (!document.getElementsByTagName) {
		return false
	}
	
	var buttons = getElementsByClass("button");
	for (i=0; i < buttons.length; i++) {
		var div = document.createElement("div");
		div.className = "buttonEnding";
		insertAfter(div, buttons[i]);
	}
}

addLoadEvent(buttonEndings);
//rounded end

function tabToggle(currID) {
/*Restructuring Toggle Implementation*/
	if(currID == "d438"){
		 document.getElementById("d434").style.display = "none";
		 document.getElementById("d436").style.display = "none";
		 document.getElementById("d438").style.display = "block";
		}

	else if(currID == "d436"){
		 document.getElementById("d434").style.display = "none";
		 document.getElementById("d436").style.display = "block";
		 document.getElementById("d438").style.display = "none";
		}
	else if(currID == "d434"){
		 document.getElementById("d434").style.display = "block";
		 document.getElementById("d436").style.display = "none";
		 document.getElementById("d438").style.display = "none";
		}
/*Restructuring Toggle Implementation*/
/*Advisory Toggle Implementation*/

	if(currID == "d440"){
		 document.getElementById("d431").style.display = "none";
		 document.getElementById("d439").style.display = "none";
		 document.getElementById("d440").style.display = "block";
		}

	else if(currID == "d439"){
		 document.getElementById("d431").style.display = "none";
		 document.getElementById("d439").style.display = "block";
		 document.getElementById("d440").style.display = "none";
		}
	else if(currID == "d431"){
		 document.getElementById("d431").style.display = "block";
		 document.getElementById("d439").style.display = "none";
		 document.getElementById("d440").style.display = "none";
		}
	else{}
/*Advisory Toggle Implementation*/
}
function DisplayDIV(d) { document.getElementById(d).style.display = "block"; }

function onLoadTabSelect() { 
/*	if(document.getElementById("438")){
	document.getElementById("438").className="selected";
	}
*/
	if(document.getElementById("562")){
	document.getElementById("562").className="halfmoonTabSelected";
	}

	
}

function halfmoonTabs(currTabID){
		
	if(currTabID == "parentTabContent433tabs"){

			document.getElementById("433").className="halfmoonTabSelected";
			document.getElementById("562").className="halfmoonTabUnSelected";
			document.getElementById("parentTabContent433tabs").style.display = "block";
			document.getElementById("parentTabContent562tabs").style.display="none";
		}
		if(currTabID == "parentTabContent562tabs"){
	

			document.getElementById("562").className="halfmoonTabSelected";
			document.getElementById("433").className="halfmoonTabUnSelected";
			document.getElementById("parentTabContent562tabs").style.display = "block";
			document.getElementById("parentTabContent433tabs").style.display="none";
		}

		


}


/*******************************Thumbnail Popup | Starts******************************/
var popupStatus = 0;
function PopUpclick(ParentElement,popupID) {
	centerPopup(ParentElement,popupID);
	loadPopup(popupID);
}
function loadPopup(popupID) {
	var popupContent = document.getElementById(popupID);
	if(popupStatus==0) {
//		$(thumbnail_popUp).fadeIn("slow");
		popupContent.style.display="block";
  		popupStatus = 1;	
	}
}
function closepopup(popupID) {
	disablePopup(popupID);
}
function disablePopup(popupID){
 var popUp_Content = document.getElementById(popupID);
 if(popupStatus==1){
	popUp_Content.style.display="none";
   	popupStatus = 0;
  }
}
//centering popup
function centerPopup(ParentElement,popupID){
	var popUpContent = document.getElementById(popupID);
	var anchor_position = $(ParentElement).position();
	$(popUpContent).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + 135});
}

/*******************************Thumbnail Popup | Ends***************************************/
/*******************************Leadership Thumbnail Popup | Starts******************************/
var popupStatus = 0;
function PopUpclickLS(ParentElement,popupID,event) {

	vParentItem = ParentElement.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{ 
		var vSibling = vParentItem.nextSibling;
		centerPopupLSFF(ParentElement,popupID,event);
	}
	else 
	{ 
	 if (browserName=="Microsoft Internet Explorer")
	 {
		var vSibling = vParentItem.nextSibling;
		centerPopupLS(ParentElement,popupID);
	 }
	}
	
	
	loadPopup(popupID);
}
function centerPopupLS(ParentElement,popupID){
	var popUpContent = document.getElementById(popupID);
	//var anchor_position = $(ParentElement).position();
	//$(popUpContent).css({"position": "absolute","top":anchor_position.top + -4 ,"left": anchor_position.left + 125});/*119091*/

	 var newDataID = document.getElementById(popupID);
 newDataID.style.position="absolute";
 if((document.documentElement.clientHeight-event.clientY)<150)
 {
  newDataID.style.top=event.clientY+document.documentElement.scrollTop-142+"px";
  if((document.documentElement.clientWidth-event.clientX)<300){
   newDataID.style.left=event.clientX+document.documentElement.scrollLeft-508+"px";
  }
  else{
   newDataID.style.left=event.clientX+document.documentElement.scrollLeft+0+"px";
  }
 }
 else{
  newDataID.style.top=event.clientY+document.documentElement.scrollTop+5+"px";
  if((document.documentElement.clientWidth-event.clientX)<300){
   newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
  }
  else{
   newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
  }
 }
}



function centerPopupLSFF(ParentElement,popupID,event){
    var popUpContent = document.getElementById(popupID);
    var newDataID = document.getElementById(popupID);
    newDataID.style.position="absolute";
    if((document.documentElement.clientHeight-event.clientY)<150){
        newDataID.style.top=event.clientY+document.documentElement.scrollTop-142+"px";
        //alert('IF Top : less 150: ' + document.documentElement.clientWidth-event.clientX);
        if((document.documentElement.clientWidth-event.clientX)<300){
            //alert('If 1 less 300: ' + document.documentElement.clientWidth-event.clientX);
            newDataID.style.left=event.clientX+document.documentElement.scrollLeft-508+"px";
        }
        else{
            //alert('Else 1 less 300: ' + document.documentElement.clientWidth-event.clientX);
            newDataID.style.left=event.clientX+document.documentElement.scrollLeft+0+"px";
        }
    }
    else{
        //alert('Else TOP: Great 150 ' + document.documentElement.clientWidth-event.clientX);
        newDataID.style.top=event.clientY+document.documentElement.scrollTop+5+"px";
        if((document.documentElement.clientWidth-event.clientX)<300){
           // alert('If 2: Great 300 ' + document.documentElement.clientWidth-event.clientX);
            newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
        }
        else{
            //alert('Else 2: Great 300' + document.documentElement.clientWidth-event.clientX);
            newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
        }
    }
}




/*******************************Leadership Thumbnail Popup | Ends***************************************/

/*******************************Thumbnail Popup Selected Transaction| Starts******************************/
var popupStatus = 0;
function PopUpclickST(ParentElement,popupID) {
	vParentItem = ParentElement.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{var vSibling = vParentItem.nextSibling;}
	else 
		{if (browserName=="Microsoft Internet Explorer"){
			var vSibling = vParentItem.nextSibling;}}
	centerPopupST(ParentElement,popupID);
	loadPopup(popupID);
}
function centerPopupST(ParentElement,popupID){
	var popUpContent = document.getElementById(popupID);
	var anchor_position = $(ParentElement).position();
	if(anchor_position.left > 490) {
		$(popUpContent).css({"position": "absolute","left": anchor_position.left + -220});
	}
	else {
		$(popUpContent).css({"position": "absolute","left": anchor_position.left + 87});
	}
	if(anchor_position.top > 600) {
		$(popUpContent).css({"position": "absolute","top":anchor_position.top + -150});
	}
	else {
		$(popUpContent).css({"position": "absolute","top":anchor_position.top + 0});
	}
}

/*******************************Thumbnail Popup Selected Transaction | Ends***************************************/
/*******************************Thumbnail Popup Selected Transaction | Ends***************************************/
/*******************************Thumbnail Popup Real Estate Portfolio| Starts******************************/
/*var popupStatus = 0;
function PopUpclickRP(ParentElement,popupID) {
	vParentItem = ParentElement.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{var vSibling = vParentItem.nextSibling;}
	else 
		{if (browserName=="Microsoft Internet Explorer"){
			var vSibling = vParentItem.nextSibling;}}
	centerPopupRP(ParentElement,popupID);
	loadPopup(popupID);
}
function centerPopupRP(ParentElement,popupID){
	var popUpContent = document.getElementById(popupID);
	var anchor_position = $(ParentElement).position();
	if(anchor_position.left > 265) {
	$(popUpContent).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + -180});
	}
	else {
		$(popUpContent).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + 135});
	}
}
*/
/*******************************Thumbnail Popup Real Estate Portfolio| Starts******************************/
/*******************************Thumbnail Popup Real Estate Portfolio| Starts******************************/
var popupStatus = 0;
function PopUpclickRP(ParentElement,popupID,event) {
	vParentItem = ParentElement.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{var vSibling = vParentItem.nextSibling;
		centerPopupRPFF(ParentElement,popupID,event);

	}
	else 
		{if (browserName=="Microsoft Internet Explorer"){
			var vSibling = vParentItem.nextSibling; 	
			centerPopupRP(ParentElement,popupID);}}


	loadPopup(popupID);
}
function centerPopupRP(ParentElement,popupID)
{
	var newDataID = document.getElementById(popupID);
	newDataID.style.position="absolute";
	if((document.documentElement.clientHeight-event.clientY)<150)
	{
		if((document.documentElement.clientWidth-event.clientX)<300)
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-510+"px";
			//alert("1 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-700+"px";
			//alert("1 Left: " + newDataID.style.left);
		}
		else
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-500 +"px";
			//alert("2 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-645+"px";
			//alert("2 Left: " + newDataID.style.left);
		}
	}
	else
	{
		if((document.documentElement.clientWidth-event.clientX)<300)
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-510+"px";
			//alert("3 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-700+"px";
			//alert("3 Left: " + newDataID.style.left);
		}
		else
		{
			
			if(event.clientY<400)
				{
				//alert(event.clientY)
				newDataID.style.top=event.clientY+document.documentElement.scrollTop-10+"px";
				//alert("4 Top: " + newDataID.style.top);
				newDataID.style.left=event.clientX+document.documentElement.scrollLeft-600+"px";
				}
			else
				{
				//alert(event.clientY)
				//alert("4 Top: " + event.clientY);
				newDataID.style.top=event.clientY+document.documentElement.scrollTop-500+"px";
				//alert("4 Top: " + newDataID.style.top);
				newDataID.style.left=event.clientX+document.documentElement.scrollLeft-600+"px";
				//alert("4 Left: " + newDataID.style.left);
				}
			
		}
	}
}

function centerPopupRPFF(ParentElement,popupID,event)
{
	var newDataID = document.getElementById(popupID);
	newDataID.style.position="absolute";
	if((document.documentElement.clientHeight-event.clientY)<150)
	{
		if((document.documentElement.clientWidth-event.clientX)<300)
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-150+"px";
			//alert("1 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-500+"px";
			//alert("1 Left: " + newDataID.style.left);
		}
		else
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-400 +"px";
			//alert("2 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-700+"px";
			//alert("2 Left: " + newDataID.style.left);
		}
	}
	else
	{
			//alert(document.documentElement.clientWidth-event.clientY);
		if((document.documentElement.clientWidth-event.clientY)<700)
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-400+"px";
			//alert("3 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-700+"px";
			//alert("3 Left: " + newDataID.style.left);
		}
		else
		{
			newDataID.style.top=event.clientY+document.documentElement.scrollTop-150+"px";
			//alert("4 Top: " + newDataID.style.top);
			newDataID.style.left=event.clientX+document.documentElement.scrollLeft-500+"px";
			//alert("4 Left: " + newDataID.style.left);
		}
	}
}


/*******************************Thumbnail Popup Real Estate Portfolio| Starts******************************/




 /***********************Portfolio | Headers Expand Collapse**************************************//*
 function showContent(vThis)
    {
        vParent = vThis.parentNode;
        var browserName=navigator.appName; 
    if (browserName=="Netscape")
    { 
        var vSibling = vParent.nextSibling.nextSibling.nextSibling.nextSibling;
	var vSiblingTeaser = vParent.nextSibling.nextSibling;
    }
    else 
    { 
     if (browserName=="Microsoft Internet Explorer")
     {
        var vSibling = vParent.nextSibling.nextSibling;
	    var vSiblingTeaser = vParent.nextSibling;
     }
    }
    
    while (vSibling.nodeType==3) { // Fix for Mozilla/FireFox Empty Space becomes a TextNode or Something
    vSibling = vParent.nextSibling.nextSibling.nextSibling.nextSibling;
    };
    if(vSibling.style.display == "none")
    {
        vThis.src="<%img_collapseGreen%>";
        vSibling.alt = "Hide Div";
        vSibling.style.display = "block";
	    vSiblingTeaser.style.display = "none";
    } 
    else {
        vSibling.style.display = "none";
	    vSiblingTeaser.style.display = "block";
        vThis.src="<%img_expandGreen%>";
        vSibling.alt = "Show Div";
    }
    return;
   }
/***********************Portfolio | Headers Expand Collapse**************************************/ 

/******************Begin: TeamBios | New Thumbnail Functionality | XSL *******************************/
/*function showThumbnail(vThis)
{
var popupStatus1 = 0;
vParent1 = vThis.parentNode;
var vSibling1;
var browserName=navigator.appName; 
vSibling1 = vParent1.nextSibling.nextSibling.nextSibling;
var popUpContent = document.getElementById(vSibling1);
var anchor_position = $(vThis).position();

if(popupStatus1==0)
	{
		vSibling1.style.display="block";
//		$(vSibling1).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + 137});

		if(anchor_position.top > 643) {
		$(vSibling1).css({"position": "absolute","top":anchor_position.top + -100 ,"left": anchor_position.left + 137});
		}
		else {
		$(vSibling1).css({"position": "absolute","top":anchor_position.top + -10 ,"left": anchor_position.left + 137});
		}
	popupStatus1 = 1;
	}
	if(popupStatus==1){
		vSibling1.style.display = "none";
		popupStatus1 = 0;
	}
	return;
}
*/



function showThumbnail(vThis,event)
	{
		var popupStatus1 = 0;
		vParent1 = vThis.parentNode;
		var newDataID;
		var browserName=navigator.appName; 
		newDataID = vParent1.nextSibling.nextSibling.nextSibling;
		var popUpContent = document.getElementById(newDataID);
		var anchor_position = $(vThis).position();
		
		if(popupStatus1==0)
		{
			newDataID.style.display="block";
			newDataID.style.position="absolute";
			if((document.documentElement.clientHeight-event.clientY)<150)
			{
				newDataID.style.top=event.clientY+document.documentElement.scrollTop-142+"px";
				if((document.documentElement.clientWidth-event.clientX)<300)
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-508+"px";
				}
				else
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft+0+"px";
				}
			}
			else
			{
				newDataID.style.top=event.clientY+document.documentElement.scrollTop+5+"px";
				if((document.documentElement.clientWidth-event.clientX)<300)
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
				}
				else
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
				}
			}
			popupStatus1 = 1;
		}
		if(popupStatus==1){
			newDataID.style.display = "none";
			popupStatus1 = 0;
		}
		return;
	}

function hideThumbnail(vThis) {
var popupStatus1 = 1;
vParent1 = vThis.parentNode;
var browserName=navigator.appName; 
var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling;
if(popupStatus1==1){
	vSibling1.style.display="none";
   	popupStatus1 = 0;
  }
}

/******************End: TeamBios | New Thumbnail Functionality | XSL *******************************/


/******************Begin: TeamBios | New Thumbnail Functionality | CMS*******************************/
function showThumbnailCMS(vThis)
{
var popupStatus1 = 0;

vParent1 = vThis.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{ 
		var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
	}
	else 
	{ 
	 if (browserName=="Microsoft Internet Explorer")
	 {
		var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling;
	 }
	}
var popUpContent = document.getElementById(vSibling1);
var anchor_position = $(vThis).position();

if(popupStatus1==0)
	{
		vSibling1.style.display="block";
		$(vSibling1).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + 137});
		popupStatus1 = 1;
	}
	if(popupStatus==1){
		vSibling1.style.display = "none";
		popupStatus1 = 0;
	}
	return;
}

function hideThumbnailCMS(vThis) {
var popupStatus1 = 1;
vParent1 = vThis.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{ 
		var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
	}
	else 
	{ 
	 if (browserName=="Microsoft Internet Explorer")
	 {
		var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling;
	 }
	}
if(popupStatus1==1){
	vSibling1.style.display="none";
   	popupStatus1 = 0;
  }
}

/******************End: TeamBios | New Thumbnail Functionality | CMS*******************************/

/******************Begin: FirmBios | New Thumbnail Functionality*******************************/
/*function FbshowThumbnail(vThis)
{
var popupStatus1 = 0;
vParent1 = vThis.parentNode;
var vSibling1;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{ 
		vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
	}
	else 
	{ 
	 if (browserName=="Microsoft Internet Explorer")
	 {
		vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
	 }
	}
var popUpContent = document.getElementById(vSibling1);
var anchor_position = $(vThis).position();

if(popupStatus1==0)
	{
		vSibling1.style.display="block";
		$(vSibling1).css({"position": "absolute","top":anchor_position.top + 0 ,"left": anchor_position.left + 137});
		popupStatus1 = 1;
	}
	if(popupStatus==1){
		vSibling1.style.display = "none";
		popupStatus1 = 0;
	}
	return;
}*/


function FbshowThumbnail(vThis,event)
	{
		var popupStatus1 = 0;
		vParent1 = vThis.parentNode;
		var newDataID;
		var browserName=navigator.appName; 
		if (browserName=="Netscape")
		{ 
			newDataID = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
		}
		else 
		{ 
			if (browserName=="Microsoft Internet Explorer")
			{
			newDataID = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
			}
		}
		var popUpContent = document.getElementById(newDataID);
		var anchor_position = $(vThis).position();
		
		if(popupStatus1==0)
		{
			newDataID.style.display="block";
			newDataID.style.position="absolute";
			if((document.documentElement.clientHeight-event.clientY)<150)
			{
				newDataID.style.top=event.clientY+document.documentElement.scrollTop-142+"px";
				if((document.documentElement.clientWidth-event.clientX)<300)
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-508+"px";
				}
				else
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft+0+"px";
				}
			}
			else
			{
				newDataID.style.top=event.clientY+document.documentElement.scrollTop+5+"px";
				if((document.documentElement.clientWidth-event.clientX)<300)
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
				}
				else
				{
					newDataID.style.left=event.clientX+document.documentElement.scrollLeft-0+"px";
				}
			}
			popupStatus1 = 1;
		}
		if(popupStatus==1)
		{
			newDataID.style.display = "none";
			popupStatus1 = 0;
		}
		return;
	}


function FbhideThumbnail(vThis) {
var popupStatus1 = 1;
vParent1 = vThis.parentNode;
	var browserName=navigator.appName; 
	if (browserName=="Netscape")
	{ 
		vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
	}
	else 
	{ 
	 if (browserName=="Microsoft Internet Explorer")
	 {
		var vSibling1 = vParent1.nextSibling.nextSibling.nextSibling.nextSibling;
	 }
	}
if(popupStatus1==1){
	vSibling1.style.display="none";
   	popupStatus1 = 0;
  }
}

/******************End: FirmBios | New Thumbnail Functionality*******************************/

      function changePageForSearch(){
      document.frm.submit();
     }
  

function alternateColoring(){ 
 if(document.getElementsByTagName){ 
		if(document.getElementById('altRowIDTB'))
		 {
		   var table = document.getElementById('altRowIDTB');   
		   var rows = table.getElementsByTagName("tr");   
		   for(i = 0; i < rows.length; i++){           
			 if(i % 2 == 0){rows[i].className = "odd";}
			 else{}
		   }
		 }
		 else{}
 } 
}

 /**Alternate Coloring | India Funds Page**/
function alternateColorFunds(){ 
	 if(document.getElementsByTagName){
		if(document.getElementById('altRowIDTB')){
			var table = document.getElementById('altRowIDTB');   
			var rows = table.getElementsByTagName("tr");   
			for(i = 0; i < rows.length; i++){if(i % 2 == 0){rows[i].className = "odd";}else{}} 
		}
		else{}
	 } 
	
	 if(document.getElementsByTagName){
		if(document.getElementById('altRowIDfactSt2')){
			var facttable2 = document.getElementById('altRowIDfactSt2');   
			var factrows2 = facttable2.getElementsByTagName("tr");   
			for(i = 0; i < factrows2.length; i++){if(i % 2 == 0){factrows2[i].className = "odd";}else{}} 
		}
		else{}
	 } 
	
	 if(document.getElementsByTagName){
		if(document.getElementById('2921')){
			var holdingsTable1 = document.getElementById('2921');   
			var holdingsrows1 = holdingsTable1.getElementsByTagName("tr");   
			for(i = 0; i < holdingsrows1.length; i++){if(i % 2 == 0){holdingsrows1[i].className = "odd";}else{}}
		}
		else{}	
	}
	
	 if(document.getElementsByTagName){
		if(document.getElementById('2917')){
			var holdingsTable2 = document.getElementById('2917');   
			var holdingsrows2 = holdingsTable2.getElementsByTagName("tr");   
			for(i = 0; i < holdingsrows2.length; i++){if(i % 2 == 0){holdingsrows2[i].className = "odd";}else{}} 
		}
		else{}
	 } 
	if(document.getElementsByTagName){
		if(document.getElementById('2495')){
			var holdingsTable3 = document.getElementById('2495');   
			var holdingsrows3 = holdingsTable3.getElementsByTagName("tr");   
			for(i = 0; i < holdingsrows3.length; i++){if(i % 2 == 0){holdingsrows3[i].className = "odd";}else{}} 
		}
		else{}
	}
	if(document.getElementsByTagName){
		if(document.getElementById('altRowIDHoldings4')){
			var holdingsTable4 = document.getElementById('altRowIDHoldings4');   
			var holdingsrows4 = holdingsTable4.getElementsByTagName("tr");   
			for(i = 0; i < holdingsrows4.length; i++){if(i % 2 == 0){holdingsrows4[i].className = "odd";}else{}} 
		}
		else{}
	}
	 
	  if(document.getElementsByTagName){
		if(document.getElementById('altRowIDdistHistory1')){
			var distHistTable1 = document.getElementById('altRowIDdistHistory1');   
			var distHistrows1 = distHistTable1.getElementsByTagName("tr");   
			for(i = 0; i < distHistrows1.length; i++){if(i % 2 == 0){distHistrows1[i].className = "odd";}else{}} 
		}
		else{}
	 }
}
/**Alternate Coloring | India Funds Page**/

/*********************Starts | Community Slideshow***********************/
var commNewsId=new Array('commNews01','commNews02','commNews03','commNews04','commNews05','commNews06','commNews07','commNews08','commNews09','commNews10','commNews11','commNews12'); /*For Community News Content*/

var commNewsIdSecond=new Array('commNews13','commNews14','commNews15','commNews16','commNews17','commNews18','commNews19','commNews20','commNews21','commNews22','commNews23','commNews24'); /*For Community News Content*/

var commNewsIdThird=new Array('commNews25','commNews26','commNews27','commNews28','commNews29','commNews30','commNews31','commNews32','commNews33','commNews34','commNews35','commNews36'); /*For Community News Content*/

var imgCountCN=0;

var imgCountCNSecond=0;
var imgCountCNThird=0;

var GID='';
var GIDSecond='';
var GIDThird='';
var timerInterval;
var timerIntervalSecond;
var timerIntervalThird;
function showProperImage()
{
//    alert(document.getElementById(commNewsId[0].substring(10,8)).src);
    
    for (var i=0;i<commNewsId.length;i++)
    {
      if(document.getElementById(commNewsId[i]))
      {
		var len;
		var imgSrc; 
		
		len=String(commNewsId[i]).length;
		imgSrc = String(commNewsId[i].substr(len-2,2));
		
	      if(document.getElementById(imgSrc))
	      	
	      {
	      	 imgCountCN = imgCountCN+1;
	      }
      
      }
      
    }
    //replace x of y text in each div with correct image number and count
    var currentImmageIndex=1; 
    for (var i=0;i<commNewsId.length;i++)
    { 
	    if(document.getElementById(commNewsId[i]))
	      {
			var len;
			var imgSrc; 

			len=String(commNewsId[i]).length;
			imgSrc = String(commNewsId[i].substr(len-2,2));
			
			if(document.getElementById(imgSrc))

			{
				
				document.getElementById(('spn'+commNewsId[i])).innerHTML = (currentImmageIndex).toString() + " of " + imgCountCN;
				currentImmageIndex = currentImmageIndex + 1;
				
			}
			else
			{
				document.getElementById(('spn'+commNewsId[i])).innerHTML = "";

			}
		}
		
    }
    switchCommNews(commNewsId[0]);
    timerInterval=setInterval("switchCommNews(GID,1)", 6000 );

}

function showProperImageSecond()
{
//    alert(document.getElementById(commNewsIdSecond[0].substring(10,8)).src);
    
    for (var j=0;j<commNewsIdSecond.length;j++)
    {
      if(document.getElementById(commNewsIdSecond[j]))
      {
		var len;
		var imgSrc; 
		
		len=String(commNewsIdSecond[j]).length;
		imgSrc = String(commNewsIdSecond[j].substr(len-2,2));
		
	      if(document.getElementById(imgSrc))
	      	
	      {
	      	 imgCountCNSecond = imgCountCNSecond+1;
	      }
      
      }
      
    }
    //replace x of y text in each div with correct image number and count
    var currentImmageIndexSecond=1; 
    for (var j=0;j<commNewsIdSecond.length;j++)
    { 
	    if(document.getElementById(commNewsIdSecond[j-2]))
	      {
			var len;
			var imgSrc; 

			len=String(commNewsIdSecond[j-2]).length;
			imgSrc = String(commNewsIdSecond[j].substr(len-2,2));
			
			if(document.getElementById(imgSrc))

			{
				
				document.getElementById(('spn'+commNewsIdSecond[j-2])).innerHTML = (currentImmageIndexSecond).toString() + " of " + imgCountCNSecond;
				currentImmageIndexSecond = currentImmageIndexSecond + 1;
				
			}
			else
			{
				document.getElementById(('spn'+commNewsIdSecond[j-2])).innerHTML = "";

			}
		}
		
}

  switchCommNewsSecond(commNewsIdSecond[0]);
    timerInterval=setInterval("switchCommNewsSecond(GIDSecond,1)", 6000 );

}








function switchCommNews(id,autoTimer){
	if(imgCountCN<1)
	{return;}
	
	 if ( autoTimer == undefined ) 
	 {
	     
	     clearInterval(timerInterval);
	  }
	    
	
	
	var divIdLen = String(id).length;
	var imgId=String(id).substring(divIdLen, divIdLen-2);
	
	
	//alert('id : '+ id);
	//alert('GID start : '+ GID);
	//alert('imgid : '+ imgId);
	
	
	if(document.getElementById(imgId))
	{	
		if (imgId < 11)
			{
				if (imgId < 9)
					{
						GID=(String(id).substring(0, divIdLen-2) + '0' + (parseInt(imgId,12)+1));
					}
					else
					{
						GID=(String(id).substring(0, divIdLen-2) + (parseInt(imgId,12)+1));
					}
					
			}
			else
			{
			
				GID=commNewsId[0];
			}
		hideallCommNews();showCommNewsdiv(id);
		
	}
	else
	{	
		if (imgId < 11)
		{
			if (imgId < 9)
			{
				GID=(String(id).substring(0, divIdLen-2) + '0' + (parseInt(imgId,12)+1));
			}
			else
			{
				GID=(String(id).substring(0, divIdLen-2) + (parseInt(imgId,12)+1));
			}
		}
		else
		{
			GID=commNewsId[0];
		}
		
		if ( autoTimer == undefined ) 
		{
			switchCommNews(GID);      
	   	}
	   	else
	   	{
			switchCommNews(GID,1); 
		}
		
	}
	
	
}




function switchCommNewsSecond(id,autoTimer){
	if(imgCountCNSecond<1)
	{return;}
	
	 if ( autoTimer == undefined ) 
	 {
	     
	     clearInterval(timerIntervalSecond);
	  }
	    
	
	
	var divIdLen = String(id).length;
	var imgId=String(id).substring(divIdLen, divIdLen-2);
	
	
	//alert('id : '+ id);
	//alert('GID start : '+ GID);
	//alert('imgid : '+ imgId);
	
	
	if(document.getElementById(imgId))
	{	
		if (imgId < 20)
			{
				if (imgId < 9)
					{
						GIDSecond=(String(id).substring(0, divIdLen-2) + '0' + (parseInt(imgId,12)+1));
					}
					else
					{
						GIDSecond=(String(id).substring(0, divIdLen-2) + (parseInt(imgId,12)+1));
					}
					
			}
			else
			{
			
				GIDSecond=commNewsIdSecond[0];
			}
		hideallCommNewsSecond();showCommNewsdiv(id);
		
	}
	else
	{	
		if (imgId < 20)
		{
			if (imgId < 9)
			{
				GIDSecond=(String(id).substring(0, divIdLen-2) + '0' + (parseInt(imgId,12)+1));
			}
			else
			{
				GIDSecond=(String(id).substring(0, divIdLen-2) + (parseInt(imgId,12)+1));
			}
		}
		else
		{
			GIDSecond=commNewsIdSecond[0];
		}
		
		if ( autoTimer == undefined ) 
		{
			switchCommNewsSecond(GIDSecond);      
	   	}
	   	else
	   	{
			switchCommNewsSecond(GIDSecond,1); 
		}
		
	}
	
	
}













function hideallCommNews(){
	for (var i=0;i<commNewsId.length;i++)
	{
	    if(document.getElementById(commNewsId[i]))
		hideCommNewsdiv(commNewsId[i]);
	
	}		  
}

function hideallCommNewsSecond(){
	for (var i=0;i<commNewsIdSecond.length;i++)
	{
	    if(document.getElementById(commNewsIdSecond[i]))
		hideCommNewsdiv(commNewsIdSecond[i]);
	
	}		  
}







function hideallCommNews(){
	for (var i=0;i<commNewsId.length;i++)
	{
	    if(document.getElementById(commNewsId[i]))
		hideCommNewsdiv(commNewsId[i]);
	
	}		  
}


function hideCommNewsdiv(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
	else {if (document.layers) {document.id.display = 'none';}
		else {document.all.id.style.display = 'none';}}
}

function showCommNewsdiv(id) {
	if (document.getElementById) {document.getElementById(id).style.display = 'block'}
	else {if (document.layers) {document.id.display = 'block';}
		else {document.all.id.style.display = 'block';}}
}



/*********************Ends | Community Slideshow***********************/


/*********************Starts | Recent News Small***********************/
var recentNewsHMId=new Array('recentNewsHM1','recentNewsHM2','recentNewsHM3','recentNewsHM4','recentNewsHM5');
var recentNewsHMSpanId=new Array('1','2','3','4','5');
var paginationIDs=new Array('pagination1','pagination2','pagination3','pagination4','pagination5');
function showRecentNews()
{
    var imgCount=0;
    for (var i=0;i<recentNewsHMSpanId.length;i++)
    {
      var imgSrc = document.getElementById(recentNewsHMSpanId[i]).innerHTML;
      if(imgSrc != "")
      {
         imgCount = imgCount+1;
	 
      }
    }
    //replace x of y text in each div with correct image number and count
    var currentImmageIndex=1; 
    for (var i=0;i<recentNewsHMId.length;i++)
    { 
      var imgSrc = document.getElementById(recentNewsHMSpanId[i]).innerHTML;

      if(imgSrc != "")
	{
		document.getElementById(('spn'+recentNewsHMId[i])).innerHTML = (currentImmageIndex).toString() + " of " + imgCount;
        currentImmageIndex = currentImmageIndex + 1;
	}
     else
     {
        document.getElementById(('spn'+recentNewsHMId[i])).innerHTML = "";
     }
    }
}
function switchRecentNewsHM(id){
	
	var divIdLen = String(id).length;
	var imgId=String(id).substring(divIdLen, divIdLen-1);
	if (imgId>5)
	{
	switchRecentNewsHM(paginationIDs[0]);
	return;
	}
	
	if(imgId<=5)
	var tmp=String(id).substring(0, divIdLen-1)+ (parseInt(imgId)+1);
	var imgSrc= (String(document.getElementById(imgId).innerHTML));
	if(imgSrc != "")
	{
	hideallRecentNewsHM();
	showRecentNewsHMdiv(imgId,id);
	}
	else
	{
	
		switchRecentNewsHM(tmp);
	}	 
}

function hideallRecentNewsHM(){
	for (var i=0;i<recentNewsHMSpanId.length;i++)
		{hideRecentNewsHMdiv(recentNewsHMSpanId[i]);
		hideRecentNewsHMdiv(recentNewsHMId[i]);
		hideRecentNewsHMdiv(paginationIDs[i]);
		
		}		  
}

function hideRecentNewsHMdiv(id,id2) {
	if (document.getElementById) {document.getElementById(id).style.display = 'none';}
	else {if (document.layers) {document.id.display = 'none';}
		else {document.all.id.style.display = 'none';}}
}


function showRecentNewsHMdiv(id,id2) {
var recentNewsID = 'recentNewsHM' + id;
if (document.getElementById) {document.getElementById(id).style.display = 'block';document.getElementById(id2).style.display = 'block';document.getElementById(recentNewsID).style.display = 'block'}
	else {if (document.layers) {document.id.display = 'block';document.id2.display = 'block';document.recentNewsID.display = 'block';}
		else {document.all.id.style.display = 'block';document.all.id2.style.display = 'block';document.all.recentNewsID.style.display = 'block';}}
}
/*********************Starts | Recent News Small***********************/

/**Clears Text on Click of Search Text Box**/
function clearTextBox(){
document.getElementById("searchTextboxId").value=""
}
/**Clears Text on Click of Search Text Box**/




// constants to define the title of the alert and button text.
var ALERT_TITLE = "Disclaimer";
var ALERT_BUTTON_TEXT = "Cancel";
var ALERT_BUTTON_YES = "Yes";

// over-ride the alert method only if this a newer browser.
// Older browser will see standard alerts
if(document.getElementById) {
  window.confirm = function(txt,href) {
    createCustomAlert(txt,href);
  }
}

function createCustomAlert(txt,href) {
  // shortcut reference to the document object
  d = document;

  // if the modalContainer object already exists in the DOM, bail out.
  if(d.getElementById("modalContainer")) return;

  // create the modalContainer div as a child of the BODY element
  mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
  mObj.id = "modalContainer";
   // make sure its as tall as it needs to be to overlay all the content on the page
  mObj.style.height = document.documentElement.scrollHeight + "px";

  // create the DIV that will be the alert 
  alertObj = mObj.appendChild(d.createElement("div"));
  alertObj.id = "alertBox";
  // MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
  if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
  // center the alert box
  alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

  // create an H1 element as the title bar
  h1 = alertObj.appendChild(d.createElement("h1"));
  h1.appendChild(d.createTextNode(ALERT_TITLE));

  // create a paragraph element to contain the txt argument
  msg = alertObj.appendChild(d.createElement("p"));
  msg.innerHTML = txt;
  
  // create an anchor element to use as the confirmation button.
    
  btn = alertObj.appendChild(d.createElement("a"));
  btn.id = "yesBtn";
  btn.appendChild(d.createTextNode(ALERT_BUTTON_YES));
btn.href = href;
  
  
  btn = alertObj.appendChild(d.createElement("a"));
  btn.id = "closeBtn";
  btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
  btn.href = "#";
  // set up the onclick event to remove the alert when the anchor is clicked
  btn.onclick = function() { removeCustomAlert();return false; }
  
  

}

// removes the custom alert from the DOM
function removeCustomAlert() {
  document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}

//Twitter Icon rollover code
var tooltip=function(){

    var id = 'tt';
    var top = 3;
    var left = 3;
    var maxw = 300;
    var speed = 10;
    var timer = 20;
    var endalpha = 95;
    var alpha = 0;
    var tt,t,c,b,h;
    var ie = document.all ? true : false;
    return{
        show:function(v,w){

            if(tt == null){
                tt = document.createElement('div');
                tt.setAttribute('id',id);
                t = document.createElement('div');
                t.setAttribute('id',id + 'top');
                c = document.createElement('div');
                c.setAttribute('id',id + 'cont');
                b = document.createElement('div');
                b.setAttribute('id',id + 'bot');
                tt.appendChild(t);
                tt.appendChild(c);
                tt.appendChild(b);
                document.body.appendChild(tt);
                tt.style.opacity = 0;
                tt.style.filter = 'alpha(opacity=0)';
                document.onmousemove = this.pos;
            
}
            tt.style.display = 'block';
            c.innerHTML = v;
            tt.style.width = w ? w + 'px' : 'auto';
            if(!w && ie){
                t.style.display = 'none';
                b.style.display = 'none';
                tt.style.width = tt.offsetWidth;
                t.style.display = 'block';
                b.style.display = 'block';
            }
            if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
            h = parseInt(tt.offsetHeight) + top;
            clearInterval(tt.timer);
            tt.timer = setInterval(function(){tooltip.fade(1)},timer);
        },
        pos:function(e){
            var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
            var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
            tt.style.top = (u - h) + 'px';
            tt.style.left = (l + left) + 'px';
        },
        fade:function(d){
            var a = alpha;
            if((a != endalpha && d == 1) || (a != 0 && d == -1)){
                var i = speed;
                if(endalpha - a < speed && d == 1){
                    i = endalpha - a;
                }else if(alpha < speed && d == -1){
                    i = a;
                }
                alpha = a + (i * d);
                tt.style.opacity = alpha * .01;
                tt.style.filter = 'alpha(opacity=' + alpha + ')';
            }else{
                clearInterval(tt.timer);
                if(d == -1){tt.style.display = 'none'}
            }
        },
        hide:function(){
            clearInterval(tt.timer);
            tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
        }
    };
}();



