	/* Author: Thomas Fung */
	/* Function: Initial Implementation*/
	$(document).ready(function() {

	    var filename = window.location.href.substr(window.location.href.lastIndexOf("/") + 1);
	    filename = filename.toUpperCase();
        
        if ($("div.CategoryHeader").length > 0) {
            $("div.CategoryHeader").first().css('display', 'block');
            
            $("div.left_menu li").each(function (x) {
                if ($(this).attr('description') == $("#CategoryID").html())
                {
                    $(this).addClass('selected')
                }                                
            })
        }
        
        if ($("div#questionnaireDescription").length == 1) {
            $("div#MainBody").css('padding-left', '30px')
            $("div#MainBody td.text").css('text-align', 'left')

			$("div#MainBody").css('width','816px');
        }
		
	    if (filename.indexOf("ORDERS.ASPX") > -1) {		
						
	    }

	    if (filename.indexOf("LOGIN.ASPX") > -1) {

	    }
		
	    if (filename.indexOf("ORDERCOMPLETE.ASPX") > -1) {

	    }
					    
	    if (filename.indexOf("PRODSEARCH.ASPX") > -1)
	    {			

	    }	    	
                
        if ($("#Search").length == 1) {
            $("input#SearchInput").click(function () {            
                    $("input#SearchInput").val('');
                }
            )
            
            $("img#SearchIcon").click(function() {
                prodSearchButton();
            })
            
            $("input#SearchInput").keypress(function(event) {
                if (event.which == 13) {
                    event.preventDefault();
                    prodSearchButton();
                }
            });
        }
	});
    
    function prodSearchButton() {        
        var searchvalue = $("input#SearchInput").val();
        if (searchvalue != '') {
            window.location.href="/ProductDisplay.aspx?ProductSearch="+escape(searchvalue.replace("&",""))+"&PageProduct=1";        
        }
        
    }	
