
		function SDM_ClassNew(obj, new_style) {
			obj.className=new_style;
		}
		function MM_findObj(n, d) { //v4.0
			var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
				d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
			if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
			if(!x && document.getElementById) x=document.getElementById(n); return x;
		}
		function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
			var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}

		function MM_swapImgRestore() { //v3.0
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		}

		function MM_findObj(n, d) { //v4.01
		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
		}

		function MM_swapImage() { //v3.0
		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
		}

		function MM_displayStatusMsg(msgStr) { //v1.0
		status=msgStr;
		//document.MM_returnValue = true;
		}
		
		function SDM_DefaultStatus(msgStr) {
		window.defaultStatus=msgStr;
		//document.MM_returnValue = true;
		}
		
		function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
		}
		
		function SDM_Email(coded,text,cssclass) //v1.0
		{
			cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890";
			shift=coded.length;
			link="";
			for (i=0; i<coded.length; i++)
			{
				if (cipher.indexOf(coded.charAt(i))==-1)
				{
					ltr=coded.charAt(i);
					link+=(ltr);
				}
				else 
				{     
					ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length;
					link+=(cipher.charAt(ltr));
				}
			}
			
			s="";
			
			if(cssclass=="")
			{
				s="<a href='mailto:" + link + "'>" + text + "</a>";	
			}
			else
			{
				s="<a class='"+cssclass+"' href='mailto:" + link + "'>" + text + "</a>";	
			}			

			return s;
		}
				
	   		function SDM_EmailRedirect(coded,text,coded2,cssclass) //v1.0
		{
			cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890";

//alert('coded : ' + coded +  "   :  " + coded.length);					
			shift=coded.length;
			link="";
			for (i=0; i<coded.length; i++)
			{
				if (cipher.indexOf(coded.charAt(i))==-1)
				{
					ltr=coded.charAt(i);
					link+=(ltr);
				}
				else 
				{     
					ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length;
					link+=(cipher.charAt(ltr));
				}
			}
//alert('link : ' + link);


//alert('coded2 : ' + coded2+  "   :  " + coded2.length);					
			shift=coded2.length;
			link2="";
			for (i=0; i<coded2.length; i++)
			{
				if (cipher.indexOf(coded2.charAt(i))==-1)
				{
					ltr=coded2.charAt(i);
					link2+=(ltr);
				}
				else 
				{     
					ltr = (cipher.indexOf(coded2.charAt(i))-shift+cipher.length) % cipher.length;
					link2+=(cipher.charAt(ltr));
				}
			}
//alert('link2 : ' + link2);
			s="";

			labelText=text;
			
			shift=labelText.length;
			linkText="";
			for (i=0; i<labelText.length; i++)
			{
				if (cipher.indexOf(labelText.charAt(i))==-1)
				{
					ltr=labelText.charAt(i);
					linkText+=(ltr);
				}
				else 
				{     
					ltr = (cipher.indexOf(labelText.charAt(i))-shift+cipher.length) % cipher.length;
					linkText+=(cipher.charAt(ltr));
				}
			}
			s="";


			if(cssclass=="")
			{
				s="<a id='" + link + "' href='mailto:" + link + ";'  onclick='javascript: document.getElementById(\"" + 
					link +"\").setAttribute(\"href\",\"mailto:"+link2+"\"); document.getElementById(\"" + 
					link +"\").setAttribute(\"innerText\",\""+linkText+"\");' onmouseover='javascript: document.getElementById(\"" + 
					link +"\").setAttribute(\"href\",\"mailto:"+link+"\"); document.getElementById(\"" + 
					link +"\").setAttribute(\"innerHTML\",\"" + linkText + "\");'>" + linkText + "</a>";	
			}
			else
			{
				s="<a class='"+cssclass+"' href='mailto:" + link + "'>" + text + "</a>";	
			}			

			return s;
		}		
		
		
		function SDM_EmailTwo(coded) //v1.0
		{
			cipher = "aZbYcXdWeVfUgThSiRjQkPlOmNnMoLpKqJrIsHtGuFvEwDxCyBzA1234567890";
			shift=coded.length;
			link="";
			for (i=0; i<coded.length; i++)
			{
				if (cipher.indexOf(coded.charAt(i))==-1)
				{
					ltr=coded.charAt(i);
					link+=(ltr);
				}
				else 
				{     
					ltr = (cipher.indexOf(coded.charAt(i))-shift+cipher.length) % cipher.length;
					link+=(cipher.charAt(ltr));
				}
			}
			
			return "<a href='mailto:" + link + "'>" + link + "</a>";
		}
		
		function SDM_Focus(objName) //v1.0
		{
		

			var obj = MM_findObj(objName);
			if(obj)
			{
				obj.focus();
				return false;
			}
		}
		
		function SDM_EnterKey(objButtonName) //v1.0
		{
		
			var obj = MM_findObj(objButtonName);
			if(obj)
			{
				if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13))
				{
					obj.click();
					return false;
				} 
				else 
				{
					return true;
				}
			}
			else
			{
				return true;
			}
		}

        //work around to allow a keypress of 'return' to kick off a search in dnntextsuggest - used in  ViewKnowledgeBaseLists.ascx.cs KB version 1.0.5       
        
        //Checks value of  obj.resultCtr and obj.resultCtr.style.display, resultCtr is the drop down list of items set up in dnn.controls.dnntextsuggest.js ..
        //  if obj.resultCtr = 'null' then this means 1st time in pretty much
        //  if obj.resultCtr.style.display = 'none' means items are hidden
        //  if obj.resultCtr.style.display = '' means items are visible
       
		function mykeypressfunction(evt, obj) 
        { 

             if(evt.keyCode == 13)
            {
                if((obj.resultCtr == null))  //hasn't yet had a chance to set up the drop down list before user has hit RETURN so call SDM_EnterKey, called when page has been displayed for the 1st time
                {
                    return !SDM_EnterKey(dnn.dom.getAttr(obj.container, 'keyPressO',''));
                }
               else
               { 
                    if(obj.resultCtr.style.display=='none')  //hasn't yet had a chance to set up the drop down list before user has hit RETURN so call SDM_EnterKey, called when the page has already been displayed, eg it may be the 2nd search the user has done
                    {
                        return !SDM_EnterKey(dnn.dom.getAttr(obj.container, 'keyPressO',''));
                    }
                    else  
                    {
                        if(obj.selIndex > -1)  //drop down list is displayed but user hasn't selected an item  
                        {
                            return true;
                        }
                        else  //drop down list is displayed and user has selected an item
                        {
                            return !SDM_EnterKey(dnn.dom.getAttr(obj.container, 'keyPressO',''));
                        }
                    }
                }
            }    
            else
            {
                return true;
            }
        } 
        
        function trim(stringToTrim) 
        {
	        return stringToTrim.replace(/^\s+|\s+$/g,"");
        }
        
        function ltrim(stringToTrim) 
        {
	        return stringToTrim.replace(/^\s+/,"");
        }
        
        function rtrim(stringToTrim) 
        {
	        return stringToTrim.replace(/\s+$/,"");
        }
        
	    function goLink(sLink)
	    {
		    if(sLink!='') 
			    void window.open(sLink);
	    }
	    
	    function goLinkSame(sLink)
	    {
		    if(sLink!='') 
			    void document.href(sLink);
	    }
	    
	    function maybeGoLink(sLink)
	    {
		    goLink(sLink);
	    }	

        var days = new Array(
          'Sunday','Monday','Tuesday',
          'Wednesday','Thursday','Friday','Saturday');
        var months = new Array(
          'January','February','March','April','May',
          'June','July','August','September','October',
          'November','December');
        
        function fourdigits(number)	
        {
          return (number < 1000) ? number + 1900 : number;
        }
        
	    function getCurrentDay()
	    {
            var now = new Date();
            var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
            
            return days[now.getDay()];
    	
	    }	
    	
	    function getCurrentMonth()
	    {
            var now = new Date();
            var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
            
            return months[now.getMonth()];
    	
	    }
    	
	    function getCurrentYear()
	    {
            var now = new Date();
            var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
            
            return fourdigits(now.getYear());
    	
	    }

        function setActiveStyleSheet(title) {
           var i, a, main;
           for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
             if(a.getAttribute("rel").indexOf("style") != -1
                && a.getAttribute("title")) {
               a.disabled = true;
               if(a.getAttribute("title") == title) a.disabled = false;
             }
           }
        }

        



