//UK file under MSIM_UK
// *****************************************************************************
// **                                SETTINGS                                 **
// *****************************************************************************

// 'linka' use this if part of the URL is the same in ALL the links
// In this example all the files are in a subfolder called 'pages'
linka='';

// get the filename
var pathfrag = document.location.pathname;
var frag = pathfrag.split('/');
var relativeprefix ='';
var currdir='';
var absolutelink='';

var hostName = document.location.hostname;
//alert (hostName);

//this establishes the relative location of dynamic script components.

if (hostName.indexOf("vkm") >-1)
{
					if (document.location.href.indexOf("11112") > -1) // search cross site linkability
					{
							environ ="devsearch";
							expected_site_parent = "absolute";
							absolutelink = "http://pisas268.ms.com:90/im/uk/";
					}
					else
					{
						environ ="vkm";
						expected_site_parent="msim_uk";
					}
}
else if (hostName.indexOf("pisas268") >-1 || hostName.indexOf("hqias19") >-1 )
{				
					environ ="QA-1";
					expected_site_parent="uk";
				}
else if (hostName.indexOf("morganstanley") >-1)
{				
				if (hostName.indexOf("search.morganstanley") >-1)
				{
					environ ="prodsearch";
					expected_site_parent="absolute";
					absolutelink = "http://www.morganstanley.com/im/uk/";
				}		
				else {
					environ ="prod";
					expected_site_parent="uk";
				}	
}	
				
else if (hostName.indexOf("mgagt47") >-1  || hostName.indexOf("mgagt10") >-1 )
{				
					environ ="dynamic";
					expected_site_parent="uk";
				}				
						

else if (hostName.indexOf("web.ms.com") >-1)
{				
					environ ="WebPub";
					expected_site_parent="uk";
				}				
						
							


else if (hostName.indexOf("pisws1") >-1)
{				
					environ ="webpub";
					expected_site_parent="iim_redesign_site-uk";
				}					



	
frag.reverse();
thisPage=frag[0];
currdir = frag[1]





if (currdir == expected_site_parent)
{
	
	if (environ != "prod")
		{ 
			status = "we are in the " + environ + " environment";
		}
	
	relativprefix = '';
}
else if (currdir == 'archive' || currdir == 'segpool' || currdir == 'UKMAC' || currdir == 'addproducts' || currdir == 'pricearch' || currdir == 'webapp')
{
	relativeprefix = "../../";
}

else if (currdir == '2001' || currdir == '2002' || currdir == '2003')
{
	relativeprefix = "../../../";
}

else
{
	if (expected_site_parent=="absolute")
	{
		relativeprefix = absolutelink;
	}
	else relativeprefix = "../";
}

//alert("relativeprefix:" + relativeprefix);
// Do you want to use images for the category bullets?
// If so then specify the path to your images folder from the menu page
imgPath=relativeprefix + 'common/images/';

// do you want to use images for the category bullets?
lev1img='yes';					// insert yes or no

// give image names and dimensions
lev1OpName='v_green_arrow.gif';			// open image name
lev1OpHeight='4';				// image height
lev1OpWidth='9';				// image width

lev1ClosName='h_grey_arrow.gif';		// closed image name
lev1ClosHeight='7';			// image height
lev1ClosWidth='9';				// image width

// do you want to use images for the sub-category bullets?
lev2img='no';		// insert yes or no

// give image names and dimensions
lev2Name='';			// image name
lev2Height='';				// image height
lev2Width='';					// image width

// do you want to use a text character for the sub-category bullets?
lev2Char='no';		// insert yes or no

// set bullet character for level 2 bullets
bullet = '';

// base target - the frame that the links are targetting
base = '';

// *****************************************************************************
// **                             END OF SETTINGS                             **
// *****************************************************************************

