﻿// JScript File

//Dynamically displaying the sub sub menu list catProduct
    function IsVisible(IdNumber,Status)
    {   
        //alert('Hi');        
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;hdnCategoryStatus
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnCategoryCount").value;
        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnCategoryStatus").value;
	    var subCatid='subCategory'+subCategoryStatus;
	    //alert(subCategoryCount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subCategory'+a1[count];
            //alert(UlId);
            //alert(subsubid); 
            if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	    

        if(Status)
        {
            //alert('Hi');
            var ULid='subCategory'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }
        //ProductVisible(0,false);
        //SubCatProductVisible(0,false);        
        //SubSubCatVisible(0,false);
        //IsProductVisible(0,false);        
    }
        
    //Visible and NotVisible for the Category Product
    function IsProductVisible(IdNumber,Status)
    {   
      // alert('First Product');     
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var productCount=document.getElementById("ucNewLeftCategoryControl_hdnCatProductCount").value;
        var categoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryStatus").value;
	    var subCatid='catProduct'+categoryStatus;
	    //alert(subCategoryCount);
	    
	    var a1 = new Array();
        a1=productCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='catProduct'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	 
        
        if(Status)
        {
            var ULid='catProduct'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }
        //IsVisible(0,false);
        //ProductVisible(0,false);
    } 
    
    
    function IsNotVisible()
    {        
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnCategoryCount").value;
        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnCategoryStatus").value;
	    var subCatid='subCategory'+subCategoryStatus;
	    //alert(subCategoryCount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subCategory'+a1[count];
            //alert(UlId);
            //alert('subCatid ='+subCatid); 
            if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }
        //IsVisible(0,false);
        //ProductVisible(0,false);
        //SubCatProductVisible(0,false);        
        //SubSubCatVisible(0,false);
        IsProductVisible(0,false);        	 
    }   
    //===============================================End of Category Section (Product and SubCategory List)
    
    
    
    
    
    
    //*****************************************************************************************************
    //Start of SubCategory Item and Product
    function SubSubCatVisible(IdNumber,Status)
    {        
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;hdnsubCategoryStatus
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryCount").value;
//        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryStatus").value;
//	    var subCatid='subsubCategory'+subCategoryStatus;
	    //alert('subCategoryCount =='+subCategoryCount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubCategory'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	    

        if(Status)
        {
            var ULid='subsubCategory'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }       
    }
    
    
    //Visible and NotVisible for the Category Product SubSubCatUnVisible
    function SubCatProductVisible(IdNumber,Status)
    {   
        //alert(IdNumber); 
        //alert(Status);     
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;hdnsubCatProductStatus
        var subCatCount=document.getElementById("ucNewLeftCategoryControl_hdnsubCatProductCount").value;
        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCatProductStatus").value;
	    var subCatid='subcatProduct'+subCategoryStatus;
	    //alert(subCatid);
	    //alert(subCatCount); 
	    var a1 = new Array();
        a1=subCatCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subcatProduct'+a1[count];
            //alert(UlId);
            //alert(subsubid); 
            if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	 
        
        //alert('Status ='+Status);
        //alert('IdNumber ='+IdNumber);
        if(Status)
        {
            var ULid='subcatProduct'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }
        //IsVisible(0,false); // hiding the Main Category Item
        //IsProductVisible(0,false);// hiding the Main Category Products 
        //ProductVisible(0,false); // hiding the Last level of Products 
    } 
    
    
    
    function SubSubCatUnVisible()
    {       
        //alert('SubSubCatUnVisible'); 
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryCount").value;
//        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryStatus").value;
//	    var subCatid='subsubCategory'+subCategoryStatus;
	    //alert(submenucount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubCategory'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }
        //SubSubCatVisible(0,false);
        SubCatProductVisible(0,false);
//        ProductVisible(0,false);        	 
    }
     //===============================================End of SubCategory Section (Product and SubCategory List)
    
    
    
    
    
    //*****************************************************************************************************
    //Start of SubCategory Item and Product
    function SubSubSubCatVisible(IdNumber,Status)
    {        
        var count=0;
        //alert(IdNumber);alert(Status);
        //var submenucount=document.getElementById("hdnsubmenucount").value;hdnsubCategoryStatus
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnsubsubCategoryCount").value;
	    //alert(subCategoryCount);
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubsubCategory'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	    

        if(Status)
        {
            //alert('Under If');
            var ULid='subsubsubCategory'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }       
    }
    
    
    //Visible and NotVisible for the Category Product SubSubCatUnVisible
    function SubSubSubCatProductVisible(IdNumber,Status)
    {   
        //alert('Second Product (Sub Category)');     
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;hdnsubCatProductStatus
        var subCatCount=document.getElementById("ucNewLeftCategoryControl_hdnsubCatProductCount").value;
        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCatProductStatus").value;
	    var subCatid='subcatProduct'+subCategoryStatus;
	    //alert(subCatid);
	    
	    var a1 = new Array();
        a1=subCatCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subcatProduct'+a1[count];
            //alert(UlId);
            //alert(subsubid); 
            if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }	 
        
        //alert('Status ='+Status);
        //alert('IdNumber ='+IdNumber);
        if(Status)
        {
            var ULid='subcatProduct'+IdNumber;        
            document.getElementById(ULid).style.display="block";
        }        
    } 
    
    
    function SubSubSubCatUnVisible()
    {       
        //alert('SubSubCatUnVisible'); 
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var subCategoryCount=document.getElementById("ucNewLeftCategoryControl_hdnsubsubCategoryCount").value;
//        var subCategoryStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubCategoryStatus").value;
//	    var subCatid='subsubCategory'+subCategoryStatus;
	    //alert(submenucount);
	    
	    var a1 = new Array();
        a1=subCategoryCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubsubCategory'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=subCatid)           
                document.getElementById(UlId).style.display="none";
        }
        //SubSubCatVisible(0,false);
        SubCatProductVisible(0,false);
//        ProductVisible(0,false);        	 
    }
     //===============================================End of SubCategory Section (Product and SubCategory List)
     
     
    
    
    //=================================================================
    //================================================================
    function ProductVisible(IdNumber,Status)
    {        
        var count=0;
        //var submenucount=document.getElementById("hdnsubmenucount").value;
        var subsubCatCount=document.getElementById("ucNewLeftCategoryControl_hdnsubsubCatProductCount").value;
//        var subsubCatProductStatus=document.getElementById("ucNewLeftCategoryControl_hdnsubsubCatProductStatus").value;
//	    var statusid='subsubproduct'+subsubCatProductStatus;
	    //alert('subCategoryCount =='+subCategoryCount);
	    
	    var a1 = new Array();
        a1=subsubCatCount.split(",");
        //alert(a1.length);  
        for(count=0;count<a1.length;count++)
        {
            var UlId='subsubproduct'+a1[count];
            //alert(divid);
            //alert(subsubid); 
            //if(UlId!=statusid)           
                document.getElementById(UlId).style.display="none";
        }        
        if(Status)
        {
            var ULid='subsubproduct'+IdNumber;        
            document.getElementById(ULid).style.display="block";       
        }
    }   
    
    function CheckEmail_CallBack(Response)
    {

    }
    function IsMenuClick()
    {
        alert('Menu Item');//hdnMenuClicked
        document.getElementById("ucNewLeftCategoryControl_hdnMenuClicked").value='true';
        //alert(document.getElementById("ucNewLeftCategoryControl_hdnMenuClicked").value);
        //App_Controls_LeftCategoryControl.checkSession('true',CheckEmail_CallBack);
        return true;
    } 
    
    
    



