$(document).ready(function(){
   //comment next 2 in production
   $("#pxd").text("screen size w"+$(window).width());
   //$("#pxe").text($(document).width());
   // next 2  sentences to be left uncommented adjust 300 as delta 
   wi=parseInt($(document).width() ) -315;
   wi =wi +"px";
   //comment next 2 in production
   $("#pxf").text("the div should be and now I am setting it " + wi);
   //$("#indexProductList").css("color","red");
   //leave this 
   $("#indexProductList").css("width",wi);
 
   $("li").click(function(event){
     	var code = $(this).attr('id');
     	var toggle='N'              ;
        var ypo=0;         
        var baseid=$(this).attr('id');
// dim previous lite  sons 
 	$("li").each(function (i) {
        	if ($(this).attr("son") =='Y' && $(this).attr("name") != baseid && $(this).css("display") =='block')
                {    
                	$(this).hide();	
		}

        });
// end 
        $("li").each(function (i) {
                var name = $(this).attr("name");
                var id1 =   $(this).attr("id");
     		if (code == name ) 
	{
                        var ybase =$(this).attr("yxbasecnt");

       			$(this).css('position','absolute');
   		     	$(this).toggle("slow");
                        //ybase =$(this).attr("yxbasecnt") ;
                        //alert('debug sie '+ybase);
             		toggle ='Y';          
// lateral pos 
                                             
     			$(this).css('right','292px');
     			$(this).css('z-index','8');
                        if ( ybase == '75' ) ybase ='150';
                        if ( ybase == '100' ) ybase ='174';
                        if ( ybase == '125' ) ybase ='200';

                        if ( isNaN($(this).css('top')) ) {$(this).css('top',ybase+'px') }   
                        //var ypos=  parseInt($(this).css('top')) +parseInt(ypo);
                        //alert(ypos);
                        //if ($(this).attr("yxbasecnt") == '0')
                        //{
                        //var yposputa=ypos +'px';  
                        //alert(ypos);
                        //$(this).css('top',yposputa);
                        //var position = $(this).position();
                         ybase =ybase +14;
                   	//$(this).attr("yxbasecnt",ypos); 
                        //ypo=ypo+24;
                        //}
                        //else 
                        //{
                        //        tmpx = $(this).attr("yxbasecnt");
			//	$(this).css('top',tmpx);

                        //}

                        
     		}
                else {ypo =0}     
     		if (toggle =='Y') event.preventDefault();
        });
   });

 });


