// USE WORDWRAP AND MAXIMIZE THE WINDOW TO SEE THIS FILE
c_styles={};c_menus={}; // do not remove this line

// You can remove most comments from this file to reduce the size if you like.




/******************************************************
	(1) GLOBAL SETTINGS
*******************************************************/

c_hideTimeout=763; // 1000==1 second
c_subShowTimeout=0;
c_keepHighlighted=true;
c_findCURRENT=false; // find the item linking to the current page and apply it the CURRENT style class
c_findCURRENTTree=false;
c_overlapControlsInIE=true;
c_rightToLeft=false; // if the menu text should have "rtl" direction (e.g. Hebrew, Arabic)




/******************************************************
	(2) MENU STYLES (CSS CLASSES)
*******************************************************/

// You can define different style classes here and then assign them globally to the menu tree(s)
// in section 3 below or set them to any UL element from your menu tree(s) in the page source


c_imagesPath="../../includefiles/scripts/smartmenus/"; // path to the directory containing the menu images


c_styles['M_1']=[ // MainMenu (the shorter the class name the better)
[
// MENU BOX STYLE - not functional...for some reason
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#000000',	// BorderColor ('color')
0,		// Padding
'#000000',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#4a49a8',	// BorderColor ('color')
'#4d4c76',	// OVER BorderColor
3,		// Padding
'#003366',	// Background ('color','transparent','[image_source]')
'#8a8ccc',	// OVER Background
'#ffffff',	// Color
'#ffffff',	// OVER Color
'11px',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'bold',		// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
1,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#003366',	// ItemsSeparatorColor ('color','transparent')
0,		// ItemsSeparatorSpacing
false,			// UseSubMenuImage (true,false)
'[h_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[h_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
4,			// SubMenuImageHeight
'10',			// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#4a49a8',		// VISITED BorderColor
'#4a49a8',		// VISITED Background
'#252455',		// VISITED Color
'none',			// VISITED TextDecoration
'[h_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#CBCBEF',		// CURRENT BorderColor
'#FFFBF0',		// CURRENT Background
'#252455',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[h_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];

c_styles['S_1']=[ // SubMenus
[
// MENU BOX STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#4D4C76',	// BorderColor ('color')
0,		// Padding
'#cbcbef',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#4a49a8',	// BorderColor ('color')
'#4D4C76',	// OVER BorderColor
3,		// Padding
'#003366',	// Background ('color','transparent','[image_source]')
'#4A49A8',	// OVER Background
'#ffffff',	// Color
'#ffffff',	// OVER Color
'75%',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'bold',	// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
1,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#8a8ccc',	// ItemsSeparatorColor ('color','transparent')
0,		// ItemsSeparatorSpacing
false,			// UseSubMenuImage (true,false)
'[v_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[v_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
7,			// SubMenuImageHeight
'7',			// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#FFF5C6',		// VISITED BorderColor
'#003366',		// VISITED Background
'#ffffff',		// VISITED Color
'none',			// VISITED TextDecoration
'[v_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#CBCBEF',		// CURRENT BorderColor
'#FFFBF0',		// CURRENT Background
'#252455',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[v_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];

c_styles['M_2']=[ // MainMenu (the shorter the class name the better)
[
// MENU BOX STYLE - not functional...for some reason
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#000000',	// BorderColor ('color')
0,		// Padding
'#000000',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#4a49a8',	// BorderColor ('color')
'#4d4c76',	// OVER BorderColor
3,		// Padding
'#990000',	// Background ('color','transparent','[image_source]')
'#660000',	// OVER Background
'#ffffff',	// Color
'#ffffff',	// OVER Color
'10px',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'bold',		// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
1,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#cc3333',	// ItemsSeparatorColor ('color','transparent')
0,		// ItemsSeparatorSpacing
false,			// UseSubMenuImage (true,false)
'[h_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[h_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
4,			// SubMenuImageHeight
'10',			// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#4a49a8',		// VISITED BorderColor
'#990000',		// VISITED Background
'#ffffff',		// VISITED Color
'none',			// VISITED TextDecoration
'[h_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#CBCBEF',		// CURRENT BorderColor
'#990000',		// CURRENT Background
'#ffffff',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[h_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];

c_styles['S_2']=[ // SubMenus
[
// MENU BOX STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#4D4C76',	// BorderColor ('color')
0,		// Padding
'#cbcbef',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#cc3333',	// BorderColor ('color')
'#cc3333',	// OVER BorderColor
3,		// Padding
'#990000',	// Background ('color','transparent','[image_source]')
'#660000',	// OVER Background
'#ffffff',	// Color
'#ffffff',	// OVER Color
'75%',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'bold',	// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
1,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#8a8ccc',	// ItemsSeparatorColor ('color','transparent')
0,		// ItemsSeparatorSpacing
false,			// UseSubMenuImage (true,false)
'[v_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[v_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
7,			// SubMenuImageHeight
'7',			// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#cc3333',		// VISITED BorderColor
'#990000',		// VISITED Background
'#ffffff',		// VISITED Color
'none',			// VISITED TextDecoration
'[v_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#cc3333',		// CURRENT BorderColor
'#990000',		// CURRENT Background
'#252455',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[v_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];






/******************************************************
	(3) MENU TREE FEATURES
*******************************************************/

// Normally you would probably have just one menu tree (i.e. one main menu with sub menus).
// But you are actually not limited to just one and you can have as many menu trees as you like.
// Just copy/paste a config block below and configure it for another UL element if you like.


c_menus['MainMenu']=[ // the UL element with id="MainMenu"
[
// MAIN-MENU FEATURES
'vertical',	// ItemsArrangement ('vertical','horizontal')
'relative',	// Position ('relative','absolute','fixed')
'0',		// X Position (values in CSS valid units- px,em,ex)
'0',		// Y Position (values in CSS valid units- px,em,ex)
false,		// RightToLeft display of the sub menus
false,		// BottomToTop display of the sub menus
0,		// X SubMenuOffset (pixels)
-23,		// Y SubMenuOffset
'140px',		// Width (values in CSS valid units - px,em,ex) (matters for main menu with 'vertical' ItemsArrangement only)
'M_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
],[
// SUB-MENUS FEATURES
0,		// X SubMenuOffset (pixels)
-10,		// Y SubMenuOffset
'200px',		// Width ('auto',values in CSS valid units - px,em,ex)
'100',		// MinWidth ('pixels') (matters/useful if Width is set 'auto')
'300',		// MaxWidth ('pixels') (matters/useful if Width is set 'auto')
'S_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
]];

c_menus['AdditionalMenu']=[ // the UL element with id="MainMenu"
[
// MAIN-MENU FEATURES
'vertical',	// ItemsArrangement ('vertical','horizontal')
'relative',	// Position ('relative','absolute','fixed')
'0',		// X Position (values in CSS valid units- px,em,ex)
'10px',		// Y Position (values in CSS valid units- px,em,ex)
false,		// RightToLeft display of the sub menus
false,		// BottomToTop display of the sub menus
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'140px',		// Width (values in CSS valid units - px,em,ex) (matters for main menu with 'vertical' ItemsArrangement only)
'S_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
],[
// SUB-MENUS FEATURES
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'200px',		// Width ('auto',values in CSS valid units - px,em,ex)
'100',		// MinWidth ('pixels') (matters/useful if Width is set 'auto')
'300',		// MaxWidth ('pixels') (matters/useful if Width is set 'auto')
'S_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
]];

c_menus['TableOptions']=[ // the UL element with id="MainMenu"
[
// MAIN-MENU FEATURES
'vertical',	// ItemsArrangement ('vertical','horizontal')
'relative',	// Position ('relative','absolute','fixed')
'0',		// X Position (values in CSS valid units- px,em,ex)
'0',		// Y Position (values in CSS valid units- px,em,ex)
false,		// RightToLeft display of the sub menus
false,		// BottomToTop display of the sub menus
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'140px',		// Width (values in CSS valid units - px,em,ex) (matters for main menu with 'vertical' ItemsArrangement only)
'M_2',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
],[
// SUB-MENUS FEATURES
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'200px',		// Width ('auto',values in CSS valid units - px,em,ex)
'100',		// MinWidth ('pixels') (matters/useful if Width is set 'auto')
'300',		// MaxWidth ('pixels') (matters/useful if Width is set 'auto')
'S_2',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
]];

c_menus['dev']=[ // the UL element with id="MainMenu"
[
// MAIN-MENU FEATURES
'vertical',	// ItemsArrangement ('vertical','horizontal')
'relative',	// Position ('relative','absolute','fixed')
'0',		// X Position (values in CSS valid units- px,em,ex)
'20px',		// Y Position (values in CSS valid units- px,em,ex)
false,		// RightToLeft display of the sub menus
false,		// BottomToTop display of the sub menus
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'140px',		// Width (values in CSS valid units - px,em,ex) (matters for main menu with 'vertical' ItemsArrangement only)
'S_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
],[
// SUB-MENUS FEATURES
0,		// X SubMenuOffset (pixels)
100,		// Y SubMenuOffset
'200px',		// Width ('auto',values in CSS valid units - px,em,ex)
'100',		// MinWidth ('pixels') (matters/useful if Width is set 'auto')
'300',		// MaxWidth ('pixels') (matters/useful if Width is set 'auto')
'S_1',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
]];

///////////////////////////////////////////
//////////////////////////////////////////
////////////////DEV LINKS////////////////
/////////////////////////////////////////
/////////////////////////////////////////
c_styles['MM']=[ // MainMenu (the shorter the class name the better)
[
// MENU BOX STYLE
0,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#8F90C4',	// BorderColor ('color')
0,		// Padding
'#CBCBEF',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
2,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#003366',	// BorderColor ('color')
'#4d4c76',	// OVER BorderColor
4,		// Padding
'#dfdbf5',	// Background ('color','transparent','[image_source]')
'#CBCBEF',	// OVER Background
'#252455',	// Color
'#000000',	// OVER Color
'76%',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'bold',		// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
1,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#CBCBEF',	// ItemsSeparatorColor ('color','transparent')
0,		// ItemsSeparatorSpacing
true,			// UseSubMenuImage (true,false)
'[h_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[h_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
4,			// SubMenuImageHeight
'middle',		// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#003366',		// VISITED BorderColor
'#dfdbf5',		// VISITED Background
'#252455',		// VISITED Color
'none',			// VISITED TextDecoration
'[h_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#003366',		// CURRENT BorderColor
'#FFFBF0',		// CURRENT Background
'#252455',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[h_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];


c_styles['SM']=[ // SubMenus
[
// MENU BOX STYLE
1,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'#4D4C76',	// BorderColor ('color')
3,		// Padding
'#FFF5C6',	// Background ('color','transparent','[image_source]')
'',		// IEfilter (only transition filters work well - not static filters)
''		// Custom additional CSS for the menu box (valid CSS)
],[
// MENU ITEMS STYLE
1,		// BorderWidth
'solid',	// BorderStyle (CSS valid values except 'none')
'solid',	// OVER BorderStyle
'#FFF5C6',	// BorderColor ('color')
'#4D4C76',	// OVER BorderColor
3,		// Padding
'#FFF5C6',	// Background ('color','transparent','[image_source]')
'#CBCBEF',	// OVER Background
'#252455',	// Color
'#000000',	// OVER Color
'75%',		// FontSize (values in CSS valid units - %,em,ex,px,pt)
'verdana,arial,helvetica,sans-serif',	// FontFamily
'normal',	// FontWeight (CSS valid values - 'bold','normal','bolder','lighter','100',...,'900')
'none',		// TextDecoration (CSS valid values - 'none','underline','overline','line-through')
'none',		// OVER TextDecoration
'left',		// TextAlign ('left','center','right','justify')
2,		// ItemsSeparatorSize
'solid',	// ItemsSeparatorStyle (border-style valid values)
'#CBCBEF',	// ItemsSeparatorColor ('color','transparent')
2,		// ItemsSeparatorSpacing
true,			// UseSubMenuImage (true,false)
'[v_arrow.gif]',	// SubMenuImageSource ('[image_source]')
'[v_arrow_over.gif]',	// OverSubMenuImageSource
7,			// SubMenuImageWidth
7,			// SubMenuImageHeight
'middle',		// SubMenuImageVAlign ('pixels from item top','middle')
'solid',		// VISITED BorderStyle
'#FFF5C6',		// VISITED BorderColor
'#FFF5C6',		// VISITED Background
'#252455',		// VISITED Color
'none',			// VISITED TextDecoration
'[v_arrow.gif]',	// VISITED SubMenuImageSource
'solid',		// CURRENT BorderStyle
'#CBCBEF',		// CURRENT BorderColor
'#FFFBF0',		// CURRENT Background
'#252455',		// CURRENT Color
'none',			// CURRENT TextDecoration
'[v_arrow.gif]',	// CURRENT SubMenuImageSource
'',		// Custom additional CSS for the items (valid CSS)
'',		// OVER Custom additional CSS for the items (valid CSS)
'',		// CURRENT Custom additional CSS for the items (valid CSS)
''		// VISITED Custom additional CSS for the items (valid CSS)
]];
c_menus['SM1']=[ // the UL element with id="SM1"
[
// MAIN-MENU FEATURES
'horizontal',	// ItemsArrangement ('vertical','horizontal')
'absolute',	// Position ('relative','absolute','fixed','popup') ('popup' will be supported through an add-on)
'0px',		// X Position (values in CSS valid units- px,em,ex -OR- 'pixels','JS_expression' for 'popup' menus)
'0px',		// Y Position (values in CSS valid units- px,em,ex -OR- 'pixels','JS_expression' for 'popup' menus)
false,		// RightToLeft display of the sub menus
false,		// BottomToTop display of the sub menus
0,		// X SubMenuOffset (pixels)
0,		// Y SubMenuOffset
'10em',		// Width (values in CSS valid units - px,em,ex) (for main menu with 'vertical' ItemsArrangement only)
'MM',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
],[
// SUB-MENUS FEATURES
5,		// X SubMenuOffset (pixels)
1,		// Y SubMenuOffset
'auto',		// Width ('auto',values in CSS valid units - px,em,ex)
'100',		// MinWidth ('pixels') (matters/useful if Width is set 'auto')
'300',		// MaxWidth ('pixels') (matters/useful if Width is set 'auto')
'SM',		// CSS Class (one of the defined in section 2)
false		// Open sub-menus onclick (default is onmouseover)
]];
///////////////////////////////////////////
//////////////////////////////////////////
//////////END OF DEV LINKS//////////////
/////////////////////////////////////////
/////////////////////////////////////////

// THIS CODE IS NOT PART OF SMARTMENUS, WRTITTEN TO SUPPORT AJAX LOADING OF MENUS
function loadSM(classStr,menu,x){
	var menu = document.getElementById(menu);
	if(g_val_3=="" || classStr.indexOf("off")>-1 || menu.className=="loaded"){
		return;
	}

	menu.className = "loaded";
	var handleSuccess = function(o){
		if(o.responseText !== undefined){
			menu.innerHTML += o.responseText;
		}
	}
	var handleFailure = function(o){
		if(o.responseText !== undefined){
			alert("Error: submenu faliled to load...");
		}
	}
	var callback ={success:handleSuccess,failure: handleFailure};
	YAHOO.util.Connect.initHeader('Content-Type','text/html; charset=ISO-8859-1');
	YAHOO.util.Connect.asyncRequest('GET', theserver+'/IncludeFiles/menus_ajax.asp'+x, callback);
}

function loadURL(url){
	location.href = url;
}

/**
* Add/Change/Remove a single key=value pair from
* the query string and reload the page
* @param {String} key The key name
* @param {String} value The the value
* @param {Integer} qStringOverwrite (Optional) 0 - change one key=value pair only (default), 1 - remove everything but the passed key=value pair
* @param {Integer} immediateReload (Optional) 0 - do not reload page after the function call, 1 - reload page as soon as this function is called (default)
*/
function changeParam(key,value,qStringOverwrite,immediateReload){
	var url = location.href.split('?')[0];
	
	// When no arguments passed, reload the page with the most recent 'version' of query string
	if(arguments.length==0){
		loadURL(url + '?' + x1_4b8T);
		return;
	}
	
	qStringOverwrite = typeof qStringOverwrite=='undefined' ? 0 : qStringOverwrite;
	immediateReload = typeof immediateReload=='undefined' ? 1 : immediateReload;
	
	if(rdt4x18){ // do some server side magic using ajax, encryption is turned on
		var ok = function(o){
			if(o.responseText !== undefined){
				x1_4b8T = o.responseText
				immediateReload && loadURL(url+'?'+x1_4b8T);
			}
		}
		var fail = function(o){
			if(o.responseText !== undefined){
				alert("changeParam() failed...\n\n"+o.responseText);
			}
		}		
		var data = 'x1='+encodeURIComponent(key)+'&x2='+(value==null ? '' : encodeURIComponent(value))+'&x3='+encodeURIComponent(qStringOverwrite)+'&x4='+encodeURIComponent(x1_4b8T);
		YAHOO.util.Connect.asyncRequest('POST', theserver+'/communityaccounts/onlinedata/changeParam.asp', {success:ok,failure:fail}, data);	
	
	}else{ // no need to bother the server, ecnryption is turned off
		key = unescape(key).toLowerCase();
		value = unescape(value);
		var inQstring = new RegExp('\&?'+key+'=[^\&]*','g');
		if(qStringOverwrite==0){ // changing only one key=value pair, leaving the rest of the key=value pairs unchanged
			if(value==null){ //remove key=value pair from query string
				if(x1_4b8T==''){ // there's no query string at all - simply reload
					x1_4b8T = '';
					immediateReload && loadURL(url);		
				}else if(x1_4b8T.match(inQstring)){ // the key=value pair is in the query string - remove it
					var re = new RegExp(key+'=[^\&]*','g');
					x1_4b8T = x1_4b8T.replace(/#/,'').replace(re,'');
					immediateReload && loadURL(url+'?'+x1_4b8T);								
				}else{ // the key=value pair is NOT in the query string but there's a query string - reload
					x1_4b8T = x1_4b8T.replace(/#/,'');
					immediateReload && loadURL(url+'?'+x1_4b8T);	
				}	
			}else{ // update/create key=value pair
				if(x1_4b8T==''){ // there's no query string at all - create it
					x1_4b8T = key+'='+value;
					immediateReload && loadURL(url+'?'+x1_4b8T);						
				}else if(x1_4b8T.match(inQstring)){ // the key=value pair is already in the query string - update it
					var re = new RegExp(key+'=[^\&]*','g');
					//Lowercase everything
					x1_4b8T=x1_4b8T.toLowerCase();
					x1_4b8T = x1_4b8T.replace(/#/,'').replace(re,key+'='+value);
					immediateReload && loadURL(url+'?'+x1_4b8T);
				}else{ // the key=value pair is NOT in the query string but there's a query string - add it
					x1_4b8T = x1_4b8T.replace(/#/,'')+'&'+key+'='+value;
					immediateReload && loadURL(url+'?'+x1_4b8T);
				}
			}
		}else{ // overwrite the query string, adding/changing only the passed in key=value pair
			x1_4b8T = key+'='+value;
			immediateReload && loadURL(url+'?'+x1_4b8T);	
		}
	}
}

function openGeogSelector(geog){
	popup = window.open(theserver+'/communityaccounts/onlinedata/geogpage.asp?geogtype='+geog+'&popup=1','popup','width=600,height=400');
	popup.focus();
}

function clearBox(o){
	o.value='';
}

function checkMenuSearchStr(e,o,n,v){
	if(c_hideTimeout==0){
		document.getElementById(v+'_search_nodata').style.display = "none";
	}
	c_hideTimeout=0;

    if($e.getCharCode(e)==13){ // "return" key
        changeParam(n,$('menu_'+v+'_options').value);
	}else{
		var txt = o.value.toLowerCase();
		var length = txt.length;
		var select = document.getElementById("menu_"+v+"_options");
		var options = select.options;
		for(var i=1; i<options.length; i++){
			if(options[i].innerHTML.substring(0,length).toLowerCase()==txt){
				select.selectedIndex = i;
				return;
			}
		}
	}
}

// legacy code
function replace(c){
	changeParam('comval',c);
}
function popupchart(file,wsize,hsize){
    msgWindow=open(file,"window2","resizable=yes,scrollbars=yes,width="+wsize+",height="+hsize+",screenX=0,screenY=0,top=0,left=0");
}