﻿    
    //on client click for each sub section called
    function DetailSelect(contentSection){
        document.location.href="detail.aspx?id="+ProductId+"#"+contentSection;
        document.getElementById(frmContent).value = contentSection;
        //(UpdatePanel1, '');
    }
    
	//Sets the initial page content is deep link indicator is specified
	function setInitialContent(){  
	    var url = document.location;
	    var tmp = new String(url);
	    var sections = tmp.split("#");
	    var secName = "summary";//Default
	    if(typeof(sections[1])!="undefined"){
	        var secName=validateContentSection(sections[1]);
	    }
	    document.getElementById(frmContent).value = secName;

	    //alert(document.getElementById(frmContent).value);
	    
	    __doPostBack(UpdatePanel1, '');   
	}
	
	// Called on client start
	function doInitAjax(){
	    setInitialContent();
	}
	
	//Valiate content sections
	function validateContentSection(v){
	   var retVal = "summary";
	    switch (v){
	        case "summary":
	            retVal = "summary";
	        break;
	        case "highlights":
	            retVal = "highlights";
	        break;
	        case "videos":
	            retVal = "videos";
	        break;
	        case "photos":
	            retVal = "photos";
	        break;
	        case "specs":
	            retVal = "specs";
	            break;
	        default:
                retVal = "summary";
	    }
	    return retVal;
	}