function catObject(id,title,icon_min,icon_edit,icon_close,helpURL,list,scheme,hasJs) {
	this.id=id;
	this.title=title;
	this.icon_min=icon_min;
	this.icon_edit=icon_edit;
	this.icon_close=icon_close;
	this.helpURL = helpURL;
	this.list = list;
	this.scheme = scheme;
	this.hasJs = hasJs;
}
function searchCatObject(id,title,icon_min,icon_edit,icon_close,helpURL,list,scheme,hasJs,isContextOrHelp) {
	this.id=id;
	this.title=title;
	this.icon_min=icon_min;
	this.icon_edit=icon_edit;
	this.icon_close=icon_close;
	this.helpURL = helpURL;
	this.list = list;
	this.scheme = scheme;
	this.hasJs = hasJs;
	this.isContextOrHelp = isContextOrHelp;
}
function getDisplayIconHtml(icon,scheme) {
	var oppIcon = icon.match(/on/) ? icon.replace(/on/,'off') : icon.replace(/off/,'on');
	var color = getColorForScheme(scheme);
	var type = icon.replace(/_.*/,''); //edit_on.gif -> edit
	var alt = alt_texts[type];
	
	var iconClass = (type == "help") ? "portlet_header_help_icon" : "portlet_tool_icon";
	return "<img src='"+img_path+"icons/"+color+"/"+icon+"' title=\""+alt+"\" alt=\""+alt+"\" class='"+iconClass+"' onmouseover='changeIcon(this,\""+color+"/"+oppIcon+"\");' onmouseout='changeIcon(this,\""+color+"/"+icon+"\");' />";
}
function getDisplaySearchIconHtml(icon,scheme) {
	var oppIcon = icon.match(/on/) ? icon.replace(/on/,'off') : icon.replace(/off/,'on');
	var color = getColorForScheme(scheme);
	var type = icon.replace(/_.*/,''); //edit_on.gif -> edit
	var alt = alt_texts[type];
	
	var iconClass = "portlet_header_help_search_icon";
	return "<img src='"+img_path+"icons/"+color+"/"+icon+"' title=\""+alt+"\" alt=\""+alt+"\" class='"+iconClass+"' onmouseover='changeIcon(this,\""+color+"/"+oppIcon+"\");' onmouseout='changeIcon(this,\""+color+"/"+icon+"\");' />";
}
//  The following function the color for the given scheme
function getColorForScheme(scheme) {
	var color = "blue";
	if (scheme == "more") {
		color = "orange";
	} else if (scheme == "account" || scheme == "myaccount" || scheme == "myaccount signin") {
		color = "red";
	} else if (scheme == "search") {
		color = "gray";
	}
	return color;
}
function enableMoveContent()
{
	try{
		if((page_config_move == 'true') && (PageName == 'Home') && ((scheme=='medical') || (scheme=='more'))){
			for (var i in content_placeholder )	{	
			changeObjectVisibility('image_'+ content_placeholder[i], 'block');
			}
		}
	}
	catch(e){
		
	}
}
function container_header(subsID,dropDownValue,catObj,scheme, namedanchor) {
	document.write('<div id="header_' + subsID + '" class="portlet_header"><div '+namedanchor+' class="portlet_header_left_shadow">');
	var hidedPortlet=false;
	if (scheme=='medical' || scheme=='more'){					
		if (document.getElementById("placeholder_"+subsID).className.indexOf("hide") != -1) hidedPortlet=true;
	}
	if(!hidedPortlet){
		contentarea[subsID] = subsID;// init here we are assigning the subid to this content area array
		content_placeholder[subsID] = subsID;
	}
	else if (PageName == 'Home'){
		if (scheme=='medical'){total_count_medical--;}
		else {total_count_more--; }
	}

	var title = catObj.title;
	var catObjName = "cat_"+subsID;
	var usrlocale = "";
	var icon_min=catObj.icon_min;
	var icon_close=catObj.icon_close;

	if (scheme == scheme_more && catObj.list != '') {
		title = '';
	}
	html ='<span id="title_' + subsID + '" class="portlet_header_title">' + title + '</span>';
	if (catObj.helpURL != '') {
		html += "<span class='portlet_header_help' id='help_"+subsID+"'>";
		if(getCookie("TIBCOSessionID") == null){
			page_locale=page_locale.substring(1,6);
			if(catObj.isContextOrHelp == 'true'){
if(UserLocale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "da_DK")||(UserLocale == "hu_HU")||(UserLocale == "de_AT")||(UserLocale == "fi_FI")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")||(UserLocale == "en_AE")||(UserLocale == "is_IS")||(UserLocale == "en_IE")||(UserLocale == "iw_IL")||(UserLocale == "it_IT")||(UserLocale =="fr_FR")){
                                usrlocale = UserLocale;

html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "en_PK")||(UserLocale == "en_LB")||(UserLocale == "en_SA")){

                                usrlocale = "en_AE";
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}


else if(page_locale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";

                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((page_locale == "da_DK")||(page_locale == "hu_HU")||(page_locale == "de_AT")||(page_locale == "fi_FI")||(page_locale== "es_ES")||(page_locale == "no_NO")||(page_locale== "fr_CH")||(page_locale== "de_CH")||(page_locale== "nl_NL")||(page_locale == "en_CA")||(page_locale  == "fr_BE")||(page_locale  == "fr_CA")||(page_locale  == "sv_SE")||(page_locale  == "et_EE")||(page_locale  == "en_IN")||(page_locale == "pt_PT")||(page_locale == "de_DE")||(page_locale == "tr_TR")||(page_locale == "nl_BE")||(page_locale == "en_ZA")||(page_locale == "en_AE")||(page_locale == "is_IS")||(page_locale == "en_IE")||(page_locale =="iw_IL")||(page_locale == "it_IT")||(page_locale=="fr_FR")){
                                usrlocale = page_locale;

html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((page_locale == "en_PK")||(page_locale == "en_LB")||(page_locale == "en_SA")){
                                usrlocale = "en_AE";
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}


else
                {
                                html += "<a href='Javascript:goToHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";

                            html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);
                }
                }
  else {
                            if(UserLocale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>"
;
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "da_DK")||(UserLocale == "hu_HU")||(UserLocale == "de_AT")||(UserLocale == "fi_FI")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")||(UserLocale == "en_AE")||(UserLocale == "is_IS")||(UserLocale == "en_IE")||(UserLocale == "iw_IL")||(UserLocale == "it_IT")||(UserLocale == "fr_FR")){
                                   usrlocale=UserLocale;

 html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
 html += getDisplayIconHtml('help_off.gif',catObj.scheme);}


 else if((UserLocale == "en_PK")||(UserLocale == "en_LB")||(UserLocale == "en_SA")){
                                usrlocale = "en_AE";
html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
 html += getDisplayIconHtml('help_off.gif',catObj.scheme);}


  else if(page_locale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>"
;
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}

else if((page_locale == "da_DK")||(page_locale == "hu_HU")||(page_locale == "de_AT")||(page_locale == "fi_FI")||(page_locale== "es_ES")||(page_locale == "no_NO")||(page_locale== "fr_CH")||(page_locale== "de_CH")||(page_locale== "nl_NL")||(page_locale == "en_CA")||(page_locale  == "fr_BE")||(page_locale  == "fr_CA")||(page_locale  == "sv_SE")||(page_locale  == "et_EE")||(page_locale  == "en_IN")||(page_locale == "pt_PT")||(page_locale == "de_DE")||(page_locale == "tr_TR")||(page_locale == "nl_BE")||(page_locale == "en_ZA")||(page_locale == "en_AE")||(page_locale == "is_IS")||(page_locale == "en_IE")||(page_locale =="iw_IL")||(page_locale == "it_IT")||(page_locale=="fr_FR")){
                             usrlocale = page_locale;
 html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
 html += getDisplayIconHtml('help_off.gif',catObj.scheme);}



 else if((page_locale == "en_PK")||(page_locale == "en_LB")||(page_locale == "en_SA")){
                          usrlocale = "en_AE";
                html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}



                                else
 {
                                html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";

                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);
                        }
                        }
                }
