/**
*			Function related to univadis News application  
*			
*/

/*Function used to display the top news portlet contents
*	author : Utkala
*	version : 1.0
*	date		:	9/23/2005
*/

function display_topnews(headline,leadlines,last_update,filename,headlinelink,article_item_id,headlinenum,provider,wire_name,minleadlines,gotoarticle,newsImagePath,aoi_id,localebasedImagePath,elsevier_mednews)
	{		
		var articleImagePath = newsImagePath+'/news/'+wire_name+'/'+filename;
		if (elsevier_mednews=="yes"){
			articleImagePath=newsImagePath+"/news/elsevier-mednews/"+filename;
	     }
		if(localebasedImagePath=="yes")
			articleImagePath = newsImagePath+"/"+UserLocale+"/"+wire_name+'/'+filename;
		if(provider.toUpperCase() == 'JIM' && UserLocale == 'fr_FR'){
			articleImagePath = newsImagePath+"/fr/"+provider+"/"+filename;
		}
		if(wire_name == "ANP-GEZOND") {
			articleImagePath = newsImagePath+'/nl_NL/'+wire_name+'/'+filename;
		}
		//this added to fix the image path for farma news
                if(wire_name == "farma") {
                        articleImagePath = newsImagePath+"/pt_PT/"+filename;
                }
		var len = leadlines.length;
		var imagemedical_id='image_medical'+article_item_id;
		var medical_inner='medical_inner'+article_item_id;	
		
		// If the browser version is ..
		var browserName = navigator.userAgent.toLowerCase(); 
        if((browserName.indexOf('firefox/3.0') != -1) || (browserName.indexOf('firefox/3.5') != -1))
	{ 
		if(filename.trim()!='null' && filename.trim()!="")
		{ 			
			document.write('<span id="medicalnews_'+article_item_id+'" ><a href="'+headlinelink+'"><img id="image_medical'+article_item_id+'"  src="'+articleImagePath+'" border="0" alt="" class="content_padding_ul continue img_font hide"   /></a></span>');

			if(document.getElementById('image_medical'+article_item_id+'').width >'108')
			{							
				if(len > parseInt(minleadlines)){
					var max_len=eval(parseInt(minleadlines)+leadlines.substring(parseInt(minleadlines)).indexOf(' '));
					leadlines = leadlines.substring(0,max_len)+'...';
				}
				document.write('<div id="medical_inner'+article_item_id+'" class="content_padding rfloat" style="padding-bottom:15px;">');
				if(provider!='')
					document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
				else
					document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
				document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
				document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
				if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
				if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
				document.write('</div></p>');
			}			
			else 
			{
				if(len > parseInt(minleadlines)){
					var max_len=eval(parseInt(minleadlines)+leadlines.substring(parseInt(minleadlines)).indexOf(' '));
					leadlines = leadlines.substring(0,max_len)+'...';
				}
				document.write('<div id="medical_inner'+article_item_id+'" class="content_padding rfloat" style="padding-bottom:15px">');
				if(provider!='')
					document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
				else
					document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
				document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
				document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
				if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
				if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
				document.write('</div></p>');				
			}
			document.getElementById('medicalnews_'+article_item_id).innerHTML = '<a href="'+headlinelink+'"><img id="image_medical'+article_item_id+'"  src="'+articleImagePath+'" border="0" alt="" class="continue img_font" onload="topnews_image(\''+imagemedical_id+'\',\''+medical_inner+'\');" /></a>';
		}		
		else
		{
			document.write('<div id="medical_inner'+article_item_id+'" class="content_padding rfloat" style="padding-bottom:15px;">');
			if(provider!='')
				document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
			else
				document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
			document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
			document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
			if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
			if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
			document.write('</div></p>');		
		}
	}	
		else
	{
		if(filename.trim()!='null' && filename.trim()!="")
		{ 			
			document.write('<span id="medicalnews_'+article_item_id+'" ><a href="'+headlinelink+'"><img id="image_medical'+article_item_id+'"  src="'+articleImagePath+'" border="0" alt="" class="content_padding_ul continue img_font hide"   /></a></span>');

			if(document.getElementById('image_medical'+article_item_id+'').width >'108')
			{							
				if(len > parseInt(minleadlines)){
					var max_len=eval(parseInt(minleadlines)+leadlines.substring(parseInt(minleadlines)).indexOf(' '));
					leadlines = leadlines.substring(0,max_len)+'...';
				}
				document.write('<div id="medical_inner'+article_item_id+'" class="content_padding" style="padding-bottom:15px;">');
				if(provider!='')
					document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
				else
					document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
				document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
				document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
				if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
				if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
				document.write('</div></p>');
			}			
			else 
			{
				if(len > parseInt(minleadlines)){
					var max_len=eval(parseInt(minleadlines)+leadlines.substring(parseInt(minleadlines)).indexOf(' '));
					leadlines = leadlines.substring(0,max_len)+'...';
				}
				document.write('<div id="medical_inner'+article_item_id+'" class="content_padding" style="padding-bottom:15px">');
				if(provider!='')
					document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
				else
					document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
				document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
				document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
				if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
				if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
				document.write('</div></p>');				
			}
			document.getElementById('medicalnews_'+article_item_id).innerHTML = '<a href="'+headlinelink+'"><img id="image_medical'+article_item_id+'"  src="'+articleImagePath+'" border="0" alt="" class="continue img_font" onload="topnews_image(\''+imagemedical_id+'\',\''+medical_inner+'\');" /></a>';
		}		
		else
		{
			document.write('<div id="medical_inner'+article_item_id+'" class="content_padding" style="padding-bottom:15px;">');
			if(provider!='')
				document.write('<p><div class="text_small pad_adj_6">'+last_update+' ('+provider+')</div>');
			else
				document.write('<p><div class="text_small pad_adj_6">'+last_update+'</div>');
			document.write('<div class="pad_adj_head_10"><a href="'+headlinelink+'" class="head">'+headline+'</a></div>');
			document.write('<span class="text">'+leadlines+'</span><span><a class="text marginleft_5" href="'+headlinelink+'" ><nobr> '+gotoarticle+'</nobr></a></span>');
			if(wire_name == "ANP-GEZOND")
					{ 
						document.write('<div class="text_padding_top"><a class="sub_head" href="/medical_and_more/NL_MedicalNews_Inter">Meer nieuws...</a></div>');
					}
			if(wire_name == "ebmradar")
					{ 
						document.write('<div class="text_padding_top pad_adj_textflat_15"><a class="sub_head" href="/medical_and_more/de_DE_Praxisradar_Intermediate">Alle anzeigen...</a></div>');
					}
			document.write('</div></p>');		
		}
	}
}

/*Function used by top news function for displaying the images fix for moz
*	author : Utkala
*	version : 1.0
*	date		:	9/23/2005
*/

function topnews_image(imagemedical_id,medical_inner)
{
	if(document.getElementById(imagemedical_id).width >'108')
	{
		document.getElementById(imagemedical_id).style.margin='0px 15px 0px 0px';
		document.getElementById(imagemedical_id).style.padding='0px 0px 0px 0px';
		
		var div = document.getElementById(medical_inner).offsetHeight;
		var ht = document.getElementById(imagemedical_id).offsetHeight;
		
		if(ht > div)
		{
			document.getElementById(medical_inner).style.height = ht-5+"px";
			document.getElementById(medical_inner).style.padding='7px 10px 13px 0px';
		}
	}
	else 
	{
		document.getElementById(imagemedical_id).style.margin='10px 14px 15px 10px';
		document.getElementById(imagemedical_id).style.padding='0px 0px 0px 0px';
		var div = document.getElementById(medical_inner).offsetHeight;
		var ht = document.getElementById(imagemedical_id).offsetHeight;
		if(ht > div)
		{
			document.getElementById(medical_inner).style.height = ht+5+"px" ;
			document.getElementById(medical_inner).style.padding='7px 10px 13px 0px';
		}
	}
}



/*Function used to display the Select news and Top Medical news portlet contents
*	author : Utkala
*	version : 1.0
*	date		:	9/23/2005
*/

function display_medicalHeadlines(headline,last_update,headlinelink,headlinenum,aoi_id,list_all,aoi_name,IsNews,item_comp_id)
{
		news_aoiid=aoi_id;
		news_aoiname=aoi_name;
		document.write('<ul>');			
		document.write('<li><div><a href="'+headlinelink+'">'+headline+'</a>');
		document.write('<span class="text_small date_pad_5">'+last_update+'</span>');
		if(IsNews=='yes')//to show camera image only if it is for the News Portlet
		{
			if(item_comp_id!='null' && item_comp_id!='')
			{			
				document.write('<span class="camera_image"><img class="text_small" src="/RI/icons/white/photo.gif"/></span>');			
			}
		}	
		document.write('</div></li></ul>');		
		
   }//end of display medical headlines 

/*Function used to display the Area of Interest headlines  portlet content
*	author : Utkala
*	version : 1.0
*	date		:	9/23/2005
*/


