    function clickButton(e, buttonid){ 
	    
        var bt = document.getElementById(buttonid); 
        if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                 if (e.keyCode == 13){ 
                       bt.click(); 
                       return false; 
                 } 
            } 
           if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                 if (event.keyCode == 13){ 
                       bt.click(); 
                       return false; 
                 } 
           } 
        }
    }


function setValues(){
    var qs = new Querystring()
    var pagename=qs.get('pagename',0);
    var action=qs.get('action',0);
    //alert(pagename);
    //action=SProducts
    var no = 6;
    if(pagename == "diyexpert"){no = 1;}
    else if(pagename == "Store Location"){no = 4;}
    else if(pagename == "DeliveryReturns"){no = 5;}
    else if(action == "FeedBack"){no = 2;}
    else if(action == "SProducts"){no = 3;}
 
    if (action == "OrderDetails" || action == "chkout" || action == "ShpConfirmed"){
       window.document.getElementById("content_width").style.width = "750px";
    }
    
    //else { no = 0; }
    
    //if ( no !=0 ){
        window.document.getElementById('btn' + no).style.background="#FCC32C url(images/c1.jpg) repeat-x 0px 0px";
        window.document.getElementById('btn' + no).style.color="#ffffff";
        setButonCurve(no);
    //}
	
}
function changeBack(id,backcolor,fcolor){
	window.document.getElementById(id).style.backgroundColor=backcolor;
	window.document.getElementById(id).style.color=fcolor;
}

function setButonCurve(no){
	window.document.getElementById('bl' + no).style.background = "#FCC32C url(images/l1.jpg) no-repeat 0px 0px";
	window.document.getElementById('br' + no).style.background = "#FCC32C url(images/r1.jpg) no-repeat 0px 0px";
}


///////////////////////////////////////////////////////////////////
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = {};
	
	if (qs == null) qs = location.search.substring(1, location.search.length);
	if (qs.length == 0) return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i = 0; i < args.length; i++) {
		var pair = args[i].split('=');
		var name = decodeURIComponent(pair[0]);
		
		var value = (pair.length==2)
			? decodeURIComponent(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

Querystring.prototype.get = function(key, default_) {
	var value = this.params[key];
	return (value != null) ? value : default_;
}

Querystring.prototype.contains = function(key) {
	var value = this.params[key];
	return (value != null);
}
//////////////////////////////////////////////
        function focusonSearch(element)
        {
            var Value=document.getElementById(element).value
                if (Value == 'Ad Name or Ad Reference Number')
                { 
                 document.getElementById(element).value="";
                }
        }


        function focusoutSearch(element)
        {
            var Value=document.getElementById(element).value
                if (Value != '')
                { 
                 
                }
                else
                    document.getElementById(element).value="Ad Name or Ad Reference Number";
        }
        
        
        function tableOnOff(parm){
            if (parm == "1")
            {
                document.getElementById("add_business").style.display = "none";
                document.getElementById("UploadFileTable").style.display = "block";
            }
            if (parm == "0")
            {
                document.getElementById("add_business").style.display = "block";
                document.getElementById("UploadFileTable").style.display = "none";
            }
        }
        
        function ajaxFunction_new(id) {
            var xmlHttp = null;
            try
              {
              // Firefox, Opera 8.0+, Safari
              xmlHttp=new XMLHttpRequest();
              }
            catch (e)
              {
              // Internet Explorer
              try
                {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                }
              catch (e)
                {
                try
                  {
                  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                  }
                catch (e)
                  {
                  alert("Your browser does not support AJAX!");
                  return false;
                  }
                }
              }
              xmlHttp.onreadystatechange=function()
                {
                            if(xmlHttp.readyState==4)
                              {
                                    document.getElementById("ctl00_ContentPlaceHolder1_ctl00_img_save").src = "images/" + (xmlHttp.responseText).substring(20,26) + ".gif";
                              }
                }
                var rand_no = Math.random();
                //alert(rand_no);
                xmlHttp.open("GET","save.aspx?BID="+id+"&r="+rand_no,true);
                xmlHttp.send(null);
            }


    function unsave(id)
    {
        document.getElementById(id).innerHTML="<b>Save</b>";
    }
