﻿//var RootUrl='http://localhost:1697/TechCode';
var RootUrl='http://www.merithub.com';

function trimString(str) 
	{
		str = this != window? this : str;
		str= str.replace(/^\s+/g, '').replace(/\s+$/g, '');
		return str.replace(/\s+/g,'-');
	}
	
	
	
	function AddPost()
	{
	  
	    
	        location.href = RootUrl+'/action/'+"addpost.aspx";
	        return false;   
	       
	        }
	        
                    
	    


function SearchText()
	{
	  
	    var txtName = document.getElementById("keywords");
	   	        var spchar=txtName.value;
	   	       
			if(spchar!="")
			{
			document.forms[0].action= RootUrl+'/faqs/'+escape(trimString(txtName.value))+"-question-answers.aspx";
	        location.href = RootUrl+'/faqs/'+escape(trimString(txtName.value))+"-question-answers.aspx";
	        
	       // document.forms[0].action= RootUrl+'/articles/'+escape(trimString(txtName.value))+".aspx";
	       // location.href = RootUrl+'/articles/'+escape(trimString(txtName.value))+".aspx";
	       
	        }
	        
          return false;             
	    
	}
	
	
	
function SBKeyDown(e)
{
 if(e==null)
 e= window.event;
      if(e.which || e.keyCode)
    {
       var TargetControl=e.target || e.srcElement;
       
      
        if ((e.which == 13) || (e.keyCode == 13)) 
        {
        Page_ValidationActive=false;
          SearchText();
          //alert(e.which);
           e.returnValue=false;
           return false;
          
          
            
        }
    }
    
     return false;
    
}



	