function display_AOIHeadlines(Headlinenum,headline,last_update,headlinelink,aoi_name,aoi_id,list_all,jumppagetitle,aoi_names,targetURL,IsNews,item_comp_id,multimedia_compid,locale,IsNewsBorder)
	{
		AOIId_current=aoi_id;
		AOIName_current=aoi_name;

		if(Headlinenum==1)
		{   
			if(IsNewsBorder=='true'){
				document.write('<div style="padding:0px 6px 4px 4px;"></div>');
				document.write('<div id="'+div_id+'"class="blu_bkgrnd text_padding_left" style="border:1px solid #E6EBF0;margin-top:-5px">');
				document.write('<div class="pad_top_1" style="padding-bottom:1px;"><div class="pad_top_1" style="padding-bottom:0.9px;"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[aoi_id]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+aoi_id+'%26profileAOIName='+aoi_name+'">'+aoi_name+'</a></div></div></div>');
				document.write('<div style="padding-bottom:2px;"></div>');
			}else{
				document.write('<div class="pad_adj_10 pad_lines_10"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[aoi_id]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+aoi_id+'%26profileAOIName='+aoi_name+'">'+aoi_name+'</a></div>');
			}
		}					
		if(Headlinenum!=1 )
		{
			if(AOIId_previous!=AOIId_current)
			{   
				if(IsNewsBorder=='true')
				{
					document.write('<div id="'+div_id+'"class="content_padding_aoi">');
					document.write('<div class="enews_headline_pad"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[AOIId_previous]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+AOIId_previous+'%26profileAOIName='+AOIName_previous+'">'+list_all+'</a></div></div>');
					document.write('<div id="'+div_id+'"class="blu_bkgrnd text_padding_left" style="border:1px solid #E6EBF0">');
					document.write('<div class="pad_top_1" style="padding-bottom:1px;"><div class="pad_top_1" style="padding-bottom:0.9px;"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[aoi_id]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+aoi_id+'%26profileAOIName='+aoi_name+'">'+aoi_name+'</a></div></div></div>');
					document.write('<div style="padding-bottom:2px;"></div>');
			   }else{
					document.write('<div class="aoi_list"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[AOIId_previous]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+AOIId_previous+'%26profileAOIName='+AOIName_previous+'">'+list_all+'</a></div>');
					document.write('<div class="pad_adj_10 my_account_headtoppadadj"><a class="sub_head" href="/PortalTemplates/JumpPage.jsp?category='+jumppagetitle+'&amp;link='+aoi_names[aoi_id]+'&amp;toURL='+targetURL+'%3FprofileAOI%3D'+aoi_id+'%26profileAOIName='+aoi_name+'">'+aoi_name+'</a></div>');
			   }
			}
		}	

		if(IsNewsBorder=='true'){
			document.write('<div id="'+div_id+'"class="content_padding_aoi"">');
		}
							
		document.write('<ul>');
		document.write('<li><div><a href="'+headlinelink+'">'+headline+'</a>');
		document.write('<span class="text_small date_pad_5">'+last_update+'</span>');
		if(IsNews=='yes')//to show camera image only if it is for the News Portlet
		{
			if(item_comp_id)
			{
				document.write('<span class="camera_image"><img class="text_small" src="/RI/icons/white/photo.gif" /></span>');
			}
		}

		if( locale != "fr_FR" && IsNews=='yes' && jumppagetitle == 'News_select_news' && multimedia_compid != '' ){
			document.write('<span class="camera_image"><img class="text_small" src="/RI/icons/gray/multimedia.gif" style="height:12px" /></span>');
		}
							
		document.write('</div></li>');
		document.write('</ul>');
		if(IsNewsBorder=='true')
		{
			document.write('</div>');
		}
		AOIId_previous	= AOIId_current;				
		AOIName_previous = AOIName_current;
	}


/*Function for displaying events in the home page 
*	author : Reshma
*	version : 1.0
*	date		: 9/23/2005
*/
function display_events(Headlinenum,AOIName,Startdate,Enddate,Venue,Description,Headlinelink,to,Listall,AOIId,date,Venue1,Description1,targetURL,type_id,eventsType,JumppageTitle)
{			
		currentAOI=AOIId;	
		currentAOIName=AOIName;
		currentType_id=type_id;
		currenteventsType=eventsType;
		
		if(Headlinenum==1)
		{
			if(PageName =='es_ES_AgendaMedica'){
				document.write('<div class="sub_head tab_aoi"><a href="/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+AOIId+'%26profileAOIName%3D'+AOIName+'%26typeID%3D'+type_id+'%26eventsType%3D'+eventsType+'">'+AOIName+'</a></div>');
			}else{
				document.write('<div class="sub_head tab_aoi"><a href="/PortalTemplates/JumpPage.jsp?category='+JumppageTitle+'&amp;toURL=/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+AOIId+'%26profileAOIName%3D'+AOIName+'%26typeID%3D'+type_id+'%26eventsType%3D'+eventsType+'">'+AOIName+'</a></div>');
			}
			document.write('<div class="sub_head tab_column_1 continue">'+date+'</div>');
			document.write('<div class="sub_head tab_column_2 continue">'+Venue1+'</div>');
			document.write('<div class="sub_head tab_column_3 continue">'+Description1+'</div>');
			document.write('<div class="background row_color">');		
			
		}
		if( Headlinenum!=1)
		{
			if(previousAOI!=currentAOI)
			{
				if(PageName=='es_ES_AgendaMedica'){
					document.write('<div class="sub_head tab_list_last discontinue"><a  href="/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+previousAOI+'%26profileAOIName%3D'+previousAOIName+'%26typeID%3D'+previousType_id+'%26eventsType%3D'+previouseventsType+'">'+Listall+'</a></div>');
					document.write('<div class="sub_head tab_aoi "><a href="/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+AOIId+'%26profileAOIName%3D'+AOIName+'%26typeID%3D'+type_id+'%26eventsType%3D'+eventsType+'">'+AOIName+'</a></div>');
				}else{
					document.write('<div class="sub_head tab_list_last discontinue"><a  href="/PortalTemplates/JumpPage.jsp?category='+JumppageTitle+'&amp;toURL=/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+previousAOI+'%26profileAOIName%3D'+previousAOIName+'%26typeID%3D'+previousType_id+'%26eventsType%3D'+previouseventsType+'">'+Listall+'</a></div>');
					document.write('<div class="sub_head tab_aoi "><a href="/PortalTemplates/JumpPage.jsp?category='+JumppageTitle+'&amp;toURL=/medical_and_more/'+targetURL+'%3FprofileAOI%3D'+AOIId+'%26profileAOIName%3D'+AOIName+'%26typeID%3D'+type_id+'%26eventsType%3D'+eventsType+'">'+AOIName+'</a></div>');
				}
				document.write('<div class="sub_head tab_column_1 continue">'+date+'</div>');
				document.write('<div class="sub_head tab_column_2 continue">'+Venue1+'</div>');
				document.write('<div class="sub_head tab_column_3 continue">'+Description1+'</div>');
				color=1;
			}
			if(color%2==0)
			{
				document.write('<div class="background">');
			}
			else
			{
				document.write('<div class="background row_color">');
			}

		}
			
		document.write('<div class=" tab_column_five continue">'+Startdate+' '+to+'<br>'+Enddate+'</div>');
		document.write('<div class="continue tab_column_six ">'+Venue+'</div>');
		document.write('<div class="tab_column_seven continue"><a href="'+Headlinelink+'">'+Description+'</a></div></div>');

		previousAOI=currentAOI;
		previousAOIName = currentAOIName;
		previousType_id=currentType_id;
		previouseventsType=currenteventsType;
		color++;
}//end of function display events

/*Function for displaying events calendar in the home page 
*	author : Reshma
*	version : 1.0
*	date		: 9/23/2005
*/

function display_eventsCalendar(Headlinenum,Resname,Startdate,Enddate,Venue,Description,Headlinelink,Listall,AOIId,to,date,Venue1,Description1)
{				
		eventsCalendar_AOIID = AOIId;
		eventsCalendar_AOIName = Resname;
		if(Headlinenum==1)
		{
			document.write('<div >');		
			document.write('<div class="sub_head tab_column_one continue">'+date+'</div>');
			document.write('<div class="sub_head tab_column_two continue">'+Venue1+'</div>');
			document.write('<div class="sub_head tab_column_three continue">'+Description1+'</div>');
		}
		if((Headlinenum%2)!=0)
		{
			document.write('<div class="background row_color">');
			document.write('<div class=" tab_column_five continue">'+Startdate+' '+to+'<br>'+Enddate+'</div>');
			document.write('<div class="continue tab_column_six ">'+Venue+'</div>');
			document.write('<div class="tab_column_seven continue"><a href="'+Headlinelink+'">'+Description+'</a></div>');
			document.write('</div>');
		}else{			
			document.write('<div class="background ">');
			document.write('<div  class="tab_column_five continue">'+Startdate+' '+to+'<br>'+Enddate+'</div>');
			document.write('<div  class="continue tab_column_six ">'+Venue+'</div>');
			document.write('<div  class="tab_column_seven continue"><a href="'+Headlinelink+'">'+Description+'</a></div>');
			document.write('</div>');
					
		
		}		
}
/* Function for displaying the remaining headlines in the medical and more intermediate page
*	author : Arathi P
*	version : 1.0
*	date		: 9/28/2005
*/

function display_remainingHeadlines(congresshighlights,localevalue,headLineNum,headline,last_updated_day,last_updated_time,headlinelink,item_comp_id,articleItem,med_more,aoiid,aoinames)
{
	 if(localevalue!='de_DE'){	
		if(previousDate != last_updated_day)
		{
				previousDate=last_updated_day;
				document.write('</ul>');
				document.write('<div class="text_small pad_adj_head_10">'+previousDate+'</div>');
				document.write('<ul>');
		}
	 }
	if(item_comp_id.trim()=='' || item_comp_id.trim()=='null')
	{ 
		if(localevalue!='de_DE'){
			document.write('<li><a href="'+headlinelink+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
		}else{
			document.write('<li><a href="'+headlinelink+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_day+'</span><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
		}
	}
	else
	{
		var iconspath='';
		if(congresshighlights == 'congress_hl_news')
			iconspath='/RI/icons/gray/multimedia.gif';
		else
			iconspath='/RI/icons/white/photo.gif';

		if(localevalue!='de_DE'){
			document.write('<li><a href="'+headlinelink+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'<img src="'+iconspath+'" class="marginleft_5 width="16px;" height="12px;""/></span></li>');
		}else{
			document.write('<li><a href="'+headlinelink+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_day+'</span><span class="text_small date_pad_5">'+last_updated_time+'<img src="'+iconspath+'" class="marginleft_5" width="16px;" height="12px;"/></span></li>');
		}
	}
}



/* Function for displaying the page numbers for navigation in the events portlet in the intermediate page 
*	author : Arathi P
*	version : 1.0
*	date		: 9/26/2005
*/
	function display_eventsIntermediate(Headlinenum,Startdate,Enddate,Venue,Description,Headlinelink,Event_id,total_records,id_event,StartDate,EndDate,Page,of,l_date_text,l_venue_text,l_description_text,to,no_of_links,no_of_browsepages,start_date,end_date,profile_aoi,start_page,profile_aoi_name,targetURL,aoiid,typeID)
		{	
			if(Headlinenum==1){
				document.write('<div id="medical_inter" class="medical">');		
				document.write('<div class="tab_column_one continue"><h4>'+l_date_text+'</h4></div>');
				document.write('<div class="tab_column_two continue"><h4>'+l_venue_text+'</h4></div>');
				document.write('<div class="tab_column_three continue"><h4>'+l_description_text+'</h4></div>');	document.getElementById("EventNavigationTop").innerHTML=display_Pages(total_records,StartDate,EndDate,Page,of,no_of_links,no_of_browsepages,start_date,end_date,profile_aoi,start_page,profile_aoi_name,targetURL,aoiid,typeID);
			}
			if((Headlinenum%2)!=0){
				document.write('<div class="row_color background">');
				document.write('<div class=" tab_column_five continue">'+Startdate+' '+to+'<br>'+Enddate+'</div>');
				document.write('<div class="continue tab_column_six ">'+Venue+'</div>');
				document.write('<div class="tab_column_seven continue"><a href="'+Headlinelink+'">'+Description+'</a></div>');
				document.write('</div>');		
			}else{
				document.write('<div class=" tab_column_five continue">'+Startdate+' '+to+'<br>'+Enddate+'</div>');
				document.write('<div class="continue tab_column_six ">'+Venue+'</div>');
				document.write('<div class="tab_column_seven continue"><a href="'+Headlinelink+'">'+Description+'</a></div>');
			}
		}
/* Function for displaying the page numbers for navigation in the events portlet in the intermediate page 
*	author : Arathi P
*	version : 1.0
*	date		: 9/26/2005
*/

	function display_Pages(total_records,StartDate,EndDate,Page,of,no_of_links,no_of_browsepages,start_date,end_date,profile_aoi,start_page,profile_aoi_name,targetURL,aoiid,typeID)
	{var no_of_pages,link_var=0,current_page=1;
		stringForPageNavi="";
		//The start_date,end_date are set to empty strings before the queries are executed
		if(start_date == StartDate)
			start_date='';
		if(end_date == EndDate)
			end_date='';
		var noofLinks = no_of_links;
		link_var= parseInt(total_records/noofLinks);
		no_of_pages = ((total_records%noofLinks)==0)? link_var : (link_var+1);

		current_page=parseInt((start_page/noofLinks)+1);
		
		//To set the start_page and end_page
		if((current_page <= 3)){ 
			start_page = 1;
			if(no_of_pages < (no_of_browsepages)){
				end_page = no_of_pages;
			}else{
				end_page = (no_of_browsepages);
			}
		}else if(current_page > (no_of_pages-2))
			{//Check if the page that is displayed is one of the last two pages.
					if(no_of_pages < (no_of_browsepages))
					{
						start_page=1;
					}else{
						start_page = (no_of_pages+1)-(no_of_browsepages);
					}//start page is set such that only five pages are displayed at a time
				end_page = no_of_pages;
			}else{
				start_page = current_page-2;
				end_page = current_page+2;
			}
		stringForPageNavi=stringForPageNavi + '<div>'+Page+' '+current_page+' '+of+' '+no_of_pages;
		stringForPageNavi=stringForPageNavi + '<span class="pad_185">';
		if(no_of_pages!=1){
			if(current_page!=1 ){
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+0+'&startDate='+start_date+'&endDate='+end_date+'&typeID='+typeID+'" > &lt;&lt; </a><span class="pad_5"> |</span><span class="pad_5">';
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+(current_page-2)*(no_of_links)+'&startDate='+start_date+'&endDate='+end_date+'&typeID='+typeID+'">&lt; </a></span><span class="pad_5"> |</span><span class="pad_5">';
			}
			for(var i=start_page; i<=(end_page); i++){
				if(i!=current_page){
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+(i-1)*(no_of_links)+'&startDate='+start_date+'&endDate='+end_date+'&typeID='+typeID+'">'+i+'</a></span><span class="pad_5"> |</span><span class="pad_5">';
				}else{
					if(i==end_page)
					stringForPageNavi=stringForPageNavi+'<span class="sub_head editor_color">' + i +'</span>';
					else
					stringForPageNavi=stringForPageNavi+'<span class="sub_head editor_color">' + i + '</span></span><span class="pad_5"> |</span><span class="pad_5">';
				}
			}
			
		if( current_page!= no_of_pages){
			stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+(current_page)*(no_of_links)+'&startDate='+start_date+'&endDate='+end_date+'&typeID='+typeID+'">&gt;</a></span><span class="pad_5"> |</span><span class="pad_5">';
			stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+(no_of_pages-1)*(no_of_links)+'&startDate='+start_date+'&endDate='+end_date+'&typeID='+typeID+'" > &gt;&gt; </a></span>';
		}
	}
	stringForPageNavi=stringForPageNavi + '</span>';
	stringForPageNavi=stringForPageNavi + '</div>';
	return stringForPageNavi;
}

/**
*	Function to validate the start date and end date for events intermediate category
*	@author : Arathi. P
*	@date : 9/26/2005
*/
 function  dateValidation(start_date,end_date,profile_aoi,StartDate,EndDate,ErrorMessage1,profile_aoi_name,ErrorMessage2,ErrorMessage3,ErrorMessage4,ErrorMessage5,ErrorMessage6,ErrorMessage7,ErrorMessage8,ErrorMessage9,targetURL,close_link,sun,mon,tue,wed,thu,fri,sat,typeID)
{
	var result_start,result_end;
	/*Added statements to validate the date------------begin*/
	var dtstart=document.calender.startDate.value
	var dtend=document.calender.endDate.value
	// If the dates are other than the default values and blank ,they are validated if they are in the correct format and a variable is set to true
	if( dtstart!='' && dtstart != StartDate){
	result_start=isDate(start_date,StartDate,ErrorMessage2,ErrorMessage3,ErrorMessage4,ErrorMessage5,ErrorMessage6,ErrorMessage7,ErrorMessage8);
	}else{
	result_start=true;
	}
	if(dtend!='' && dtend != EndDate){
	result_end=isDate(end_date,EndDate,ErrorMessage2,ErrorMessage3,ErrorMessage4,ErrorMessage5,ErrorMessage6,ErrorMessage7,ErrorMessage8);
	}else{
	result_end=true;
	}
	/*end of validation of date*/
//Only if dates are in correct format or they are blank or default values they enter the loop
	if( result_start & result_end){
		//start_date = document.calender.startDate.value;
		//end_date = document.calender.endDate.value;
		//If dates are entered for both start and end dates its validated if end date is greater than start date else error message displayed
		if( dtstart!='' & dtstart!=StartDate & dtend!='' & dtend!=EndDate){
			//function which converts date into the required 2 digit format
			var start_date_format= whichDateGreater(start_date);
			var dateObjStart = new Date(parseInt(start_date_format.substring(4,8),10),parseInt(start_date_format.substring(2,4)-1,10),parseInt(start_date_format.substring(0,2),10));
			//function which converts date into the required 2 digit format
			var end_date_format=whichDateGreater(end_date);
			var dateObjEnd =new Date(parseInt(end_date_format.substring(4,8),10),parseInt(end_date_format.substring(2,4)-1,10),parseInt(end_date_format.substring(0,2),10));
			var greaterDate=(dateObjStart.getTime()/1000)<(dateObjEnd.getTime()/1000);
			if(greaterDate)
			{							
				window.location.href=targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+0+'&startDate='+start_date+'&endDate='+end_date+'&hidstdate='+document.calender.strfromDateStart.value+'&hidenddate='+ document.calender.strfromDateEnd.value+'&typeID='+typeID;
			}else{
				alert(ErrorMessage1);
			}
		}else{
			//if start date and end date are the default values they are set to '' before passing it to the url
			if(start_date == StartDate)
			start_date='';
			if(end_date == EndDate)
			end_date='';
			
			window.location.href=targetURL+'?profileAOI='+profile_aoi+'&profileAOIName='+profile_aoi_name+'&startpos='+0+'&startDate='+start_date+'&endDate='+end_date+'&hidstdate='+document.calender.strfromDateStart.value+'&hidenddate='+ document.calender.strfromDateEnd.value+'&typeID='+typeID;
		}
	}
}
/* Functions related to Popup Calendar  in events*/

function convertDate(theDate)
{
  var m = theDate.getMonth() + 1;
  
  return m + "/" + theDate.getDate()  +  '/' +   theDate.getFullYear();
  //return theDate.getDate() + "/" +  m +  '/' +   theDate.getFullYear();
}


function reDraw(theReturn,theHidden,theDate,doc,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat)
{
  var oNewDoc = doc;
  oNewDoc.write("<HTML><HEAD><TITLE>" + theDate + "<\/TITLE><link rel=\"stylesheet\" type=\"text\/css\" href=\"\/PortalTemplates\/resource_files\/styles\/univadis\/"+locale+"\/style.css\" media=\"screen\" \/><link rel=\"stylesheet\" type=\"text\/css\" href=\"\/PortalTemplates\/resource_files\/styles\/univadis\/"+locale+"\/style_ie.css\" media=\"screen\" \/><style>.popup_bottom_bar { height:9px;padding:15px 10px 15px 10px;background-color:#cccccc;margin-top:1px;}</style><SCRIPT>");
  oNewDoc.write('function setDate(theReturn,theHidden,theDate,ErrorMessage9,close_link,sun,mon,tue,wed,thu,fri,sat,formStatusALL) {window.opener.setDate(theReturn,theHidden, theDate,ErrorMessage9,close_link,sun,mon,tue,wed,thu,fri,sat,formStatusALL); window.close(); }');
   oNewDoc.write('function KeyDown(event) {var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode==13) window.document.cal.mth.focus(); }');
  //marginwidth and marginheight are set for FF and Netscape,while leftmargin and topmargin for IE
  oNewDoc.write("<"+"/SCRIPT><\/HEAD>\n<BODY leftmargin=0px topmargin=0px marginwidth=0px marginheight=0px scroll=no>");
  drawCal(theReturn,theHidden,theDate,oNewDoc,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat);
  oNewDoc.write("<\/BODY>\n<\/HTML>");
  oNewDoc.close();
}


function setDate(theReturn,theHidden,theDate,ErrorMessage9,close_link,sun,mon,tue,wed,thu,fri,sat,formStatusALL)
{	
	  var field = document.forms[formStatusALL].elements[theReturn];
	  var field2 = document.forms[formStatusALL].elements[theHidden];
	  var a = theDate.indexOf("/");
	  var b = theDate.lastIndexOf("/");
	  var mth = theDate.substring(0,a);  
	  var month = mth;
	  if (mth == 1) month = "01";if (mth== 2) month = "02"; if (mth== 3) month = "03"; if (mth== 4) month = "04";
	  if (mth== 5) month = "05"; if (mth== 6) month = "06"; if (mth== 7) month = "07"; if (mth== 8) month = "08";
	  if (mth== 9) month = "09"; if (mth== 10) month = "10"; if (mth== 11) month = "11";  if (mth== 12) month = "12";
	  var day = theDate.substring(a+1,b);
	  if (day.length == 1) day = "0"+day;
	  var year = theDate.substring(b+3,b+5);
	  var temp = day+"/" + month+ "/" + year;
  	  var ttemp = day+"/" + month+ "/" + theDate.substring(b+1);

	  if(theDate.substring(b+1)>1999 & theDate.substring(b+1)<2999)      //changed
	  {
		  field.value = temp;
		  field2.value = ttemp;
	  }else{
		 alert(ErrorMessage9);
	  }
	 field.select();
}


function SelectMonth(theField,theReturn,theHidden,theYear,theMonth,theDoc,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat)
{	
  var y = parseInt(theYear);
  var m = parseInt(theMonth);
  if ( isNaN(y) || y < 0 || isNaN(m) || m < 0 || m >= 12 )
  {
    theField.focus();
    theField.select();
    return false;
  }
  if ( y < 100 )
  {
    y += 1900;
    if ( y < 1970 ) y+= 100;
  }
  ++m;
  reDraw(theReturn,theHidden, m +'/1/'+y, theDoc,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat);
  return true;
}

function drawCal(theReturn,theHidden,theDate,doc,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat)
{
  
  var dPrev, dNext, d0;
  var m, y;
  var i;
  
  d0 = new Date(Date.parse(theDate));
  
  m = d0.getMonth();
  y = d0.getFullYear();
 
  d0.setDate(1,'','',ErrorMessage9,close_link,sun,mon,tue,wed,thu,fri,sat,formStatusALL);
  dPrev = new Date(d0);
  dNext = new Date(d0);
  dPrev.setMonth(dPrev.getMonth()-1);
  dNext.setMonth(dNext.getMonth()+1);
  doc.writeln("<body bgcolor=\"#EBEBEB\"\/>");
  doc.writeln("<form name=\"cal\" ><div style=\"*height:176px;min-height:179px;\"><TABLE cellpadding=\"1px;\" class=\"content_margin_std\" align=\"center\">");
  doc.write("<TR>\n<TH><A class=\"more;\" HREF=\"javascript:window.opener.reDraw('");
  doc.write(theReturn);
  doc.write("','");
  doc.write(theHidden);
  doc.write("','" + convertDate(dPrev) + "',document,'"+ErrorMessage9+"','"+locale+"','"+close_link+"','"+sun+"','"+mon+"','"+tue+"','"+wed+"','"+thu+"','"+fri+"','"+sat+"')\">&lt;");
  doc.write("<\/HREF><\/TH>\n<TH colspan=5 align=center>\n<SELECT style=\"width:45px\" name=\"mth\" onchange=\"window.opener.SelectMonth(this,'" + theReturn + "','" + theHidden + "'," + y + ",this.selectedIndex, document,'"+ErrorMessage9+"','"+locale+"','"+close_link+"','"+sun+"','"+mon+"','"+tue+"','"+wed+"','"+thu+"','"+fri+"','"+sat+"')\">");
  for ( i = 1; i <= 12; ++i )
  {
    if ( i == m + 1 )
      doc.write("<OPTION SELECTED>" + i + "<\/OPTION>");
    else
      doc.write("<OPTION>" + i + "<\/OPTION>");
  }
  doc.write("<\/SELECT><INPUT onKeyPress='Javascript:KeyDown(event);' style=\"width:40px\"  ID=\"YEAR\" VALUE=" + y + "  onblur=\"window.opener.SelectMonth(this,'" + theReturn + "','" + theHidden + "',this.value," + m +", document,'"+ErrorMessage9+"','"+locale+"','"+close_link+"','"+sun+"','"+mon+"','"+tue+"','"+wed+"','"+thu+"','"+fri+"','"+sat+"')\"><\/TH><TH><A class=\"medical;\" HREF=\"javascript:window.opener.reDraw('");
  doc.write(theReturn);
  doc.write("','");
  doc.write(theHidden);
  doc.write("','" + convertDate(dNext) + "',document,'"+ErrorMessage9+"','"+locale+"','"+close_link+"','"+sun+"','"+mon+"','"+tue+"','"+wed+"','"+thu+"','"+fri+"','"+sat+"')\">&gt;");  doc.write("<\/HREF><\/TH><\/TR>\n");
  doc.writeln("<TR><TH><h4>"+sun+"<\/h4><\/TH><TH><h4>"+mon+"<\/h4><\/TH><TH><h4>"+tue+"<\/h4><\/TH><TH><h4>"+wed+"<\/h4><\/TH><TH><h4>"+thu+"<\/h4><\/TH><TH><h4>"+fri+"<\/h4><\/TH><TH><h4>"+sat+"<\/h4><\/TH><\/TR><TR>");
  for ( i = 0; i < d0.getDay(); ++i )
  {
    doc.write("<TD><\/TD>");
  }
  for ( i = 1; i < 32; ++i )
  {
    d0.setDate(i,'','',ErrorMessage9,close_link,sun,mon,tue,wed,thu,fri,sat,formStatusALL);
    if ( d0.getMonth() != m ) break;
    doc.write("<TD align=\"right\"><A class=\"more;\" HREF=\"javascript:setDate('" + theReturn +"','"+theHidden+"','");
    doc.write(convertDate(d0));
    doc.write("','"+ErrorMessage9+"','"+close_link+"','"+sun+"','"+mon+"','"+tue+"','"+wed+"','"+thu+"','"+fri+"','"+sat+"','"+formStatusALL+"')\">" + i + "<\/TD><\/A>");
    if ( d0.getDay() == 6 ) doc.write("<\/TR><TR>\n");
  }
  doc.writeln("<\/TR><\/TABLE></div><\/form>");
  doc.writeln("<div class=\"popup_bottom_bar\" ><a href=\"#\" onclick=\"window.close();\" class=\"align_right\">"+close_link+"<\/a><\/div>");
  doc.writeln('<\/body>');
}

function PickDate(theField,theHidden,StartDate,EndDate,result,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat)//result added
{
  var x=0, y=0;
  if (document.all)
  {
    x = window.screenLeft + window.event.x;
    y = window.screenTop  + window.event.y;
  }else{
    x = self.screenX;
    y = self.screenY;
  }

  if ( x + 220 > screen.width )
  {
    x = screen.width - 220;
  }
  if ( y + 260 > screen.height )
  {
    y = screen.height - 260;
  }

  var oPop = window.open("", theField.name, "height=220,width=160,status=yes,toolbar=no,menubar=no,location=no,left="+x+ ",top="+y);
  var date;
  if ( theField.value == StartDate || theField.value == EndDate || theField.value == "" || result == false )
  {
    date = convertDate(new Date());
  }
  else
  {
      date = theField.value;
      var a = date.indexOf("/");var b = date.lastIndexOf("/");
	  var day = date.substring(0,a);var month = date.substring(a+1,b);
	  var mth;
	  if (month == "01") mth =1; if (month == "02") mth =2;  if (month == "03") mth =3;
	  if (month == "04") mth =4; if (month == "05") mth =5;  if (month == "06") mth =6;
	  if (month == "07") mth =7; if (month == "08") mth =8;  if (month == "09") mth =9;
	  if (month == "10") mth =10;  if (month == "11") mth =11; if (month == "12") mth =12;
	  var year = date.substring(b+1);
	  date = mth+ "/" +day +"/"+ year;
 }
  reDraw(theField.name,theHidden.name,date,oPop.document,ErrorMessage9,locale,close_link,sun,mon,tue,wed,thu,fri,sat);
  oPop.focus();
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr,stringmsg,ErrorMessage2,ErrorMessage3,ErrorMessage4,ErrorMessage5,ErrorMessage6,ErrorMessage7,ErrorMessage8)
{
	var maxYear ;
	var minYear;
	if(dtStr.substring(8) == ''){
		maxYear = 99;
		minYear=00;
	}else{
		maxYear = 2999;
		minYear=2000;
	}
	var dtCh= "/";
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 1; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert(stringmsg+' '+ErrorMessage2)
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert(ErrorMessage3+' '+stringmsg)
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert(ErrorMessage4+' '+stringmsg)
		return false
	}
/*	if (strYear.length != 2 || year<minYear || year>maxYear){
		alert(ErrorMessage6+' '+minYear+' '+ErrorMessage7+' '+maxYear+' '+ErrorMessage8+' '+stringmsg);
		return false
	}*/
	if(dtStr.substring(8) == ''){
		if (strYear.length != 2 || year<minYear || year>maxYear){
		alert(ErrorMessage6+' '+minYear+' '+ErrorMessage7+' '+maxYear+' '+ErrorMessage8+' '+stringmsg);
		return false
		}
	}else{
		if (strYear.length != 4 || year<minYear || year>maxYear){
		alert(ErrorMessage6+' '+minYear+' '+ErrorMessage7+' '+maxYear+' '+ErrorMessage8+' '+stringmsg);
		return false
		}
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert(ErrorMessage5+' '+stringmsg)
		return false
	}
	else 
		return true
}

function whichDateGreater(dtStr){	
	var dtCh= "/";
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	if(strDay.length==1)
		strDay="0"+strDay;
	var strMonth=dtStr.substring(pos1+1,pos2)
	if(strMonth.length==1)
		strMonth="0"+strMonth;
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	var daymonyear= '';
	daymonyear=strDay+strMonth+strYr;
	
	return (daymonyear);

}

/*More related*/

/**
*  Function to display the more headlines in Home and Article Page
*	@author  : Reshma
*  @date : 9/28/2005
*/
function display_moreheadlines(headlinenumber,resname,Groupid,headline,last_update,headlinelink,item_comp_id)
{
	moreheadlinegrpid=Groupid;
	moreheadlinegrpname=resname;

	if(headlinenumber == 1)
	{
			document.write('<div class="content_padding">');
			document.write('<ul>');
	}	
	document.write('<li><div><a  href="'+headlinelink+'">'+headline+'</a>');
	document.write('<span  class="text_small date_pad_5 ">'+last_update+'</span>');
	if(item_comp_id!=='')
	{			
			document.write('<span class="camera_image"><img src="/RI/icons/white/photo.gif"/></span>');			
	}
	document.write('</div></li>');
	
}


/**
*   Function to display Enlared image 
*	 @author : Reshma
*	 @date : 9/28/2005
*/
function displayEnlargedimage(headlinenum,headline,sortorder,provider,count,timestamp,leadlines,image,of,images1,previousimage,nextimage,close,component,prov_url,providerlogopath,imageComponentID,providerlogofilename,copyright_afp,copyright_elsevier,strPrint,providerID,copyright)
	{
		images1='';
		for(var index=1; index<Imagearray.length;index++)
		{
			imageNames[index] = new Image();
			imageNames[index].src = Imagearray[index];
			
			if(Imagecomp[index] == imageComponentID)
			{
				Imagecount=index;
			}
		}
		document.write('<div class="zoom_outer1">');
		document.write('<div class="zoom_image"><center><img id="enlarge" src="'+Imagearray[Imagecount]+'" alt=""></center></div>');
		document.write('<div class="zoom_bgrd">');
		if(count>1){
		document.write('<div id="countimages" class="zoom_preview zoom_text ">'+image+' '+Imagecount+' '+of+' '+count+' '+images1+'</div>');
		}else{
		document.write('<div id="countimages" class="zoom_preview zoom_text ">&nbsp;</div>');
		}		
		document.write('<div id="first" class="zoom_text zoom_prenext zoom_pad_right_7">&lt;&lt;</div>');
		document.write('<div id="previous" class="zoom_text zoom_prenext zoom_pad_right_8">'+previousimage+'</div>');
		document.write('<div id="seperator" class="zoom_text zoom_pad_right_8"> | </div>');
		document.write('<div id="next" class="zoom_text zoom_prenext"><a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'next\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">'+nextimage+'</a></div>');
		document.write('<div id="last" class="zoom_text zoom_prenext zoom_pad_left_7"><a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'last\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">&gt;&gt;</a></div>');
		document.write("<div class=\"zoom_print_img\"><A onclick=Javascript:print(); href=\"javascript:void(0);\"><IMG onmouseover=\"changeIcon(this,'mediumgray/print_on.gif');\" title='"+strPrint+"' onmouseout=\"changeIcon(this,'/mediumgray/print_off.gif');\" alt='"+strPrint+"' src=\"/RI/icons/mediumgray/print_off.gif\" border=0></A></div>");
		document.write('</div>');
		document.write('<div class="zoom_body">');
		if(providerID=="INFM" || providerID=="magazine" || providerID=="noticiario_medico"){
			document.write('<div class="zoom_date zoom_pad_top_6">'+timestamp+'</div>');
		}else{
			document.write('<div class="zoom_date zoom_pad_top_6">'+timestamp+' ('+provider+')</div>');
		}
		//document.write('<div class="zoom_date zoom_pad_top_6">'+timestamp+' ('+provider+')</div>');
		//document.write('<div class="head zoom_pad_top_4">'+headline+'</div>');
		//document.write('<div class="text zoom_pad_top_4">'+leadlines+'</div>');
		document.write('<div class="zoom_pad_top_4" id="caption" >'+ImageCaptions[Imagecount]+'</div>');	
		if(providerlogofilename!='')
		if(providerID=="afp" || providerID=="AFP" || provider=="AFP"){
			document.write('<div class="zoom_date pad_top_10 continue width_adj350" >'+copyright_afp);
		}
		else if (providerID=="elsevier-health"){
			document.write('<div class="zoom_date pad_top_10 continue width_adj350" >'+copyright_elsevier);
		}
		else{
			document.write('<div class="zoom_date pad_top_10 continue width_adj350" >'+copyright);
		}		

		document.write('</div>');
		if(providerID=="JIM" || providerID=="ECG" || providerID=="IDM" || providerID=="PR" || providerID=="IMJ" || providerID=="INFM" || providerID=="Urgences"){
		document.write('<div class="continue zoom_provider pad_top_10"></div>');
		}
		else if(providerlogofilename!=''){
			document.write('<div class="continue zoom_provider pad_top_10"><a href='+prov_url+' target="_blank"><img  border=0 src="'+providerlogopath+providerlogofilename+'"  alt=""></a></div>');
		}
		else{
			document.write('<div class="continue zoom_provider " style="padding-top:27px" ></div>');
		}
		document.write('</div>');
		document.write('<div class="zoom_bgrd_bottom pop_pos_abs pass_popup_closebar_bottom_align">');
		document.write('<div class="zoom_text zoom_close"><a class="zoomarticle" href="javascript:void(0);" onclick="window.close()">'+close+'</a></div>');
		document.write('</div>');
		document.write('</div>');
		document.write('</div>');
		if (count == 1)
		{
			document.getElementById('previous').innerHTML='';		
			document.getElementById('first').innerHTML='';
			document.getElementById('next').innerHTML='';
			document.getElementById('last').innerHTML='';
			document.getElementById('seperator').innerHTML='';
			//document.getElementById('countimages').innerHTML=image+' '+Imagecount+' '+of+' '+count;
		}
		if(Imagecount>1 && 	Imagecount<count)
		{
			//   call slideShow function with slidetype previous 
			slideShow('prev',previousimage,nextimage,image,of,images1,count,this);
			slideShow('next',previousimage,nextimage,image,of,images1,count,this);
		}
		if(Imagecount==count && Imagecount!=1)
		{
			// call slideShow function with slidetype last
			slideShow('last',previousimage,nextimage,image,of,images1,count,this);
		}
	}
/**
*   Function to display the next or previous images. This function is called in displayEnlargedimage
*	 @author : Reshma
*	 @date : 9/28/2005
*/
	function slideShow(slideType,previousimage,nextimage,image,of,images1,count,whichpic)
	{	
		if(slideType == 'next' || slideType == 'last' )
		{
			Imagecount++;
			document.getElementById('previous').innerHTML='<a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'prev\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">'+previousimage+'</a>';
			document.getElementById('first').innerHTML='<a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'first\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">&lt;&lt;</a>';	
			if(slideType == 'last')
			{
				Imagecount = count;
			}
			whichpic.href=imageNames[Imagecount].src;	
			document.getElementById('enlarge').src = whichpic.href;
			document.getElementById('countimages').innerHTML=''+image+' '+Imagecount+' '+of+' '+count+' '+images1;
			if(Imagecount==count)	
			{
				document.getElementById('next').innerHTML=nextimage;
				document.getElementById('last').innerHTML='&gt;&gt;';
			}		
		
		}
		else if(slideType == 'prev' || slideType == 'first')
		{
			document.getElementById('next').innerHTML='<a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'next\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">'+nextimage+'</a>';
			document.getElementById('last').innerHTML='<a class="zoomarticle" href="javascript:void(0)" onclick="return slideShow(\'last\',\''+previousimage+'\',\''+nextimage+'\',\''+image+'\',\''+of+'\',\''+images1+'\','+count+',this);">&gt;&gt;</a>';
			Imagecount--;
			if(slideType == 'first')
			{
				Imagecount = 1;
			}
			whichpic.href=imageNames[Imagecount].src;	
			document.getElementById('enlarge').src = whichpic.href;
			document.getElementById('countimages').innerHTML=''+image+' '+Imagecount+' '+of+' '+count+' '+images1;
			if(Imagecount==1)	
			{
				document.getElementById('previous').innerHTML=previousimage;		
				document.getElementById('first').innerHTML='&lt;&lt;';
			}		
		}
		document.getElementById('caption').innerHTML=ImageCaptions[Imagecount];
	return false;
	}


/**
 *	Function to get the current date value. 
 *	@author : Suresh
 * @date : 9/29/2005
 */
function currentDate()
{
	var today = new Date();
	var month = today.getMonth() + 1;
	var day = today.getDate();
	var year = today.getFullYear();
	var s = "/";
	document.write(day+s+month+s+year);
}


/**
 *	Function to display the more news in Home page
 *	@author : Reshma
 * @date : 9/29/2005
 */

function display_morenews(headlinenum,resname,wirename,Groupid,headline,leadlines,last_update,filename,headlinelink,article_item_id,provider,Goto,Listall,minleadlines,newsImagePath,jumppagetitle,strLocale)
		{
			var len=leadlines.length;
			var articleImagePath = newsImagePath+"/news/"+wirename+"/"+filename;
			var headlinecheck = new Array();
			var image_headline_common = new Image();
            image_headline_common.src = articleImagePath;
			var headline_image_width = image_headline_common.width;
			if(headline_image_width <= '108')
			{
				headlinecheck = CheckHeadlineLength(headline);			
			}
			var newsInterPagename="News_Intermediate_More";
			if(strLocale=="de_AT")
			headlinecheck[0]=false;
			if(strLocale=="nl_NL") {
				if(Groupid=="31" || Groupid=="32" || Groupid=="33" || Groupid=="34")
					articleImagePath = newsImagePath+"/nl_NL/"+wirename+"/"+filename;
			}					
			//Added for multiple provider more news portlets
			if(strLocale=="fr_BE"){
				if(Groupid=="17" || Groupid=="4") newsInterPagename="News_Inter_More";
			}
			if(strLocale=="nl_BE"){
				if(Groupid=="17" || Groupid=="4" || Groupid=="3" || Groupid=="16") newsInterPagename="News_Inter_More";
			}
			if(strLocale == "fr_BE" || strLocale == "nl_BE"){
				if (Groupid == "1" || Groupid == "14" || Groupid == "15" || Groupid == "16" || Groupid == "17" || Groupid == "18"){
					articleImagePath = newsImagePath+"/"+strLocale+"/"+wirename+"/"+filename;
				}
			}
			if(strLocale == "en_CA") {
				articleImagePath = newsImagePath+"/en_CA/"+filename;
			}	
			if(strLocale == "fr_CA") {
				articleImagePath = newsImagePath+"/fr_CA/"+filename;
			}
			document.write('<div  class="more">');

			if(filename.trim()!='null' && filename.trim()!="")
				{		
					 var imageId = "image_"+article_item_id;
					 var divId	=	"div_"+article_item_id;
					 var textdiv = "textdiv_"+article_item_id;
					 if(len > minleadlines)
					 {
						    var max_len=eval((parseInt(minleadlines)+65)+leadlines.substring(parseInt(minleadlines)+65).indexOf(' '));
							leadlines = leadlines.substring(0,max_len)+'...';
					 }
					 if(headlinecheck[0]){ 
						document.write('<div style="padding:6px 2px 0px 8px;" ><p><a class="head" href="'+headlinelink+'">'+headlinecheck[1]+'</a></p></div>');
						document.write('<div id="morenews_'+article_item_id+'"></div>');

						document.write("<a href="+headlinelink+"><IMG style='display:none' class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' ></a>");
						document.write('</div >');

				   		document.write('<div id="'+textdiv+'" class="content_padding pad_left_right"  >');
						document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');


						document.write('<div class="pad_adj_10"><span class="text">'+leadlines+'</span>');
						document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span>');
					 }else{
					 document.write('<div id="morenews_'+article_item_id+'">');
					 document.write("<a href="+headlinelink+"><IMG style='display:none' class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' ></a>");
					 document.write('</div >');

				   	 document.write('<div id="'+textdiv+'" class="content_padding pad_left_right"  >');
					 document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
					 document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');

					 document.write('<div class="pad_adj_10"><span class="text">'+leadlines+'</span>');
					 document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');
					 }

					 if(strLocale=="nl_NL") {
						if(Groupid=="1" || Groupid=="32")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Local_Inter%3FGRPid%3D1%26GRPName%3DLocal%26GRPid2%3D32%26GRPName2%3DBinnenlands">'+Listall+'</a></div>');				 
						if(Groupid=="2" || Groupid=="33")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_World_Inter%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D33%26GRPName2%3DBuitenlands">'+Listall+'</a></div>');
						if(Groupid=="3" || Groupid=="34")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Financial_Inter%3FGRPid%3D3%26GRPName%3DFinancial%26GRPid2%3D34%26GRPName2%3DEconomish">'+Listall+'</a></div>');
						if(Groupid=="4" || Groupid=="31")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Sport_Inter%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D31%26GRPName2%3DSport">'+Listall+'</a></div>');
					 }
					 else if(strLocale=="en_SA" && Groupid=="4"){
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/en_SA_Sports_Inter%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D35%26GRPName2%3D???????">'+Listall+'</a></div>');
					}
					else if(strLocale=="fi_FI" && Groupid=="1"){
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D1%26GRPName%3Dkotimaan "> Listaa kaikki...</a></div>');
						}
						 else if (strLocale=="fi_FI" && Groupid=="2")
						 {
							 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D2%26GRPName%3Dulkomaan "> Listaa kaikki...</a></div>');
						 }
						 else if(strLocale=="fi_FI" && Groupid=="3")
						{
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D3%26GRPName%3Dtalous "> Listaa kaikki...</a></div>');
						}
						else if(strLocale=="fi_FI" && Groupid=="4")
						{
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D4%26GRPName%3Durheilu- "> Listaa kaikki...</a></div>');
						}
						else {
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/'+newsInterPagename+'%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
					 }				 
					 document.write('</div></div>');
					
					 document.getElementById("morenews_"+article_item_id).innerHTML =  "<a href="+headlinelink+"><IMG   class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' onload=\"styleadjust('"+imageId+"','"+divId+"','"+textdiv+"')\"></a>";
				}
			else 
				{	
					  if(len > minleadlines)
						 {
							 var max_len=eval((parseInt(minleadlines)+60)+leadlines.substring(parseInt(minleadlines)+60).indexOf(' ') );
							 leadlines = leadlines.substring(0,max_len)+'...';
						 }
				
				document.write('<div class="content_padding pad_left_right"  >');
				document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
				document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');
				
				document.write('<div class="pad_adj_10"><span class="text ">'+leadlines+'</span>');
				document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');

 				if(strLocale=="nl_NL") {
						if(Groupid=="1" || Groupid=="32")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Local_Inter%3FGRPid%3D1%26GRPName%3DLocal%26GRPid2%3D32%26GRPName2%3DBinnenlands">'+Listall+'</a></div>');				 
						if(Groupid=="2" || Groupid=="33")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_World_Inter%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D33%26GRPName2%3DBuitenlands">'+Listall+'</a></div>');
						if(Groupid=="3" || Groupid=="34")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Financial_Inter%3FGRPid%3D3%26GRPName%3DFinancial%26GRPid2%3D34%26GRPName2%3DEconomish">'+Listall+'</a></div>');
						if(Groupid=="4" || Groupid=="31")
							document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/NL_Sport_Inter%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D31%26GRPName2%3DSport">'+Listall+'</a></div>');
					 }
					 else if(strLocale=="en_SA"){
						if(Groupid=="4") 
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/en_SA_Sports_Inter%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D35%26GRPName2%3D???????">'+Listall+'</a></div>');
					}
					else if(strLocale=="fi_FI" && Groupid=="1"){
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D1%26GRPName%3Dkotimaan "> Listaa kaikki...</a></div>');
						}
						 else if (strLocale=="fi_FI" && Groupid=="2")
						 {
							 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D2%26GRPName%3Dulkomaan "> Listaa kaikki...</a></div>');
						 }
						 else if(strLocale=="fi_FI" && Groupid=="3")
						{
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D3%26GRPName%3Dtalous "> Listaa kaikki...</a></div>');
						}
						else if(strLocale=="fi_FI" && Groupid=="4")
						{
						 document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/fi_FI_STT_Kotimaa_Inter%3FGRPid%3D4%26GRPName%3Durheilu-"> Listaa kaikki...</a></div>');
						}
					 else {
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/'+newsInterPagename+'%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
					 }
				document.write('</div></div>');
				}
}
/**
 *	Function to adjust the styles for more news if there is an image
 *	@author : Reshma
 * @date : 9/29/2005
 */

function styleadjust(imageId,divId,textdiv)
{

	if(document.getElementById(imageId).width > '108')
	{
	 document.getElementById(imageId).style.margin='0px 0px 7px 0px';
	 document.getElementById(imageId).style.padding='0px 0px 0px 0px';
	}
	else 
	{
	 document.getElementById(imageId).width='70';
	 document.getElementById(imageId).style.margin='10px 10px 6px 10px';
 	 document.getElementById(divId).style.padding='0px 0px 2px 0px';
	 var div = document.getElementById(textdiv).offsetHeight;
	 var ht = document.getElementById(imageId).offsetHeight+25;
	 var diff=ht-div;
	 if(ht > div)
	 {
		document.getElementById(textdiv).style.marginBottom=diff+"px";
	 }
	}
}

/**
*	Function to display the summary of headlines and leadlines
*	@author : vinod shirke
*/

function display_newssummary_intermediate(headLineNum,headline,leadlines,lastUpdated,imgFileName,headlineHyperlink,Goto,wireName,articleItem,leadlinecharacters,res_name,AOINumber,Listall,med_more,max_headlines,newsImagePath,aoiid,localebasedImagePath,elsevier_mednews,audio_portlet,video_portlet)
{		
		var ht_inter=0;
		var leadlinesno=leadlines.length;
		var imgFilePath='';
		var image_inter_id= "image_inter"+articleItem+AOINumber;
		var text_inter_id= "text_inter"+articleItem+AOINumber;
		var image_inter_last_id="image_inter_last"+articleItem+AOINumber;
		var text_inter_last_id="text_inter_last"+articleItem+AOINumber;
		var congress=headline.substring(0,3);

		if(imgFileName!='null' && imgFileName!=''){
			if (elsevier_mednews=="yes"){
				if(congress=="ACC" || congress=="ESH" || congress=="ASH" || congress=="ADA")
				{
					imgFilePath=newsImagePath+"/news/"+wireName+"/"+imgFileName;
				}else
				imgFilePath=newsImagePath+"/news/elsevier-mednews/"+imgFileName;
			}
			else{
			imgFilePath=newsImagePath+"/news/"+wireName+"/"+imgFileName;
			}
			if(med_more=="more" && (UserLocale=="en_CA" || UserLocale=="fr_CA")){
			localebasedImagePath="yes";
			}
			if(localebasedImagePath=="yes")
			imgFilePath = newsImagePath+"/"+UserLocale+"/"+wireName+"/"+imgFileName;
			else if(UserLocale == 'sv_SE' && (wireName == 'EKO' || wireName == 'INR' || wireName == 'SPT' || wireName == 'UTR'))
				imgFilePath = newsImagePath+"/sv_SE/"+wireName+'/'+imgFileName;//This is done coz Sweden uses common portlet and common function
			else if(UserLocale == 'fr_BE' && (wireName == 'pressbanking_healthpolitics_fr' || wireName == 'pressbanking_pracmanage_fr' || wireName == 'pressbanking_finance_fr' || wireName == 'pressbanking_localnews_fr' || wireName == 'pressbanking_entertainment_fr' || wireName =='pressbanking_sports_fr' || wireName =='belga_medical_nl_fr' || wireName =='mediargus_medical_nl_fr' || wireName =='pressbanking_medical_fr' || wireName =='belga_medical_fr')){
					imgFilePath = newsImagePath+"/fr_BE/"+wireName+'/'+imgFileName;//This is done coz Sweden uses common portlet and common function
			}
			else if(UserLocale == 'nl_BE' && (wireName == 'mediargus_healthpolitics_nl' || wireName == 'mediargus_pracmanage_nl' || wireName == 'mediargus_finance_nl' || wireName == 'mediargus_localnews_nl' || wireName == 'mediargus_entertainment_nl' || wireName =='mediargus_sports_nl' || wireName =='belga_medical_nl' || wireName =='belga_medical_fr_nl' || wireName =='pressbanking_medical_fr_nl' || wireName =='mediargus_medical_nl'))
					imgFilePath = newsImagePath+"/nl_BE/"+wireName+'/'+imgFileName;//This is done coz Sweden uses common portlet and common function
		}
			

//if(wireName=="cardiology" && imgFileName!='null' && imgFileName!='')
//imgFilePath=newsImagePath+"/news/cardiology/"+imgFileName;
		if(headLineNum!=1){
			if(imgFilePath!=''){
			document.write('<div>');
			document.write('<div id="image_inter_test'+articleItem+AOINumber+'">');
			document.write('<a href="'+headlineHyperlink+'"><img style="margin-top:10px" id="image_inter'+articleItem+AOINumber+'" src="'+imgFilePath+'" class="image_width img_left" border="0" alt=""  hspace="0" vspace="0" onload="adjust_inter(\''+image_inter_id+'\',\''+text_inter_id+'\')"/></a>');
			document.write('</div>');
			if(leadlinesno > parseInt(leadlinecharacters)+5){
				var max_len=eval(parseInt(leadlinecharacters)+leadlines.substring(parseInt(leadlinecharacters)).indexOf(' ') );
				leadlines = leadlines.substring(0,max_len);
			}
			document.write('<div id="text_inter'+articleItem+AOINumber+'" >');
			if(leadlines!='' & leadlinesno> parseInt(leadlinecharacters)+5)
				leadlines=leadlines+"...";
			}
			else{
			document.write('<div id="text_inter'+articleItem+AOINumber+'">');
			document.write('<div id="image_inter_test'+articleItem+AOINumber+'">');
			document.write('</div>');
			if(leadlinesno > (parseInt(leadlinecharacters)+70)){
				var max_len=eval((leadlinecharacters+70)+leadlines.substring(leadlinecharacters+70).indexOf(' ') );
				leadlines = leadlines.substring(0,max_len);
			}
			if(leadlines!='' & leadlinesno> (parseInt(leadlinecharacters)+70))
				leadlines=leadlines+"...";
			}		
			document.write('<a href="'+headlineHyperlink+'" class="sub_head">'+headline+'</a>');
			document.write('<span class="text_small date_pad_5">'+lastUpdated+'</span>');
			document.write('<p><span>'+leadlines+'</span>');
			document.write('<span><a href="'+headlineHyperlink+'"><nobr> '+Goto+'</nobr></a></span></p>');	
                       if(imgFileName!='null' && imgFileName!=''){

                              if(imgFileName.startsWith("0c")|| imgFileName.startsWith("SG") || imgFileName.startsWith("CPS") || imgFileName.startsWith("isd")|| imgFileName.startsWith("photo")){

                                document.write('<span class="camera_image"><img src="/RI/icons/white/photo.gif"/></span>');
                             }
                             else{
                              document.write('<span class="camera_image"><img src="/RI/icons/gray/multimedia.gif"/></span>');
                              }
                        } 
			if(imgFilePath!=''){
			document.write('</div>');
			//ht_inter=document.getElementById("image_inter"+articleItem+AOINumber).offsetHeight;
			//document.getElementById("text_inter"+articleItem+AOINumber).style.height=ht_inter+"px";
			document.write('<div class="discontinue" ></div>');
			}
			document.write('</div>');	
			if(headLineNum!=1)
				{
				var x=document.getElementById("image_inter_test"+articleItem+AOINumber).innerHTML;
				if(x=='')
					{
						document.getElementById("text_inter"+articleItem+AOINumber).style.padding='17px 0px 0px 0px';
						document.getElementById("text_inter"+articleItem+AOINumber).style.margin='0px 0px -2px 0px';
					}else{
						document.getElementById("text_inter"+articleItem+AOINumber).style.padding='20px 0px 0px 0px';
					}
				}



		}else{
			document.write('<div id="outer_inter">');
			if(imgFilePath!='')	
			{
				document.write('<div>');
				document.write('<a href="'+headlineHyperlink+'"><img style="margin-top:0px" id="image_inter_last'+articleItem+AOINumber+'" src="'+imgFilePath+'" class="image_width img_left" border="0" alt=""  hspace="0" vspace="0" onload="adjust_inter(\''+image_inter_last_id+'\',\''+text_inter_last_id+'\')" /></a>');
				document.write('</div>');
				if(leadlinesno > parseInt(leadlinecharacters)+5){
					var max_len=eval(parseInt(leadlinecharacters)+leadlines.substring(parseInt(leadlinecharacters)).indexOf(' ') );
					leadlines = leadlines.substring(0,max_len);
				}	
				if(leadlines!='' & leadlinesno> parseInt(leadlinecharacters)+5)
					leadlines=leadlines+"...";
			}else{
				if(leadlinesno > (parseInt(leadlinecharacters)+70)){
					var max_len=eval((parseInt(leadlinecharacters)+70)+leadlines.substring(parseInt(leadlinecharacters)+70).indexOf(' ') );
					leadlines = leadlines.substring(0,max_len);
				}
				if(leadlines!='' & leadlinesno> (parseInt(leadlinecharacters)+70))
					leadlines=leadlines+"...";
			}
			
			document.write('<div id="text_inter_last'+articleItem+AOINumber+'">');
			document.write('<a href="'+headlineHyperlink+'" class="sub_head">'+headline+'</a>');
			document.write('<span class="text_small date_pad_5">'+lastUpdated+'</span>');
			document.write('<p><span>'+leadlines+'</span>');
			document.write('<span><a href="'+headlineHyperlink+'"><nobr> '+Goto+'</nobr></a></span></p>');
                       if(imgFileName!='null' && imgFileName!=''){

                              if(imgFileName.startsWith("0c")|| imgFileName.startsWith("SG") || imgFileName.startsWith("CPS") || imgFileName.startsWith("isd")|| imgFileName.startsWith("photo")){

                                document.write('<span class="camera_image"><img src="/RI/icons/white/photo.gif"/></span>');
                             }
                             else{
                              document.write('<span class="camera_image"><img src="/RI/icons/gray/multimedia.gif"/></span>');
                              }
                        } 
			document.write('</div>');
			if(imgFilePath!='')
			{
				//ht_inter=document.getElementById("image_inter_last"+articleItem+AOINumber).offsetHeight;
				//document.getElementById("text_inter_last"+articleItem+AOINumber).style.height=ht_inter+"px";
				document.getElementById("image_inter_last"+articleItem+AOINumber).style.margin='0px 14px 0px 0px';
				//document.getElementById("outer_inter").style.margin='3px 0px 0px 0px';
				document.write('<div class="discontinue" ></div>');
				//document.getElementById("text_inter_last"+articleItem+AOINumber).style.margin='0px 0px 0px 0px';
			}else{
				document.getElementById("outer_inter").style.margin='0px 0px 0px 0px';
				document.getElementById("text_inter_last"+articleItem+AOINumber).style.margin='0px 0px -2px 0px';
			}
			document.write('</div>');
		}
		
		if(med_more=="medical" && max_headlines!=5){
			if (headLineNum==max_headlines)
			{
				if(PageName == "es_ES_DoymaIntermediate") {
					document.write('<div class="text_padding_top"><a href="/medical_and_more/es_ES_DoymaIntermediateAOI?profileAOI='+aoiid+'&profileAOIName='+res_name+'" class="sub_head">'+Listall+'</a></div>');
				} else if(PageName == "de_DE_News_Intermediate_Medical") {
					document.write('<div class="text_padding_top"><a href="/medical_and_more/de_DE_News_Intermediate_MedicalAOI?profileAOI='+aoiid+'&profileAOIName='+res_name+'" class="sub_head">'+Listall+'</a></div>');
				} else {
					document.write('<div class="text_padding_top"><a href="/medical_and_more/News_Intermediate_MedicalAOI?profileAOI='+aoiid+'&profileAOIName='+res_name+'" class="sub_head">'+Listall+'</a></div>');
				}
			}
		}
}

function adjust_inter(image_inter_id,text_inter_id)
{
	var ht_inter=document.getElementById(image_inter_id).offsetHeight;
	if(ht_inter < 50) {
		ht_inter = 50;
		document.getElementById(image_inter_id).className=document.getElementById(image_inter_id).className + " continue";
		document.getElementById(text_inter_id).className=document.getElementById(text_inter_id).className + " bio_width";
	}
	document.getElementById(text_inter_id).style.height=ht_inter+"px";
	
}

/* Function to display featured events
*/
function display_featuredevents(event_name,headlinelink)
{	
	document.write('<li><a href="'+headlinelink+'">'+event_name+'</a></li>');
}

/**
*	Function to display the summary of headlines and leadlines
*	@author : Arathi P
*/

function display_newssummary_intermediateArchive(headLineNum,headline,leadlines,lastUpdated,imgFileName,headlineHyperlink,Goto,wireName,articleItem,leadlinecharacters,res_name,AOINumber,Listall,newsImagePath)
{		
		var ht_inter=0;
		var leadlinesno=leadlines.length;
		var imgFilePath='';
		var image_inter_id= "image_inter"+articleItem+AOINumber;
		var text_inter_id= "text_inter"+articleItem+AOINumber;
		var image_inter_last_id="image_inter_last"+articleItem+AOINumber;
		var text_inter_last_id="text_inter_last"+articleItem+AOINumber;

		if(imgFileName!='null' && imgFileName!=''){
		imgFilePath=newsImagePath+"/news/"+wireName+"/"+imgFileName;
			if ((UserLocale == 'nl_BE' || UserLocale == 'fr_BE') && (wireName == 'pressbanking_pracmanage_fr' || wireName == 'pressbanking_healthpolitics_fr' || wireName == 'pressbanking_localnews_fr' || wireName == 'pressbanking_finance_fr' || wireName == 'pressbanking_sports_fr' || wireName == 'pressbanking_entertainment_fr' || wireName == 'mediargus_healthpolitics_nl' || wireName == 'mediargus_localnews_nl' || wireName == 'mediargus_finance_nl' || wireName == 'mediargus_sports_nl' || wireName == 'mediargus_entertainment_nl' || wireName == 'mediargus_pracmanage_nl')){
					imgFilePath = newsImagePath+"/"+UserLocale+"/"+wireName+'/'+imgFileName;
			}
		}
		if(headLineNum!=1){
			if(imgFilePath!=''){
			document.write('<div>');
			document.write('<div id="image_inter_test'+articleItem+AOINumber+'">');
			document.write('<a href="'+headlineHyperlink+'"><img id="image_inter'+articleItem+AOINumber+'" src="'+imgFilePath+'" class="image_width img_left" border="0" alt=""  hspace="0" vspace="0" onload="adjust_interArchive(\''+image_inter_id+'\',\''+text_inter_id+'\')"/></a>');
			document.write('</div>');
			if(leadlinesno > parseInt(leadlinecharacters)){
				var max_len=eval(parseInt(leadlinecharacters)+leadlines.substring(parseInt(leadlinecharacters)).indexOf(' ') );
				leadlines = leadlines.substring(0,max_len);
			}
			document.write('<div id="text_inter'+articleItem+AOINumber+'" >');
			if(leadlines!='' & leadlinesno> parseInt(leadlinecharacters))
				leadlines=leadlines+"...";
			}
			else{
			document.write('<div id="text_inter'+articleItem+AOINumber+'">');
			document.write('<div id="image_inter_test'+articleItem+AOINumber+'">');
			document.write('</div>');
			if(leadlinesno > (parseInt(leadlinecharacters)+70)){
				var max_len=eval((parseInt(leadlinecharacters)+70)+leadlines.substring(parseInt(leadlinecharacters)+70).indexOf(' ') );
				leadlines = leadlines.substring(0,max_len);
			}
			if(leadlines!='' & leadlinesno> (parseInt(leadlinecharacters)+70))
				leadlines=leadlines+"...";
			}		
			document.write('<a href="'+headlineHyperlink+'" class="sub_head">'+headline+'</a>');
			document.write('<span class="text_small date_pad_5">'+lastUpdated+'</span>');
			document.write('<p><span>'+leadlines+'</span>');
			document.write('<span><a href="'+headlineHyperlink+'"><nobr> '+Goto+'</nobr></a></span></p>');	
			if(imgFilePath!=''){
			document.write('</div>');
			ht_inter=document.getElementById("image_inter"+articleItem+AOINumber).offsetHeight;
			document.getElementById("text_inter"+articleItem+AOINumber).style.height=ht_inter+"px";
			}
			document.write('</div>');	
			if(headLineNum!=1)
				{
				var x=document.getElementById("image_inter_test"+articleItem+AOINumber).innerHTML;
				if(x=='')
					{
						document.getElementById("text_inter"+articleItem+AOINumber).style.padding='17px 0px 0px 0px';
						document.getElementById("text_inter"+articleItem+AOINumber).style.margin='0px 0px -2px 0px';
					}else{
						document.getElementById("text_inter"+articleItem+AOINumber).style.padding='20px 0px 0px 0px';
					}
				}



		}else{
			document.write('<div id="outer_inter">');
			if(imgFilePath!='')	
			{
				document.write('<div>');
				document.write('<a href="'+headlineHyperlink+'"><img id="image_inter_last'+articleItem+AOINumber+'" src="'+imgFilePath+'" class="image_width img_left" border="0" alt=""  hspace="0" vspace="0" onload="adjust_interArchive(\''+image_inter_last_id+'\',\''+text_inter_last_id+'\')" /></a>');
				document.write('</div>');
				if(leadlinesno > parseInt(leadlinecharacters)){
					var max_len=eval(parseInt(leadlinecharacters)+leadlines.substring(parseInt(leadlinecharacters)).indexOf(' ') );
					leadlines = leadlines.substring(0,max_len);
				}
				if(leadlines!='' & leadlinesno> parseInt(leadlinecharacters))
					leadlines=leadlines+"...";
			}else{
				if(leadlinesno > (parseInt(leadlinecharacters)+70)){
					var max_len=eval((parseInt(leadlinecharacters)+70)+leadlines.substring(parseInt(leadlinecharacters)+70).indexOf(' ') );
					leadlines = leadlines.substring(0,max_len);
				}
				if(leadlines!='' & leadlinesno> (parseInt(leadlinecharacters)+70))
					leadlines=leadlines+"...";
			}
			
			document.write('<div id="text_inter_last'+articleItem+AOINumber+'">');
			document.write('<a href="'+headlineHyperlink+'" class="sub_head">'+headline+'</a>');
			document.write('<span class="text_small date_pad_5">'+lastUpdated+'</span>');
			document.write('<p><span>'+leadlines+'</span>');
			document.write('<span><a href="'+headlineHyperlink+'"><nobr> '+Goto+'</nobr></a></span></p>');	

			document.write('</div>');
			if(imgFilePath!='')
			{
				ht_inter=document.getElementById("image_inter_last"+articleItem+AOINumber).offsetHeight;
				document.getElementById("text_inter_last"+articleItem+AOINumber).style.height=ht_inter+"px";
				document.getElementById("image_inter_last"+articleItem+AOINumber).style.margin='0px 14px 0px 0px';
				document.getElementById("outer_inter").style.margin='3px 0px 0px 0px';
				document.getElementById("text_inter_last"+articleItem+AOINumber).style.margin='0px 0px 0px 0px';
			}else{
				document.getElementById("outer_inter").style.margin='0px 0px 0px 0px';
				document.getElementById("text_inter_last"+articleItem+AOINumber).style.margin='0px 0px -2px 0px';
			}
			document.write('</div>');
		}
		
}

function adjust_interArchive(image_inter_id,text_inter_id)
{
	var ht_inter=document.getElementById(image_inter_id).offsetHeight;
	document.getElementById(text_inter_id).style.height=ht_inter+"px";
	
}

function display_PagesArchive(total_records,Page,of,no_of_links,no_of_browsepages,GRPid,start_page,grp_name,targetURL)
	{var no_of_pages,link_var=0,current_page=1;
		stringForPageNavi="";
		var noofLinks = no_of_links;
		link_var= parseInt(total_records/noofLinks);
		no_of_pages = ((total_records%noofLinks)==0)? link_var : (link_var+1);

		current_page=parseInt((start_page/noofLinks)+1);
		
		//To set the start_page and end_page
		if((current_page <= 3)){ 
			start_page = 1;
			if(no_of_pages < (no_of_browsepages)){
				end_page = no_of_pages;
			}else{
				end_page = (no_of_browsepages);
			}
		}else if(current_page > (no_of_pages-2))
			{//Check if the page that is displayed is one of the last two pages.
					if(no_of_pages < (no_of_browsepages))
					{
						start_page=1;
					}else{
						start_page = (no_of_pages+1)-(no_of_browsepages);
					}//start page is set such that only five pages are displayed at a time
				end_page = no_of_pages;
			}else{
				start_page = current_page-2;
				end_page = current_page+2;
			}
		stringForPageNavi=stringForPageNavi + '<div>'+Page+' '+current_page+' '+of+' '+no_of_pages;
		stringForPageNavi=stringForPageNavi + '<span class="marg_left_100">';
		if(no_of_pages!=1){
			if(current_page!=1 ){
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?GRPid='+GRPid+'&GRPName='+grp_name+'&startpos='+0+'" > &lt;&lt; </a><span class="pad_5"> |</span><span class="pad_5">';
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?GRPid='+GRPid+'&GRPName='+grp_name+'&startpos='+(current_page-2)*(no_of_links)+'">&lt; </a></span><span class="pad_5"> |</span><span class="pad_5">';
			}
			for(var i=start_page; i<=(end_page); i++){
				if(i!=current_page){
				stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?GRPid='+GRPid+'&GRPName='+grp_name+'&startpos='+(i-1)*(no_of_links)+'">'+i+'</a></span><span class="pad_5"> |</span><span class="pad_5">';
				}else{
					if(i==end_page)
					stringForPageNavi=stringForPageNavi+'<span class="sub_head font-color">' + i +'</span>';
					else
					stringForPageNavi=stringForPageNavi+'<span class="sub_head font-color">' + i + '</span></span><span class="pad_5"> |</span><span class="pad_5">';
				}
			}
			
		if( current_page!= no_of_pages){
			stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?GRPid='+GRPid+'&GRPName='+grp_name+'&startpos='+(current_page)*(no_of_links)+'">&gt;</a></span><span class="pad_5"> |</span><span class="pad_5">';
			stringForPageNavi=stringForPageNavi + '<a href="'+targetURL+'?GRPid='+GRPid+'&GRPName='+grp_name+'&startpos='+(no_of_pages-1)*(no_of_links)+'" > &gt;&gt; </a></span>';
		}
	}
	stringForPageNavi=stringForPageNavi + '</span>';
	stringForPageNavi=stringForPageNavi + '</div>';
	return stringForPageNavi;
}


function display_morenewsTR(headlinenum,resname,wirename,Groupid,headline,leadlines,last_update,filename,headlinelink,article_item_id,provider,Goto,Listall,minleadlines,newsImagePath,jumppagetitle)
		{
			var len=leadlines.length;
			var articleImagePath = newsImagePath+"/news/"+wirename+"/"+filename;
			
			document.write('<div  class="more">');

			if(filename.trim()!='null' && filename.trim()!="")
				{		
					 var imageId = "image_"+article_item_id;
					 var divId	=	"div_"+article_item_id;
					 var textdiv = "textdiv_"+article_item_id;
					 if(len > minleadlines)
					 {
						var max_len=eval((parseInt(minleadlines)+65)+leadlines.substring(parseInt(minleadlines)+65).indexOf(' '));
						leadlines = leadlines.substring(0,max_len)+'...';
					 }
					 document.write('<div id="morenews_'+article_item_id+'">');
					 document.write("<a href="+headlinelink+"><IMG style='display:none' class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' ></a>");
					 document.write('</div >');

				   	 document.write('<div id="'+textdiv+'" class="content_padding pad_left_right"  >');
					 document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
					 document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');

					 document.write('<div class="pad_adj_10"><span class="text">'+leadlines+'</span>');
					 document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');
				
					 if(Groupid == '2' || Groupid == '8'){
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/tr_TR_World_AllInter%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D8%26GRPName2%3DDünya">'+Listall+'</a></div>');
					 }else if (Groupid == '4' || Groupid == '9'){
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/tr_TR_Sports_AllInter%3FGRPid%3D4%26GRPName%3DFootball Special%26GRPid2%3D9%26GRPName2%3DSpor">'+Listall+'</a></div>');
					 }else {
						document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/News_Intermediate_More%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
						}
					
						document.write('</div></div>');
					
					 document.getElementById("morenews_"+article_item_id).innerHTML =  "<a href="+headlinelink+"><IMG   class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' onload=\"styleadjustTR('"+imageId+"','"+divId+"','"+textdiv+"')\"></a>";
				}
			else 
				{	
					  if(len > minleadlines)
						 {
							var max_len=eval((parseInt(minleadlines)+60)+leadlines.substring(parseInt(minleadlines)+60).indexOf(' ') );
							leadlines = leadlines.substring(0,max_len)+'...';
						 }
				
				document.write('<div class="content_padding pad_left_right"  >');
				document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
				document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');
				
				document.write('<div class="pad_adj_10"><span class="text ">'+leadlines+'</span>');
				document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');
				
 				if(Groupid == '2' || Groupid == '8'){
					document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/tr_TR_World_AllInter%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D8%26GRPName2%3DDünya">'+Listall+'</a></div>');
				 }else if (Groupid == '4' || Groupid == '9'){
					document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/tr_TR_Sports_AllInter%3FGRPid%3D4%26GRPName%3DFootball Special%26GRPid2%3D9%26GRPName2%3DSpor">'+Listall+'</a></div>');
				 }else {
					document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/News_Intermediate_More%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
					}
				document.write('</div></div>');
				}
}


function styleadjustTR(imageId,divId,textdiv)
{

	if(document.getElementById(imageId).width > '108')
	{
	 document.getElementById(imageId).style.margin='0px 0px 7px 0px';
	 document.getElementById(imageId).style.padding='0px 0px 0px 0px';
	}
	else 
	{
	 document.getElementById(imageId).width='70';
	 document.getElementById(imageId).style.margin='10px 10px 6px 10px';
 	 document.getElementById(divId).style.padding='0px 0px 2px 0px';
	 var div = document.getElementById(textdiv).offsetHeight;
	 var ht = document.getElementById(imageId).offsetHeight+25;
	 var diff=ht-div;
	 if(ht > div)
	 {
		document.getElementById(textdiv).style.marginBottom=diff+"px";
	 }
	}
}

/**
*	Function to display the headlines for RSS data
*	
*/
function Display_RSSHeadlines(headlinenum,headline,url_link,pubdate,categoryName,JumpPageTitle) {
	if(headlinenum == 1){
		var last_updated_day;
		var last_updated_time;
		var date;
		var month;
		var year;}
		if(categoryName=='Expressen'){
			last_updated_day = pubdate.substring(0,11);
			last_updated_time = pubdate.substring(18,11);
			date=pubdate.substring(8,10);
			month=pubdate.substring(5,7);
			year=pubdate.substring(2,4);
		}else {
			if(categoryName=='Aftonbladet'){
				last_updated_day = pubdate.substring(0,11);
				date = pubdate.substring((pubdate.indexOf(" ")+1),(pubdate.indexOf(" ")+3));
				month = pubdate.substring((pubdate.indexOf(" ")+3),(pubdate.indexOf(" ")+6));
				year = pubdate.substring((pubdate.indexOf(" ")+9),(pubdate.indexOf(" ")+11));
				last_updated_time = pubdate.substring((pubdate.indexOf(" ")+12),(pubdate.indexOf(" ")+17));
				/*last_updated_time = pubdate.substring(15,21);
				date=pubdate.substring(4,6);
				month=pubdate.substring(7,10);
				year=pubdate.substring(13,15);*/
			}else if(categoryName=='Dagens_Medicin' || categoryName=='Dagens_Medicin_Index'){
				last_updated_day = pubdate.substring(0,11);
				last_updated_time = pubdate.substring(16,22);
				date=pubdate.substring(5,7);
				month=pubdate.substring(8,11);
				year=pubdate.substring(14,16);
			}
			if(month=="Jan")month="01";
			else if(month=="Feb") month="02";
			else if(month=="Mar") month="03";
			else if(month=="Apr") month="04";
			else if(month=="May") month="05";
			else if(month=="Jun") month="06";
			else if(month=="Jul") month="07";
			else if(month=="Aug") month="08";
			else if(month=="Sep") month="09";
			else if(month=="Oct") month="10";
			else if(month=="Nov") month="11";
			else if(month=="Dec") month="12";

		}

			if(previousDate != last_updated_day)
			{
					previousDate=last_updated_day;
					document.write('</ul>');
					document.write('<div class="text_small pad_adj_head_10">'+date+'/'+month+'/'+year+'</div>');
					document.write('<ul>');
			}
			if(PageName=='Home' || PageName== 'Services' || PageName== 'News')
			{
				 if(Country!="SE"){
                                       document.write('<li ><a target="_blank" href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+JumpPageTitle+'&amp;toURL='+url_link+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
                               }else{
                                       document.write('<li ><a target="_blank" href="/PortalTemplates/linkToExternalContent.jsp?WT.sitename=dagens_medicin&amp;WT.destination=medical_news&amp;toURL='+url_link+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
                               }
			}else{
				if(Country!="SE"){
                                       document.write('<li ><a target="_blank" href="'+url_link+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
                               }else{
                                       document.write('<li ><a target="_blank" href="/PortalTemplates/linkToExternalContent.jsp?WT.sitename=dagens_medicin&amp;WT.destination=medical_news&amp;toURL='+url_link+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
                               }
			}
	}

/**
*	Function to display the More News
*	
*/
function display_morenewsSE(headlinenum,resname,wirename,Groupid,headline,leadlines,last_update,filename,headlinelink,article_item_id,provider,Goto,Listall,minleadlines,newsImagePath,jumppagetitle,strLocale)
		{
			var len=leadlines.length;
			var articleImagePath
			if(provider == 'TT'){
				articleImagePath = newsImagePath+"/sv_SE/"+wirename+"/"+filename;
			}else{
				articleImagePath = newsImagePath+"/news/"+wirename+"/"+filename;
			}
			var headlinecheckSE = new Array();
			var image_headline_SE = new Image();
            image_headline_SE.src = articleImagePath;
			var headline_image_widthSE = image_headline_SE.width;
			if(headline_image_widthSE <= '108')
			{
				headlinecheckSE = CheckHeadlineLength(headline);
			}
			document.write('<div  class="more">');
			if(filename.trim()!='null' && filename.trim()!="")
				{		
					 var imageId = "image_"+article_item_id;
					 var divId	=	"div_"+article_item_id;
					 var textdiv = "textdiv_"+article_item_id;
					 if(len > minleadlines)
					 {
						leadlines = leadlines.substring(0,parseInt(minleadlines)+65)+'...';
					 }
					 if(headlinecheckSE[0])
					 {
						document.write('<div style="padding:6px 2px 0px 8px;"><a class="head" href="'+headlinelink+'">'+headlinecheckSE[1]+'</a></div>');
						document.write('<div id="morenews_'+article_item_id+'"></div>');
						document.write("<a href="+headlinelink+"><IMG style='display:none' class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' ></a>");
						//document.write('</div >');
				   		document.write('<div id="'+textdiv+'" class="content_padding pad_left_right"  >');
						document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
						document.write('<div class="pad_adj_10"><span class="text">'+leadlines+'</span>');
						document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');	
					 }else{
					 document.write('<div id="morenews_'+article_item_id+'">');
					 document.write("<a href="+headlinelink+"><IMG style='display:none' class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' ></a>");
					 document.write('</div >');

				   	 document.write('<div id="'+textdiv+'" class="content_padding pad_left_right"  >');
					 document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
					 document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');

					 document.write('<div class="pad_adj_10"><span class="text">'+leadlines+'</span>');
					 document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');	
					 }
				if(Groupid == "39")
				{
					document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Local'+'%3FGRPid2%3D'+Groupid+'%26GRPName2%3D'+resname+'">'+Listall+'</a></div>');
				}
				else if (Groupid == "40")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D40%26GRPName2%3DInternationellt">'+Listall+'</a></div>');
				}
				else if(Groupid == "41")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D3%26GRPName%3DFinancial%26GRPid2%3D41%26GRPName2%3DEkonomi">'+Listall+'</a></div>');
				}
				else if (Groupid == "38")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D38%26GRPName2%3DSport">'+Listall+'</a></div>');
				}
				else
				{
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/News_Intermediate_More%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
				}				
					 
					 document.write('</div></div>');
					
					 document.getElementById("morenews_"+article_item_id).innerHTML =  "<a href="+headlinelink+"><IMG   class='continue img_font'  SRC='"+articleImagePath+"' id='"+imageId+"'  border='0' onload=\"styleadjust('"+imageId+"','"+divId+"','"+textdiv+"')\"></a>";
				}
			else 
				{	
					  if(len > minleadlines)
						 {
							leadlines = leadlines.substring(0,parseInt(minleadlines)+60)+'...';
						 }
				
				document.write('<div class="content_padding pad_left_right"  >');
				document.write('<div class="text_small  pad_adj_6">'+last_update+' ('+provider+')</div>');
				document.write('<div id="'+divId+'" class="pad_adj_head_10" ><a class="head" href="'+headlinelink+'">'+headline+'</a></div>');
				
				document.write('<div class="pad_adj_10"><span class="text ">'+leadlines+'</span>');
				document.write('<span class="text "><a href="'+headlinelink+'"><nobr> '+Goto+'</nobr></a></span></div>');

 				if(Groupid == "39")
				{
					document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Local%3FGRPid2%3D'+Groupid+'%26GRPName2%3D'+resname+'">'+Listall+'</a></div>');
				}
				else if (Groupid == "40")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D2%26GRPName%3DWorld%26GRPid2%3D40%26GRPName2%3DInternationellt">'+Listall+'</a></div>');
				}
				else if(Groupid == "41")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D3%26GRPName%3DFinancial%26GRPid2%3D41%26GRPName2%3DEkonomi">'+Listall+'</a></div>');
				}
				else if (Groupid == "38")
				{
				
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/sv_SE_News_Intermediate%3FGRPid%3D4%26GRPName%3DSports%26GRPid2%3D38%26GRPName2%3DSport">'+Listall+'</a></div>');
				}
				else
				{
				document.write('<div  class="sub_head pad_list" ><a  href="/PortalTemplates/JumpPage.jsp?category='+PageName+'_'+jumppagetitle+'&amp;toURL=/medical_and_more/News_Intermediate_More%3FGRPid%3D'+Groupid+'%26GRPName%3D'+resname+'">'+Listall+'</a></div>');
				}				
				document.write('</div></div>');
				}
}

function styleadjustSE(imageId,divId,textdiv)
{

	if(document.getElementById(imageId).width > '108')
	{
	 document.getElementById(imageId).style.margin='0px 0px 7px 0px';
	 document.getElementById(imageId).style.padding='0px 0px 0px 0px';
	}
	else 
	{
	 document.getElementById(imageId).width='70';
	 document.getElementById(imageId).style.margin='10px 10px 6px 10px';
 	 document.getElementById(divId).style.padding='0px 0px 2px 0px';
	 var div = document.getElementById(textdiv).offsetHeight;
	 var ht = document.getElementById(imageId).offsetHeight+25;
	 var diff=ht-div;
	 if(ht > div)
	 {
		document.getElementById(textdiv).style.marginBottom=diff+"px";
	 }
	}
}

/**
*	Function to replace the strings in RSS Feed
*	
*/
function replaceAll(text, strA, strB) 
{
    while ( text.indexOf(strA) != -1)
    {
        text = text.replace(strA,strB);
    }
    return text;
}

/*Function used to display the RSS Feed Headlines for Israel
 *	author	: Sandeep Nare
 *	version : 1.0
 *	date	: 13/11/2006
 */
function Display_ILHeadlines(headlinenum,headline,url_link,pubdate) {
	var last_updated_day = pubdate.substring(4,16);
	var last_updated_time = pubdate.substring(16,22);
	var Dating =new Array("","","");
	Dating=last_updated_day.split(' ');
	var year=Dating[3].substring(2);
	if(Dating[2]=="Jan")Dating[2]="01";
	else if(Dating[2]=="Feb") Dating[2]="02";
	else if(Dating[2]=="Mar") Dating[2]="03";
	else if(Dating[2]=="Apr") Dating[2]="04";
	else if(Dating[2]=="May") Dating[2]="05";
	else if(Dating[2]=="Jun") Dating[2]="06";
	else if(Dating[2]=="Jul") Dating[2]="07";
	else if(Dating[2]=="Aug") Dating[2]="08";
	else if(Dating[2]=="Sep") Dating[2]="09";
	else if(Dating[2]=="Oct") Dating[2]="10";
	else if(Dating[2]=="Nov") Dating[2]="11";
	else if(Dating[2]=="Dec") Dating[2]="12";
	if(previousDate != last_updated_day){
		previousDate=last_updated_day;
		document.write('</ul>');
		document.write('<div class="text_small pad_adj_head_10">'+Dating[1]+'/'+Dating[2]+'/'+year+'</div>');
		document.write('<ul >');
	}
	if(PageName == "News" || PageName == "Home"){ 
		url_link = escape(url_link);
		url_link = "/PortalTemplates/JumpPage.jsp?category=" + PageName + "_" + jumpPageTitle+"&amp;toURL=" + url_link;
	}
	document.write('<li ><a target="_blank" href="'+url_link+'">'+headline+'</a><span class="text_small date_pad_5">'+last_updated_time+'</span></li>');
}

/*Function used to check the length of the headline displayed so that headline with very long length are moved above the image and headlines with wordlength > 26 are split by - and put on the next line
*	author : Anju Ramachandran
*	version : 1.0.0
*	date		:	7/5/2007
*/

function CheckHeadlineLength(headline)
{
	var strHeadline = new Array();
	var headlinesplit = new Array();
	var formattedHeadline ="";
    var LongLengthHeadline = "";
	var afterHeadline = "";
	headlinesplit = headline.split(" ");
    var z=0;
	var u=0;
	for(z=0;z<headlinesplit.length;z++)
	{ 
		if (headlinesplit[z].length>13)
		{  
			LongLengthHeadline = "yes";		
			if(headlinesplit[z].length>26)
			   {
				var x = headlinesplit[z].substring(0,20);
				var y = headlinesplit[z].substring(20);	
				for(u=z+1;u<headlinesplit.length;u++)
			{								
				afterHeadline = afterHeadline+" "+headlinesplit[u];
			}
				
				formattedHeadline = formattedHeadline+ x + "-<br/>"+ y;
				//alert(formattedHeadline);
				   
				}
			}else{
				formattedHeadline = headline;
			     }			
		}	
				
	if(LongLengthHeadline == "yes")
	{
		    strHeadline[0] = true;
	        strHeadline[1] = formattedHeadline;
	}
		else
	{
		   strHeadline[0] = false;
           strHeadline[1] = headline;
	}
	
	return strHeadline;
}