else
                {
                        if(catObj.isContextOrHelp == 'true')
                {
                        if(UserLocale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "da_DK")||(UserLocale == "hu_HU")||(UserLocale == "de_AT")||(UserLocale == "fi_FI")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")||(UserLocale == "en_AE")||(UserLocale == "is_IS")||(UserLocale == "en_IE")||(UserLocale == "iw_IL")||(UserLocale == "it_IT")||(UserLocale == "fr_FR")){                                
usrlocale = UserLocale;

 html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "en_PK")||(UserLocale == "en_LB")||(UserLocale == "en_SA")){
                                usrlocale = "en_AE";
 html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}



else
                        {
                                html += "<a href='Javascript:goToHelpCenter(\""+catObj.helpURL+"\");'>";
                            html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);
                        }
                }
 else
                        {
                        if(UserLocale == "en_GB"){
                                usrlocale = "en_GB";
                                html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>"
;
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "da_DK")||(UserLocale == "hu_HU")||(UserLocale == "de_AT")||(UserLocale == "fi_FI")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")||(UserLocale == "en_AE")||(UserLocale == "is_IS")||(UserLocale == "en_IE")||(UserLocale == "iw_IL")||(UserLocale == "it_IT")||(UserLocale == "fr_FR")){
                                   usrlocale=UserLocale;

 html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplayIconHtml('help_off.gif',catObj.scheme);}

