function toggleNext(template,total,linktemplate)
			{
			    for (var i = 1; i <=total ; i++)
			    {
			        var section = document.getElementById(template + i.toString());
			        var link = document.getElementById(linktemplate + i.toString());
			        if (section!=null && (section.style.display =='block'||section.style.display ==''))
			            {
			                if ( i < total)
			                {
			                    var nextindex= i +1;
			                    var nextsection = document.getElementById(template + nextindex.toString());
			                    var nextlink = document.getElementById(linktemplate + nextindex.toString());
			                    if (nextsection!=null)
			                    {
			                        nextsection.style.display='block';
			                        section.style.display='none';
			                        if (link!=null)
			                            link.className = '';
			                        if (nextlink !=null)
			                            nextlink.className = 'on';
			                        break;
			                     }
			                        
			                }
			            }
			    }
			}
			function togglePrevious(template,total,linktemplate)
			{
			    for (var i = 1; i <=total ; i++)
			    {
			        var section = document.getElementById(template + i.toString());
			        var link = document.getElementById(linktemplate + i.toString());
			        if (section!=null && (section.style.display =='block'||section.style.display ==''))
			            {
			                if ( i >1)
			                {
			                    var previndex= i -1;
			                    var prevsection = document.getElementById(template + previndex.toString());
			                    var prevLink = document.getElementById(linktemplate + previndex.toString());
			                    if (prevsection!=null)
			                    {
			                        prevsection.style.display='block';
			                        section.style.display='none';
			                        if (link!=null)
			                            link.className ='';
			                        if (prevLink!=null)
			                            prevLink.className='on';
			                        break;
			                     }
			                        
			                }
			            }
			    }
			}