// pulls 'page' variable out of URL - do not alter
if (!window.page){
	var x = 0
	page = location.search.substr(1).split("?")
	for (x=0;x<=page.length;x++) {
		eval(page)
		}
page = escape(page);
page = page.slice(7);
}
// do not alter this bit
function subMenu(name,linkb) {
 this.name = name;
 this.linkb = linkb;
}
document.write('<BASE target="' + base + '">');

// *****************************************************************************
// **                             BUILD MENU DATA                             **
// *****************************************************************************

// Securities
if (page=='home') {
thisMenu = new Array();
/*thisMenu[0] = new subMenu('&nbsp;&nbsp;&nbsp;Fixed Income','../../securities/fixed_income.html?page=securities');
thisMenu[1] = new subMenu('&nbsp;&nbsp;&nbsp;Equity','../../securities/equity.html?page=securities');
thisMenu[2] = new subMenu('&nbsp;&nbsp;&nbsp;Foreign Exchange','../../securities/foreign_exchange.html?page=securities');
thisMenu[3] = new subMenu('&nbsp;&nbsp;&nbsp;Commodities','../../securities/commodities.html?page=securities');*/
}

// Why Morgan Stanley
if (page=='why_ms') {
thisMenu = new Array();
///thisMenu[0] = new subMenu('&nbsp;&nbsp;&nbsp;Introduction','fillin.html?page=why_ms');
//thisMenu[1] = new subMenu('&nbsp;&nbsp;&nbsp;Investment Management','fillin.html?page=why_ms');
}

// Investment Products
if (page=='inv_prod') {
thisMenu = new Array();
thisMenu[0] = new subMenu('&nbsp;Morgan&nbsp;Stanley&nbsp;Funds&nbsp;(UK)&nbsp;',relativeprefix + 'invproducts/segpool/msfunds-UK.html?page=inv_prod');
thisMenu[1] = new subMenu('&nbsp;Segregated Accounts',relativeprefix + 'invproducts/segpool/seg.html?page=inv_prod');
//thisMenu[2] = new subMenu('&nbsp;UK MAC',relativeprefix + 'invproducts/UKMAC/index.html?page=inv_prod');
thisMenu[2] = new subMenu('&nbsp;Additional Products',relativeprefix + 'invproducts/addproducts/index.html?page=inv_prod');
}

// Daily Prices
if (page=='prices') {
thisMenu = new Array();
//thisMenu[0] = new subMenu('&nbsp;&nbsp;&nbsp;Daily Prices Archive',relativeprefix + 'pricearch/webapp/default.jsp?page=prices');
}


// Morgan Stanley Views
if (page=='ms_views') {
thisMenu = new Array();
thisMenu[0] = new subMenu('&nbsp;&nbsp;&nbsp;Archive',relativeprefix + 'views/archive/index.html?page=ms_views');
}



// write Fund Managers
if (page=='managers') {
thisMenu = new Array();
}



// literature
if (page=='literature') {
thisMenu = new Array();
}


// Press releases
if (page=='press') {
thisMenu = new Array();
thisMenu[0] = new subMenu('&nbsp;&nbsp;&nbsp;Archive',relativeprefix + 'press/archive/index.html?page=press');
}




// online
if (page=='online') {
thisMenu = new Array();
}


// faqs
if (page=='faqs') {
thisMenu = new Array();
}

// contact
if (page=='contact') {
thisMenu = new Array();
}


function writeFooter()
{
document.write('<table cellpadding="0" cellspacing="0" border="0">');
document.write('<tr>');
document.write('<td width="24" ><img src="' + relativeprefix + 'common/images/clear.gif" width="24" height="14"></td>');
document.write('<td width="561" colspan="5" class="txtblack">© 2007 Morgan Stanley | <a href="http://www.morganstanley.com/privacy_pledge.html"> <span class="blacklink">Privacy</span></a> |<a class="blacklink" href="http://www.morganstanley.com/terms.html"> <span class="blacklink">Terms of Use</span></a> </td>');
document.write('<td width="24"><img src="' + relativeprefix + 'common/images/clear.gif" width="24" height="14"></td>');
document.write('</tr>');
document.write('</table>');
}