else if((UserLocale == "en_PK")||(UserLocale == "en_LB")||(UserLocale == "en_SA")){
                                usrlocale = "en_AE";
 html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
html += getDisplayIconHtml('help_off.gif',catObj.scheme);}


 else
                                {
                        html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                    html += getDisplayIconHtml('help_off.gif',catObj.scheme);}
                        }
                }
		html += '</a></span>';
	}
	var listElements = catObj.list.split("."); // list type is expected to be module.list-name. Eg: SwapModule.MoreNews
	var module = listElements[0];
	var listName = listElements[1];
	var selectedValue = "this.value";
	// this code for selectedID
	var selectedID = dropDownValue;
	var count_medical=0;
	var count_more=0;
	if(listName!="Speciality")
	{
	html += '<span id="tools_'+subsID+'" class="portlet_tools">';
	//code added for move content
	if((page_config_move == 'true') && (hidedPortlet==false) && ((scheme=='medical') || (scheme=='more'))){
			if(scheme=='medical'){
				contentarea_medical[subsID] = subsID;
				for (var i in contentarea_medical){	
					count_medical++;
				}
				contentarea_pos[subsID]=count_medical;
			}
			else if(scheme=='more'){
				contentarea_more[subsID] = subsID;
				for (var i in contentarea_more)	{	
					count_more++;
				}
				contentarea_pos[subsID]=count_more+1000;
			}
			html += "<a href='javascript:void(0);' id='image_"+subsID+"' onclick=\"return !displayMenu('"+subsID+"',event,"+catObjName+");\">";
			html += getDisplayIconHtml('move_off.gif',catObj.scheme);
			html += '</a>';
			html +="<div class='move_content' id='menu"+subsID+"'></div>"; //html code to display the menu goes here 
	}else{
		if (catObj.icon_close == "remove") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('remove_off.gif',catObj.scheme);
			html += '</a>';
		}
		if (catObj.icon_min == "max") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_maximize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('max_off.gif',catObj.scheme);
			html += '</a>';
		} else if (catObj.icon_min == "min") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_minimize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('min_off.gif',catObj.scheme);
			html += '</a>';	
		}
	}
	html += "</span>";
	}
	else{
	html += '<span id="tools_'+subsID+'" >';	
	html += "</span>";
	}
	
	if(listName=="Speciality")
	{

	html += "<span style='padding-right:13px' class='portlet_header_dropdown' id='dropdown_" + subsID + "'>";
	if (catObj.list != '' && catObj.list != 'null') {
		html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\">";
		
		//alert("Module="+module);
		//alert("SelectedValue="+selectedValue);
		//alert("SubsID="+subsID);
		//alert("CatobjName="+catObjName);

		i = groupIndex[listName];
		//alert(listName);
		//alert(categoryList);
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			//alert(item);
			//alert(itemval);
			
		if(Speciality =="28"||Speciality =="29")
		{
			if(itemval == "15622c_11c7045b72f_-7ff7ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
					} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
			
		}

		else if (Speciality =="49"||Speciality =="50")
		{
						if(itemval == "15622c_11c7045b72f_-7ff9ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		else if (Speciality =="38"||Speciality =="39"||Speciality =="40"||Speciality =="60")
		{
						if(itemval == "51fe32_119c31d7beb_-7fffac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		else if (Speciality =="41"||Speciality =="62"||Speciality =="63")
		{
						if(itemval == "5c05bd_119c7da7c87_-7fffac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		else{
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		//	alert("I am in else");
		}

		
		}
		html += '</select>';
	}
	}
	
	//INC000000101039
	

	else if(listName=="SpecialityPT"){
//alert(listName);
		html += "<span style='padding-right:13px' class='portlet_header_dropdown' id='dropdown_" + subsID + "'>";
	if (catObj.list != '' && catObj.list != 'null') {
		html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\">";
		
		//alert("Module="+module);
		//alert("SelectedValue="+selectedValue);
		//alert("SubsID="+subsID);
		//alert("CatobjName="+catObjName);

		i = groupIndex[listName];
		//alert(listName);
		//alert(categoryList);
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			//alert(item);
			//alert(itemval);
			
		if(Speciality =="270" || Speciality =="230" || Speciality =="250" || Speciality =="300" || Speciality =="310" || Speciality =="400" || Speciality =="490" || Speciality =="20" || Speciality =="30" || Speciality =="80" || Speciality =="90" || Speciality =="100" || Speciality =="110" || Speciality =="530" || Speciality =="150" || Speciality =="170" || Speciality =="180" || Speciality =="510" || Speciality =="320" || Speciality =="370" || Speciality =="420" || Speciality =="450" || Speciality =="460" || Speciality =="470" || Speciality =="500" || Speciality =="510")
		{
			if(itemval == "129880d_126ac2890fd_-7fdfac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
					} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
			
		}

		else if (Speciality =="410" || Speciality =="420")
		{
						if(itemval == "129880d_126ac2890fd_-7fcbac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		else if (Speciality =="430" || Speciality =="210" || Speciality =="220" || Speciality =="130")
		{
						if(itemval == "17fe3f_12d080bd983_-7fddac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		else if (Speciality =="140")
		{
						if(itemval == "17fe3f_12d080bd983_-7ffaac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		
		else if (Speciality =="46")
		{
						if(itemval == "1821fff_133cb9dfed6_-7ffaac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		
		else if (Speciality =="390")
		{
						if(itemval == "129880d_126ac2890fd_-7fc5ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		
		//Related to the Speciality Cardiometabolica
		else if (Speciality =="360")
		{
						if(itemval == "129880d_126ac2890fd_-7fd4ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="340" || Speciality =="330" || Speciality =="350")
		{
						if(itemval == "129880d_126ac2890fd_-7fd6ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="50" || Speciality =="60" || Speciality =="70" || Speciality =="40")
		{
				if(itemval == "129880d_126ac2890fd_-7fd1ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="120")
		{
						if(itemval == "39a01d_126ada1bb78_-7fffac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="540" || Speciality =="160")
		{
						if(itemval == "17fe3f_12d080bd983_-7ff3ac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="280")
		{
						if(itemval == "17fe3f_12d080bd983_-7fe8ac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="190")
		{
						if(itemval == "17fe3f_12d080bd983_-7fecac190a4b") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		else if (Speciality =="520" || Speciality =="260" || Speciality =="240" || Speciality =="380" || Speciality =="480")
		{
						if(itemval == "129880d_126ac2890fd_-7fd8ac190a48") {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}

		

		else{
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		//	alert("I am in else");
		}

		
		}
		html += '</select>';
	}
	}

	//INC000000101039
	
	
	
	else
	{
    //alert(UserLocale);
   	if((UserLocale == "nl_BE"||UserLocale == "fr_BE") && (listName=="SportsNews"||listName=="FinancialNews"))
	{
	var title = catObj.title;
	//alert(UserLocale);
	//alert(listName);
	//html+='<span id="title_' + subsID + '" class="portlet_header_title">' + title + '</span>';
	html+='<span id="title_' + subsID + '" class="portlet_header_title" style="padding-left:0px;">' + title + '</span>';
	//html += '<span id="tools_'+subsID+'" class="portlet_tools">';
	if (catObj.list != '' && catObj.list != 'null') {
			i = groupIndex[listName];
		//alert(listName);
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		html += '</select>';
	}

	
	}	
	
	else{
	html += "<span class='portlet_header_dropdown' id='dropdown_" + subsID + "'>";
	if (catObj.list != '' && catObj.list != 'null') {
		html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\" >";

		i = groupIndex[listName];
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		html += '</select>';
	}
	}
   }
	html += '</span>';
	document.write(html+'</div></div>');
}

function container_header_se(subsID,dropDownValue,catObj,scheme, namedanchor,removeShadow) {
	if(page_locale == 'sv_SE' && removeShadow == 'true'){
		document.write('<div id="header_' + subsID + '" class="portlet_header" style="display:none"><div class="portlet_header_left_noshadow">');
	}else{
		document.write('<div id="header_' + subsID + '" class="portlet_header"><div '+namedanchor+' class="portlet_header_left_shadow">');
	}
	var hidedPortlet=false;
	if (scheme=='medical' || scheme=='more'){					
		if (document.getElementById("placeholder_"+subsID).className.indexOf("hide") != -1) hidedPortlet=true;
	}
	if(!hidedPortlet){
		contentarea[subsID] = subsID;// init here we are assigning the subid to this content area array
		content_placeholder[subsID] = subsID;
	}
	else if (PageName == 'Home'){
		if (scheme=='medical'){total_count_medical--;}
		else {total_count_more--; }
	}

	var title = catObj.title;
	var catObjName = "cat_"+subsID;
	var icon_min=catObj.icon_min;
	var icon_close=catObj.icon_close;

	if (scheme == scheme_more && catObj.list != '') {
		title = '';
	}
	html ='<span id="title_' + subsID + '" class="portlet_header_title">' + title + '</span>';
	if (catObj.helpURL != '') {
		html += "<span class='portlet_header_help' id='help_"+subsID+"'>";
		if(getCookie("TIBCOSessionID") == null){
			page_locale=page_locale.substring(1,6);
			html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\",\""+page_locale+"\");'>";			
		}else{
			html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\");'>";
		}		
		html += getDisplayIconHtml('help_off.gif',catObj.scheme);
		html += '</a></span>';
	}
	var listElements = catObj.list.split("."); // list type is expected to be module.list-name. Eg: SwapModule.MoreNews
	var module = listElements[0];
	var listName = listElements[1];
	var selectedValue = "this.value";
	
	// this code for selectedID
	var selectedID = dropDownValue;
	var count_medical=0;
	var count_more=0;
	html += '<span id="tools_'+subsID+'" class="portlet_tools">';
	//code added for move content
	if((page_config_move == 'true') && (hidedPortlet==false) && ((scheme=='medical') || (scheme=='more'))){
			if(scheme=='medical'){
				contentarea_medical[subsID] = subsID;
				for (var i in contentarea_medical){	
					count_medical++;
				}
				contentarea_pos[subsID]=count_medical;
			}
			else if(scheme=='more'){
				contentarea_more[subsID] = subsID;
				for (var i in contentarea_more)	{	
					count_more++;
				}
				contentarea_pos[subsID]=count_more+1000;
			}
			html += "<a href='javascript:void(0);' id='image_"+subsID+"' onclick=\"return !displayMenu('"+subsID+"',event,"+catObjName+");\">";
			html += getDisplayIconHtml('move_off.gif',catObj.scheme);
			html += '</a>';
			html +="<div class='move_content' id='menu"+subsID+"'></div>"; //html code to display the menu goes here 
	}else{
		if (catObj.icon_close == "remove") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('remove_off.gif',catObj.scheme);
			html += '</a>';
		}
		if (catObj.icon_min == "max") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_maximize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('max_off.gif',catObj.scheme);
			html += '</a>';
		} else if (catObj.icon_min == "min") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_minimize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('min_off.gif',catObj.scheme);
			html += '</a>';	
		}
	}
	html += "</span>";
	html += "<span class='portlet_header_dropdown' id='dropdown_" + subsID + "'>";
	if (catObj.list != '' && catObj.list != 'null') {
		html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\" >";

		i = groupIndex[listName];
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		html += '</select>';
	}
	html += '</span>';
	document.write(html+'</div></div>');
}

function update_container_header(subsID,dropDownValue,catObj,scheme) {
	var catObjName = "cat_"+subsID;
	var title = catObj.title;
	if (scheme == scheme_more && catObj.list != '') {
		title = '';
	}
	// update the title first
	document.getElementById('title_' + subsID).innerHTML = unescape(title);
	var html = "";
	if(page_config_move == 'true'){
			html += "<a href='javascript:void(0);' onclick=\"return !displayMenu('"+subsID+"',event,"+catObjName+");\">";
			html += getDisplayIconHtml('move_off.gif',catObj.scheme);
			html += '</a>';
			html +="<div class='move_content' id='menu"+subsID+"'></div>"; //html code to display the menu goes here 
	}
	else{
		// update the help icon
		if (catObj.helpURL != '') {
			html = "<a href='"+catObj.helpURL+"'>";
			html += getDisplayIconHtml('help_off.gif',scheme);
			html += '</a>';
			document.getElementById("help_"+subsID).innerHTML = html;
		}
		html = "";
		var catObjName = "cat_"+subsID;
		if (catObj.icon_close == "remove") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','','"+subsID+"',"+catObjName+",''); \" >";
			html += getDisplayIconHtml('remove_off.gif',scheme);
			html += '</a>';
		}
		if (catObj.icon_min == "max") {
			//'maximize','','ssd23',catObj,''
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_maximize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",''); \" >";
			html += getDisplayIconHtml('max_off.gif',scheme);
			html += '</a>';
		}else if (catObj.icon_min == "min") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_minimize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",''); \" >";
			html += getDisplayIconHtml('min_off.gif',scheme);
			html += '</a>';
		}
		document.getElementById("tools_"+subsID).innerHTML = html;
	}
	html = "";
	if (catObj.list != '' && catObj.list != 'null') {
		////alert("comes inside changing html");
		var listElements = catObj.list.split("."); // list type is expected to be module.list-name. Eg: SwapModule.MoreNews
		var module = listElements[0];
		var listName = listElements[1];
		if(listElements.length==3)
		var listNameAOI= listElements[2];
		var selectedValue = "this.value";
	
		// this code for selectedID
		var selectedID = dropDownValue;
	//	html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'')\" >";

		i = groupIndex[listName];
		if(listName=="TCGAOI")
		{
			i_AOI= groupIndex[listNameAOI];
			var Array_TCG=new Array();
			var j=0;
			var count_sch=0;
			while ( i_AOI < categoryList.length && categoryList[i_AOI].name != "##DUMMY-CATEGORY##" ) 
			{
				if(categoryList[i_AOI].catId==PrimaryAOI || categoryList[i_AOI].catId==AOI2 || categoryList[i_AOI].catId==AOI3 || categoryList[i_AOI].catId==AOI4 || categoryList[i_AOI].catId==AOI5){
					Array_TCG[j]=categoryList[i_AOI].name;
					j++;	
				}
				i_AOI++;
			}
			
			while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) 
			{
				for(var k=0;k<Array_TCG.length;k++)
				{
					if(categoryList[i].name==Array_TCG[k])
					if(categoryList[i].catId!='' && categoryList[i].catId!=null)
					count_sch++;
				}
				i++;
			}
			i = groupIndex[listName];
			if(count_sch>1)
			{
				html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'')\" >";
				while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) 
				{
					for(var k=0;k<Array_TCG.length;k++)
					{
						if(categoryList[i].name==Array_TCG[k])
						var flag="continue";
						if(flag=="continue")
						{
							var item = categoryList[i].name;
							var itemval = categoryList[i].catId;
							if(itemval == selectedID) 
							{
								html += '<option value="' + itemval + '" selected>' + item + '</option>';
							} else{
								html += '<option value="' + itemval + '">' + item + '</option>';
							}
									
						}
						flag="false";
					}
					i++;
				}
				html += '</select>';
			}
			else
			{
				html +='<span class="portlet_header_title" id="title_5ksk40o">'+SCH_Home_Name+'</span>';
			}
		}
		else
		{
			html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'')\" >";
			while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
			}
			html += '</select>';
		}
	/*	while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			var item = categoryList[i].name;
			var itemval = categoryList[i].catId;
			
			if(itemval == selectedID) {
					html += '<option value="' + itemval + '" selected>' + item + '</option>';
			} else{
					html += '<option value="' + itemval + '">' + item + '</option>';
			}
			i++;
		}
		html += '</select>';*/
	}

	document.getElementById("dropdown_" + subsID).innerHTML = html;
	
}
// ********************************
// application-specific functions *
// ********************************
var clip_content = new Array();
function displayMenu(subsID,eventObj,catObjArg) {

	eventObj.cancelBubble = true;//do not remove this line
	var catObjName = "cat_"+subsID;
	var portlet_pos = contentarea_pos[subsID];
	var portlet_max_pos = total_count_medical;
	var minstate = catObjArg.icon_min;
	var closestate = catObjArg.icon_close;
	
	if (portlet_pos>1000)	{
		portlet_pos = portlet_pos-1000;
		portlet_max_pos = total_count_more;
	}
	var menu_Content="<iframe id ='menuiframe_" + subsID + "' frameborder='0' style='position:absolute;width:102px;top:0px;left:0px;'></iframe><div id='menu_" + subsID + "' style='position:relative;left:0px;'><ul class='level1' ><li class='border";
	if (minstate == "min"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);'onclick=\"displayBlock('" + mod_minimize +"','','"+subsID+"',"+catObjName+",'');\">"+move["minimize"]+"</a></li><li class='border";
	}
	else if (minstate == "max"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);'onclick=\"displayBlock('" + mod_maximize +"','','"+subsID+"',"+catObjName+",'');\">"+move["maximize"]+"</a></li><li class='border";
	}
	else{
		menu_Content=menu_Content+" disable'>"+move["minimize"]+"</li><li class='border";
		
	}
	if(portlet_pos==1){
		////alert("subsID....."+subsID);
		menu_Content=menu_Content+" disable'>"+move["up"]+"</li><li class='border";
	}
	else{
		////alert("subsID....."+subsID);
		menu_Content=menu_Content+"'><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_moveup + "',"+contentarea_pos[subsID]+",'"+subsID+"',"+catObjName+",'');\">"+move["up"]+"</a></li><li class='border";
	}
	if(portlet_pos==portlet_max_pos){
		menu_Content=menu_Content+" disable'>"+move["down"]+"</li><li class='border";
		
	}
	else{
		menu_Content=menu_Content+"'><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movedown + "',"+contentarea_pos[subsID]+",'"+subsID+"',"+catObjName+",'');\">"+move["down"]+"</a></li><li class='border";
	}
	if(portlet_pos==1){	
		menu_Content=menu_Content+" disable'>"+move["top"]+"</li><li class='border";
	}
	else{
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movetop + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["top"]+"</a></li><li class='border";
	}
	if(portlet_pos==portlet_max_pos){
		menu_Content=menu_Content+" disable'>"+move["bottom"]+"</a></li><li class='border";
	}
	else{
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movebottom + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["bottom"]+"</a></li><li class='border";
	}
	if (closestate=="remove"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["delete"]+"</a></li><li class='border' ><a href='javascript:void(0);' onclick='"+move["help_link"]+"'>"+move["help"]+"</a></li></ul>";
	}
	else{
		menu_Content=menu_Content+" disable'>"+move["delete"]+"</li><li class='border'><a href='javascript:void(0);' onclick='"+move["help_link"]+"'>"+move["help"]+"</a></li></ul></div>";
	}
	var menuId = 'menu' + subsID;
	document.getElementById(menuId).innerHTML = menu_Content;
	hideAllMenus();
	browsetype = navigator.appName;

	var status=changeObjectVisibility(menuId, 'block');
	if(browsetype == "Microsoft Internet Explorer"){
		var menuheight=document.getElementById("menu"+subsID).offsetHeight+24+2;
		var currentdivheight= document.getElementById("portlet_"+subsID).offsetHeight+15;
		document.getElementById("menu_" + subsID).style.padding="2px 0px 0px 0px";
		document.getElementById("menu_" + subsID).style.margin="-2px 0px 0px 0px";
		document.getElementById("menuiframe_" + subsID).style.height=(menuheight - 26)+ "px";
		if (currentdivheight < menuheight){
			var totaldivheight = currentdivheight;			
			var sequencePortlets =new Array();
			var schemeType=(catObjArg.scheme=="medical") ? "MedicalCats" : "MoreCats";
			for (j in contentarea_pos)
			{
				if(contentarea_pos[subsID] < 1000 && contentarea_pos[j] < 1000)
					sequencePortlets[contentarea_pos[j]]=j;
				else if(contentarea_pos[subsID] > 1000 && contentarea_pos[j] > 1000)
					sequencePortlets[contentarea_pos[j]]=j;		
			}		
			for (i=contentarea_pos[subsID]+1; i<sequencePortlets.length;i++){
				if (totaldivheight<menuheight){ 
					if ((document.getElementById("select_"+sequencePortlets[i])) != null) {
						document.getElementById("select_"+sequencePortlets[i]).className = "cliping";				
						clip_content[sequencePortlets[i]] = sequencePortlets[i];
					}
					totaldivheight = totaldivheight + document.getElementById("portlet_"+sequencePortlets[i]).offsetHeight+15;					
				}
			}
			if (totaldivheight < menuheight){
				document.getElementById(schemeType).className = "cliping";				
			}	
		}			
	}	
	return status;  
}
function hideAllMenus(){
	try
	{
		browsetype = navigator.appName;
		if(browsetype == "Microsoft Internet Explorer"){
			for (var j in clip_content )	{	
				document.getElementById("select_"+j).className = "noCliping";
			}	
			document.getElementById("MedicalCats").className = "noCliping";
			document.getElementById("MoreCats").className = "noCliping";
		}
		for (var i in content_placeholder )	{	
			changeObjectVisibility('menu'+ i, 'none');
		}
	}
	catch(e)
	{
	}
 }
document.onclick = hideAllMenus;//Clicking outside the menu gets hide all the menus

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newdisplay) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.display = newdisplay;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility
//===================================================
// TCG portlet
function container_header_TCG(subsID,dropDownValue,catObj,scheme, namedanchor) {
	document.write('<div id="header_' + subsID + '" class="portlet_header"><div '+namedanchor+' class="portlet_header_left_shadow">');
	var hidedPortlet=false;
	if (scheme=='medical' || scheme=='more'){					
		if (document.getElementById("placeholder_"+subsID).className.indexOf("hide") != -1) hidedPortlet=true;
	}
	if(!hidedPortlet){
		contentarea[subsID] = subsID;// init here we are assigning the subid to this content area array
		content_placeholder[subsID] = subsID;
	}
	else if (PageName == 'Home'){
		if (scheme=='medical'){total_count_medical--;}
		else {total_count_more--; }
	}

	var title = catObj.title;
	var catObjName = "cat_"+subsID;
	var usrlocale = "";
	var icon_min=catObj.icon_min;
	var icon_close=catObj.icon_close;
	if (scheme == scheme_more && catObj.list != '') {
		title = '';
	}
	html ='<span id="title_' + subsID + '" class="portlet_header_title">' + title + '</span>';
	if (catObj.helpURL != '') {

 html += "<span class='portlet_header_help' id='help_"+subsID+"'>";
                if(getCookie("TIBCOSessionID") == null){
                        page_locale=page_locale.substring(1,6);
                        if(catObj.isContextOrHelp == 'true'){
                        if((UserLocale == "en_GB")||(UserLocale == "de_AT")||(UserLocale == "da_DK")||(UserLocale == "fi_FI")||(UserLocale == "hu_HU")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")){

                                usrlocale = UserLocale;
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}

                        else if((page_locale == "en_GB")||(page_locale == "de_AT")||(page_locale == "da_DK")||(page_locale == "fi_FI")||(page_locale == "hu_HU")||(page_locale == "es_ES")||(page_locale == "no_NO")||(page_locale== "fr_CH")||(page_locale== "de_CH")||(page_locale== "nl_NL")||(page_locale == "en_CA")||(page_locale == "fr_BE")||(page_locale == "fr_CA")||(page_locale == "sv_SE")||(page_locale == "et_EE")||(page_locale == "en_IN")||(page_locale == "pt_PT")||(page_locale == "de_DE")||(page_locale == "tr_TR")||(page_locale == "nl_BE")||(page_locale == "en_ZA")){

                                usrlocale = page_locale;
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";

                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}
                        else
 {
                                html += "<a href='Javascript:goToHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";

                            html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);
                }
                }
                else {
                            if((UserLocale == "en_GB")||(UserLocale == "de_AT")||(UserLocale == "da_DK")||(UserLocale == "fi_FI")||(UserLocale == "hu_HU")||(UserLocale == "es_ES")|| (UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")){
                                usrlocale = UserLocale;
                              html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}

            else if((page_locale == "en_GB")||(page_locale == "de_AT")||(page_locale == "da_DK")||(page_locale =="fi_FI")||(page_locale == "hu_HU")||(page_locale == "es_ES")||(page_locale == "no_NO")||(page_locale== "fr_CH")||(page_locale== "de_CH")||(page_locale== "nl_NL")||(page_locale == "en_CA")||(page_locale == "fr_BE")||(page_locale == "fr_CA")||(page_locale == "sv_SE")||(page_locale == "et_EE")||(page_locale == "en_IN")||(page_locale == "pt_PT")||(page_locale == "de_DE")||(page_locale == "tr_TR")||(page_locale == "nl_BE")||(page_locale == "en_ZA")){
                                usrlocale = page_locale;
                               html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>"
;
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}
                                else
                        {
            html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
            html += getDisplayIconHtml('help_off.gif',catObj.scheme);
                        }
                        }
                }
                else
                {
                        if(catObj.isContextOrHelp == 'true')
                {
                        if((UserLocale == "en_GB")||(UserLocale == "de_AT")||(UserLocale == "da_DK")||(UserLocale == "fi_FI")||(UserLocale == "hu_HU")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")){
                                usrlocale = UserLocale;
                                html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);}
                        else
                        {
                                html += "<a href='Javascript:goToHelpCenter(\""+catObj.helpURL+"\");'>";
                                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);
                        }
                }
                else
                        {
            if((UserLocale == "en_GB")||(UserLocale == "de_AT")||(UserLocale == "da_DK")||(UserLocale == "fi_FI")||(UserLocale == "hu_HU")||(UserLocale == "es_ES")||(UserLocale == "no_NO")||(UserLocale == "fr_CH")||(UserLocale == "de_CH")||(UserLocale == "nl_NL")||(UserLocale == "en_CA")||(UserLocale == "fr_BE")||(UserLocale == "fr_CA")||(UserLocale == "sv_SE")||(UserLocale == "et_EE")||(UserLocale == "en_IN")||(UserLocale == "pt_PT")||(UserLocale == "de_DE")||(UserLocale == "tr_TR")||(UserLocale == "nl_BE")||(UserLocale == "en_ZA")){
                                usrlocale = UserLocale;
                                html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>"
;
                                html += getDisplayIconHtml('help_off.gif',catObj.scheme);}
                                else
                                {
                        html += "<a href='Javascript:goToContextHelp(\""+catObj.helpURL+"\",\""+usrlocale+"\");'>";
                    html += getDisplayIconHtml('help_off.gif',catObj.scheme);}
                        }
                }
 html += '</a></span>';
        }

	/**if(catObj.isContextOrHelp == 'true'){

		html += "<span class='portlet_header_help' id='help_"+subsID+"'>";
		if(getCookie("TIBCOSessionID") == null){
			page_locale=page_locale.substring(1,6);
if((page_locale=="hu_HU")||(page_locale=="de_AT")||(page_locale=="da_DK")){
            html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\",\""+page_locale+"\");'>";

}
    }else{
                        html += "<a href='Javascript:goToCMSHelpCenter(\""+catObj.helpURL+"\");'>";
                }
                html += getDisplaySearchIconHtml('help_off.gif',catObj.scheme);
                html += '</a></span>';
        } 


 else
 
 {

 html += "<span class='portlet_header_help' id='help_"+subsID+"'>";
 if(getCookie("TIBCOSessionID") == null)
  
 {

  page_locale=page_locale.substring(1,6);
  html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\",\""+page_locale+"\");'>";
 }
 else
 {
      html += "<a href='Javascript:goToCMSContextHelp(\""+catObj.helpURL+"\");'>";
 }

      html += getDisplayIconHtml('help_off.gif',catObj.scheme);
      html += '</a></span>';
}
}**/
	var listElements = catObj.list.split("."); // list type is expected to be module.list-name. Eg: SwapModule.MoreNews
	var module = listElements[0];
	var listName = listElements[1];
	var listNameAOI= listElements[2];
	var selectedValue = "this.value";
	
	// this code for selectedID
	var selectedID = dropDownValue;
	var count_medical=0;
	var count_more=0;
	var count_sch=0;
	html += '<span id="tools_'+subsID+'" class="portlet_tools">';
	//code added for move content
	if((page_config_move == 'true') && (hidedPortlet==false) && ((scheme=='medical') || (scheme=='more'))){
			if(scheme=='medical'){
				contentarea_medical[subsID] = subsID;
				for (var i in contentarea_medical){	
					count_medical++;
				}
				contentarea_pos[subsID]=count_medical;
			}
			else if(scheme=='more'){
				contentarea_more[subsID] = subsID;
				for (var i in contentarea_more)	{	
					count_more++;
				}
				contentarea_pos[subsID]=count_more+1000;
			}
			html += "<a href='javascript:void(0);' id='image_"+subsID+"' onclick=\"return !displayMenuTCG('"+subsID+"',event,"+catObjName+");\">";
			html += getDisplayIconHtml('move_off.gif',catObj.scheme);
			html += '</a>';
			html +="<div class='move_content' id='menu"+subsID+"'></div>"; //html code to display the menu goes here 
	}else{
		if (catObj.icon_close == "remove") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('remove_off.gif',catObj.scheme);
			html += '</a>';
		}
		if (catObj.icon_min == "max") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_maximize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('max_off.gif',catObj.scheme);
			html += '</a>';
		} else if (catObj.icon_min == "min") {
			html += "<a href='javascript:void(0);' onclick=\"displayBlock('" + mod_minimize + "','"+dropDownValue+"','"+subsID+"',"+catObjName+",'');\">";
			html += getDisplayIconHtml('min_off.gif',catObj.scheme);
			html += '</a>';	
		}
	}
	html += "</span>";
	html += "<span class='portlet_header_dropdown' id='dropdown_" + subsID + "'>";
	if (catObj.list != '' && catObj.list != 'null') {
	//	html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\" >";

		i = groupIndex[listName];
		i_AOI= groupIndex[listNameAOI];
		var Array_TCG=new Array();
		var j=0;
		while ( i_AOI < categoryList.length && categoryList[i_AOI].name != "##DUMMY-CATEGORY##" ) {
			if(categoryList[i_AOI].catId==PrimaryAOI || categoryList[i_AOI].catId==AOI2 || categoryList[i_AOI].catId==AOI3 || categoryList[i_AOI].catId==AOI4 || categoryList[i_AOI].catId==AOI5){
			Array_TCG[j]=categoryList[i_AOI].name;
			j++;}
			i_AOI++;
		   }
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
                        for(var k=0;k<Array_TCG.length;k++)
                        {
                                if(categoryList[i].name==Array_TCG[k])
				if(categoryList[i].catId!='' && categoryList[i].catId!=null)
					count_sch++;
			}
			i++;
			}
		i = groupIndex[listName];
		if(count_sch>1)
		{
		html += "<select id='select_"+subsID+"' onchange=\"displayBlock('"+module+"',"+selectedValue+",'"+subsID+"',"+catObjName+",'');\" >";
		while ( i < categoryList.length && categoryList[i].name != "##DUMMY-CATEGORY##" ) {
			for(var k=0;k<Array_TCG.length;k++)
			{
				if(categoryList[i].name==Array_TCG[k])
				var flag="continue";
				if(flag=="continue")
				{
					var item = categoryList[i].name;
					var itemval = categoryList[i].catId;
				//	if(itemval!='' && itemval!= null)
			//		{
					if(itemval == selectedID) {
						html += '<option value="' + itemval + '" selected>' + item + '</option>';
					} else{
						html += '<option value="' + itemval + '">' + item + '</option>';
					}
			//		}
					
				}
				flag="false";
			}
			i++;
		}
		html += '</select>';
		}
		else
		{
			html +='<span class="portlet_header_title" id="title_5ksk40o">'+SCH_Home_Name+'</span>';
		}
	}
	html += '</span>';
	document.write(html+'</div></div>');
}
//==================================================
//================================================
//TCG
function displayMenuTCG(subsID,eventObj,catObjArg) {

	eventObj.cancelBubble = true;//do not remove this line
	var catObjName = "cat_"+subsID;
	var portlet_pos = contentarea_pos[subsID];
	var portlet_max_pos = total_count_medical;
	var minstate = catObjArg.icon_min;
	var closestate = catObjArg.icon_close;
	
	if (portlet_pos>1000)	{
		portlet_pos = portlet_pos-1000;
		portlet_max_pos = total_count_more;
	}
	var menu_Content="<iframe id ='menuiframe_" + subsID + "' frameborder='0' style='position:absolute;width:102px;top:0px;left:0px;'></iframe><div id='menu_" + subsID + "' style='position:relative;left:0px;'><ul class='level1' ><li class='border";
	if (minstate == "min"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);'onclick=\"displayBlock('" + mod_minimize +"','"+sch_min+"','"+subsID+"',"+catObjName+",'');\">"+move["minimize"]+"</a></li><li class='border";
	}
	else if (minstate == "max"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);'onclick=\"displayBlock('" + mod_maximize +"','"+sch_max+"','"+subsID+"',"+catObjName+",'');\">"+move["maximize"]+"</a></li><li class='border";
	}
	else{
		menu_Content=menu_Content+" disable'>"+move["minimize"]+"</li><li class='border";
		
	}
	if(portlet_pos==1){
		////alert("subsID....."+subsID);
		menu_Content=menu_Content+" disable'>"+move["up"]+"</li><li class='border";
	}
	else{
		////alert("subsID....."+subsID);
		menu_Content=menu_Content+"'><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_moveup + "',"+contentarea_pos[subsID]+",'"+subsID+"',"+catObjName+",'');\">"+move["up"]+"</a></li><li class='border";
	}
	if(portlet_pos==portlet_max_pos){
		menu_Content=menu_Content+" disable'>"+move["down"]+"</li><li class='border";
		
	}
	else{
		menu_Content=menu_Content+"'><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movedown + "',"+contentarea_pos[subsID]+",'"+subsID+"',"+catObjName+",'');\">"+move["down"]+"</a></li><li class='border";
	}
	if(portlet_pos==1){	
		menu_Content=menu_Content+" disable'>"+move["top"]+"</li><li class='border";
	}
	else{
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movetop + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["top"]+"</a></li><li class='border";
	}
	if(portlet_pos==portlet_max_pos){
		menu_Content=menu_Content+" disable'>"+move["bottom"]+"</a></li><li class='border";
	}
	else{
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_movebottom + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["bottom"]+"</a></li><li class='border";
	}
	if (closestate=="remove"){
		menu_Content=menu_Content+"' ><a href='javascript:void(0);' onclick=\"displayBlock('" + mod_close + "','"+contentarea_pos[subsID]+"','"+subsID+"',"+catObjName+",'');\">"+move["delete"]+"</a></li><li class='border' ><a href='javascript:void(0);' onclick='"+move["help_link"]+"'>"+move["help"]+"</a></li></ul>";
	}
	else{
		menu_Content=menu_Content+" disable'>"+move["delete"]+"</li><li class='border'><a href='javascript:void(0);' onclick='"+move["help_link"]+"'>"+move["help"]+"</a></li></ul></div>";
	}
	var menuId = 'menu' + subsID;
	document.getElementById(menuId).innerHTML = menu_Content;
	hideAllMenus();
	browsetype = navigator.appName;

	var status=changeObjectVisibility(menuId, 'block');
	if(browsetype == "Microsoft Internet Explorer"){
		var menuheight=document.getElementById("menu"+subsID).offsetHeight+24+2;
		var currentdivheight= document.getElementById("portlet_"+subsID).offsetHeight+15;
		document.getElementById("menu_" + subsID).style.padding="2px 0px 0px 0px";
		document.getElementById("menu_" + subsID).style.margin="-2px 0px 0px 0px";
		document.getElementById("menuiframe_" + subsID).style.height=(menuheight - 26)+ "px";
		if (currentdivheight < menuheight){
			var totaldivheight = currentdivheight;			
			var sequencePortlets =new Array();
			var schemeType=(catObjArg.scheme=="medical") ? "MedicalCats" : "MoreCats";
			for (j in contentarea_pos)
			{
				if(contentarea_pos[subsID] < 1000 && contentarea_pos[j] < 1000)
					sequencePortlets[contentarea_pos[j]]=j;
				else if(contentarea_pos[subsID] > 1000 && contentarea_pos[j] > 1000)
					sequencePortlets[contentarea_pos[j]]=j;		
			}		
			for (i=contentarea_pos[subsID]+1; i<sequencePortlets.length;i++){
				if (totaldivheight<menuheight){ 
					if ((document.getElementById("select_"+sequencePortlets[i])) != null) {
						document.getElementById("select_"+sequencePortlets[i]).className = "cliping";				
						clip_content[sequencePortlets[i]] = sequencePortlets[i];
					}
					totaldivheight = totaldivheight + document.getElementById("portlet_"+sequencePortlets[i]).offsetHeight+15;					
				}
			}
			if (totaldivheight < menuheight){
				document.getElementById(schemeType).className = "cliping";				
			}	
		}			
	}	
	return status;  
}
//================================================

