
        function LoadData() 
        {
            $("#scriptdiv").load("GetSlideShowImages.aspx");
        }
        var imgIndex = 0;
        var totalImages = 5;
        function slideSwitch(dir) 
        {
            var $active = $('#slideshow IMG.active');

            if ($active.length == 0)
                $active = $('#slideshow IMG:last');
            if (dir == 1) 
            {
                var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');
                imgIndex = $active.next().length ? imgIndex + 1 : 0;
            }
            else 
            {
                var $next = $active.prev().length ? $active.prev() : $('#slideshow IMG:last');
                imgIndex = $active.prev().length ? imgIndex - 1 : totalImages - 1;
            }

            $('#imgDivBig').attr('src', $("#slideshow").children().eq(imgIndex)[0].src.replace('small.JPG', 'png/png.png'));

            $active.addClass('last-active');
            $next.css({ opacity: 0.0 })
            .addClass('active')
            .animate({ opacity: 1.0 }, 1000, function() { $active.removeClass('active last-active'); });
        }
        var imgIndex1 = 0;
       
        //var disablePrevious = 0;
        //var disableNext = 0;
        //var lastIndex = -10;
        function slideSwitch1(dir) 
        {
            // alert(disableNext);
            var $active = $('#divProduct div.active');
            if ($active.length == 0)
                $active = $('#divProduct div:last');
            if (dir == 1) 
            {
              // if(disableNext != 1)
              //{
                  var $next = $active.next().length ? $active.next() : $('#divProduct div:first');
                  imgIndex1 = $active.next().length ? imgIndex1 + 1 : 0;
                  //  disablePrevious = 0;
              // }
            }
            else 
            {
             //   if(disablePrevious != 1)
              //  {
                    var $next = $active.prev().length ? $active.prev() : $('#divProduct div:last');
                    imgIndex1 = $active.prev().length ? imgIndex1 - 1 : totalImages1 - 1;
                 //   disableNext = 0;
               // }
            }
//            if(imgIndex1 >= totalImages1 - 1 )
//            {      
//                disableNext = 1;
//            }
//            if(imgIndex1 <= 0)
//            {
//                disablePrevious = 1;
//            }

            //$('#imgDivBig').attr('src', $("#slideshow").children().eq(imgIndex)[0].src.replace('small', 'big'));
           // if(lastIndex != imgIndex1)
          //  {
                for(var count=0; count<totalImages1; count++)
                {    
                    $('#ProDiv'+count).css('display', 'none'); 
                }          
                $('#ProDiv'+imgIndex1).css('display', 'inline'); 
                $active.addClass('last-active');
                $next.css({ opacity: 0.0 })
                    .addClass('active')
                    .animate({ opacity: 1.0 }, 1000, function() { $active.removeClass('active last-active'); });
         //  }
        //   lastIndex = imgIndex1;
        }
        // ---------------------------------- End Script for Types -----------------------------------------
        var imgIndex2 = 0;
        
       // var disablePrevious2 = 0;
      //  var disableNext2 = 0;
    //    var lastIndex2 = -10;
        function slideSwitch2(dir) 
        {
            // alert(disableNext2);
            var $active = $('#divType div.active');
            if ($active.length == 0)
                $active = $('#divType div:last');
            if (dir == 1) 
            {
               // if(disableNext2 != 1)
               // {
                    var $next = $active.next().length ? $active.next() : $('#divType div:first');
                    imgIndex2 = $active.next().length ? imgIndex2 + 1 : 0;
                //    disablePrevious2 = 0;
              //  }
            }
            else 
            {
              //  if(disablePrevious2 != 1)
               // {
                    var $next = $active.prev().length ? $active.prev() : $('#divType div:last');
                    imgIndex2 = $active.prev().length ? imgIndex2 - 1 : totalImages2 - 1;
               //     disableNext2 = 0;
               // }
            }
//            if(imgIndex2 >= totalImages2 - 1 )
//            {      
//                disableNext2 = 1;
//            }
//            if(imgIndex2 <= 0)
//            {
//                disablePrevious2 = 1;
//            }

            //$('#imgDivBig').attr('src', $("#slideshow").children().eq(imgIndex)[0].src.replace('small', 'big'));
          //  if(lastIndex != imgIndex2)
           // {
                for(var count=0; count<totalImages2; count++)
                {    
                    $('#TypeDiv'+count).css('display', 'none'); 
                }                          
                $('#TypeDiv'+imgIndex2).css('display', 'inline'); 
                $active.addClass('last-active');
                $next.css({ opacity: 0.0 })
                    .addClass('active')
                    .animate({ opacity: 1.0 }, 1000, function() { $active.removeClass('active last-active'); });            
           // }
        //    lastIndex = imgIndex2;
        }
        // ---------------------------------- End Script for Types -----------------------------------------
        function ShowModalGeneralizedCaller() 
        {
            var imgPath = 'imgDiv' + 1;
            ShowModalGeneralized(imgPath);
        }
        function HideModalGeneralizedCaller() 
        {
            var imgPath = 'imgDiv' + 1;
            HideModalGeneralized(imgPath);
        }
        function ShowModalGeneralized(divid) 
        {

            //$("#GetNowDiv").show(500);
            //Get the screen height and width
            var maskHeight = $(document).height();
            var maskWidth = $(window).width();
            //Set height and width to mask to fill up the whole screen
            $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

            //transition effect
            $('#mask').fadeIn(500);
            $('#mask').fadeTo("slow", 0.8);

            //Get the window height and width
            var winH = $(window).height();
            var winW = $(window).width();

            //Set the popup window to center            
            //$("#" + divid).css('top', winH / 2 - $("#" + divid).height() / 2);
            //$("#" + divid).css('left', winW / 2 - $("#" + divid).width() / 2);
            //transition effect
            $("#" + divid).fadeIn(1000);
        }
        function HideModalGeneralized(divid) 
        {
            //transition effect
            $('#mask').fadeOut(500);
            $("#" + divid).fadeOut(500);
            //$("#imgDivBig").attr('src','/images/loading5.gif');
        }       
        function ShowBigImage(srcA)
        {
            $('#imgDivBig').attr('src','/images/slideshowloading2.gif');                    
            if(srcA != '' &&  srcA.indexOf("/images/slideshowloading.gif") == -1)
            {
               $('#imgDivBig').attr('src', srcA.replace('small.JPG','png/png.png'));
            }
            ShowModalGeneralizedCaller();
        }
        
        function SetBigImage(src)
        {
        if(src.indexOf("/images/slideshowloading.gif") == -1)
        {
            $('#imgDivBig').attr('src', src.replace('small.JPG','png/png.png'));
        }
           // $('#imgDiv2').animate({ opacity: 0}, 600, function() {  $('#imgDivBig').attr('src', src.replace('small.JPG','png/png.png'));
             //   $('#imgDiv2').animate({ opacity: 1}, 900);
           // });
        }
                
         var IsFromProduct = 1;
            var ProductCod;
            function LoadBasic(productid,productname,typename)
            {
            ProductCod = productid;
            if(typename.length>13)
                document.getElementById('spnTypeName').innerHTML=typename.substr(0,13)+'..' ;
            else
                document.getElementById('spnTypeName').innerHTML=typename ;            
            
            GetImagesForProductFirstTime(productid,productname);
            PageMethods.GetTypeDivByProductID(productid, cbGetTypeDivByProductID);
            
            }  
            
           var menu1_on = false;
        var menu2_on = false;
        var isSourceSet = false;      
        
        
        function GetImagesForProduct(productID,productname)            
        {
        if(IsFromProduct==1)
        window.location.href='/our-design-product/'+productname.replace(' ','-').replace(' ','-').replace(' ','-').replace(' ','-').replace(' ','-')+'.aspx';
        else
        {
          if(productName.length>13)
            document.getElementById('spnProductName').innerHTML=productname.substr(0,13)+'..' ;
          else
            document.getElementById('spnProductName').innerHTML=productname ;
                            
          PageMethods.GetImageByProduct(productID, cbGetImageByProductId);   
          PageMethods.GetTypeDivByProductID(productID, cbGetTypeDivByProductID);
          }  
        }
        
        function GetImagesForProductFirstTime(productID,productname)            
        {
        
       if(productname.length>13)
            document.getElementById('spnProductName').innerHTML=productname.substr(0,13)+'..' ;
          else
            document.getElementById('spnProductName').innerHTML=productname ;
                            
          PageMethods.GetImageByProduct(productID, cbGetImageByProductId);   
          PageMethods.GetTypeDivByProductID(productID, cbGetTypeDivByProductID);
        
        }
 
         function GetImagesForType(productId, typeId,typeName)
         {
             for(var i=0;i<TypeArr.length;i++)
            {
                if(TypeArr[i]==typeId)
                {
                   
                    TypeCounter = i;                   
                }
            }
            
          if(typeName.length>13)
            document.getElementById('spnTypeName').innerHTML=typeName.substr(0,13)+'..' ;
          else
            document.getElementById('spnTypeName').innerHTML=typeName ;
            
            PageMethods.GetImageByProductIdandType(productId, typeId, cbGetImageByProductIdandType);         
         }
         
         
         function cbGetTypeDivByProductID(result)
         {
           
       
           
           
          document.getElementById('type_count').value=result[1];
        document.getElementById('LoadType').innerHTML='<table id="inner_TBL" border="0" align="center" cellpadding="8"><tr >'+result[0]+'</tr></table>';
            //document.getElementById('LoadType').innerHTML = result;
         }
         
         
         function cbGetImageByProductId(result)
         
         {          
         try
         {
 if(result[3].length>13)
            document.getElementById('spnTypeName').innerHTML=result[3].substr(0,13)+'..' ;
          else
            document.getElementById('spnTypeName').innerHTML=result[3] ;
          }
          catch(ex){}  

             imgIndex =0;     
            totalImages=result[0];
            
     
           
           if(result[1] != '0')
            document.getElementById('slideshow').innerHTML=result[1];   
             
          
document.getElementById('imgBig').src=result[4];

document.getElementById('imgBigDivLoad').innerHTML = result[5];
         }
         
            
        
       function cbGetImageByProductIdandType(result)
         {
            
            imgIndex =0; 
            totalImages=result[0];
            
              
           
           var typName = result[3];
           
            if(typName.length>13)
                document.getElementById('spnTypeName').innerHTML=typName.substr(0,13)+'..' ;
            else
                document.getElementById('spnTypeName').innerHTML=typName ;  
            
            
            document.getElementById('slideshow').innerHTML=result[1];            
            
            
            document.getElementById('imgBig').src=result[4];            
            document.getElementById('imgBigDivLoad').innerHTML = result[5];
            runSlideShow = 0;
         }    
         
         
           var imgIndex = 0;
        var totalImages = 5;
        var imgPrevIndex = 0;
        var TypeCounter = 0;
        var runSlideShow = 0;
        var preCount = 0;
        function slideSwitch(dir) {
        if(runSlideShow==0)
           {
            var $active = $('#slideshow IMG.active');
            isSourceSet = false;
            if ($active.length == 0)
                $active = $('#slideshow IMG:last');
            if (dir == 1) {
                var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');
                imgIndex = $active.next().length ? imgIndex + 1 : 0;
                imgPrevIndex++;
            }
            else {
                var $next = $active.prev().length ? $active.prev() : $('#slideshow IMG:last');
                imgIndex = $active.prev().length ? imgIndex - 1 : totalImages - 1;
                imgPrevIndex--;
            }
           
           if(imgPrevIndex<0 && TypeArr.length>1)
           {          
                document.getElementById('slideshow').innerHTML = '<img src="/images/slideshowloading.gif" class="active" />';
                window.document.getElementById('imgDivBig').src = '/images/slideshowloading2.gif' ;
                imgPrevIndex = 0;
                TypeCounter--;                               
                //alert(TypeCounter);
                if(TypeCounter<0)
                {
                    preCount++;
                    TypeCounter = TypeArr.length - preCount;                   
                                     
                }
                else
                {
                    preCount = 0;
                }
               var typeCount = TypeArr[TypeCounter]; 
               //alert(typeCount);
               runSlideShow = 1;                
               PageMethods.GetImageByProductIdandType(ProductCod, typeCount, cbGetImageByProductIdandType);
              
           }
           if(imgPrevIndex>=totalImages && TypeArr.length>1)
           {    
                preCount = 0;
                document.getElementById('slideshow').innerHTML = '<img src="/images/slideshowloading.gif" class="active" />';
                window.document.getElementById('imgDivBig').src = '/images/slideshowloading2.gif' ;
                if(TypeCounter >= TypeArr.length - 1)        
                    {
                        TypeCounter = -1;
                    }
                imgPrevIndex = 0;
                TypeCounter++;
                var typeCount = TypeArr[TypeCounter]; 
                runSlideShow = 1;                                          
                PageMethods.GetImageByProductIdandType(ProductCod, typeCount, cbGetImageByProductIdandType);
           }       
           
             try
             {
              window.document.getElementById('imgDivBig').src = '/images/slideshowloading2.gif' ;//  $('#imgDivBig').attr('src','/images/slideshowloading.gif'); 
            $('#imgBig').attr('src', $("#slideshow").children().eq(imgIndex)[0].src.replace('small.JPG', 'png/png.png'));
            }
            catch(e)
            {
            }
            
           if(totalImages>1)
           {
            $active.addClass('last-active');
            $next.css({ opacity: 0.0 })
            .addClass('active')
            .animate({ opacity: 1.0 }, 300, function() { $active.removeClass('active last-active'); });
            }
            
          }     
       }
 
 
        function ShowModalGeneralizedCaller() {
            var imgPath = 'imgDiv' + 1;
            ShowModalGeneralized(imgPath);
        }

        function HideModalGeneralizedCaller() {
            var imgPath = 'imgDiv' + 1;
            HideModalGeneralized(imgPath);
        }

 function ShowModalGeneralized(divid) {

            //$("#GetNowDiv").show(500);
            //Get the screen height and width
            var maskHeight = $(document).height();
            var maskWidth = $(window).width();
            //Set height and width to mask to fill up the whole screen
            $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

            //transition effect
            $('#mask').fadeIn(500);
            $('#mask').fadeTo("slow", 0.8);

            //Get the window height and width
            var winH = $(window).height();
            var winW = $(window).width();

            //Set the popup window to center            
//            $("#" + divid).css('top', winH / 2 - $("#" + divid).height() / 2);
//            $("#" + divid).css('left', winW / 2 - $("#" + divid).width() / 2);
            //transition effect
            
            //$("#" + divid).fadeIn(1000);
            $('#imgDiv1').css({ 'width': '0%', 'height': '0%' });
            $('#imgDiv1').animate({ opacity: 1, width: "650px", height: "400px"}, 600, function() { 
           // $('#imgDiv1').animate({ opacity: 1, width: "75%", height: "30%"}, 600, function() { 
            
               // $('#imgDiv1').animate({ opacity: 1, width: "100%", height: "100%"}, 900);
            });
            
            
        }
        
        function ShowModalGeneralized1(divid) {

            //$("#GetNowDiv").show(500);
            //Get the screen height and width
            var maskHeight = $(document).height();
            var maskWidth = $(window).width();
            //Set height and width to mask to fill up the whole screen
            $('#mask').css({ 'width': maskWidth, 'height': maskHeight });

            //transition effect
            $('#mask').fadeIn(500);
            $('#mask').fadeTo("slow", 0.8);

            //Get the window height and width
            var winH = $(window).height();
            var winW = $(window).width();

            //Set the popup window to center            
//            $("#" + divid).css('top', winH / 2 - $("#" + divid).height() / 2);
//            $("#" + divid).css('left', winW / 2 - $("#" + divid).width() / 2);
            //transition effect
            
            $("#" + divid).fadeIn(1000);
        }
        function HideModalGeneralized1(divid) {
            //transition effect
            $('#mask').fadeOut(500);
            $("#" + divid).fadeOut(500);

        }
        
        function HideModalGeneralized(divid) {
            //transition effect
            $('#mask').fadeOut(500);
            //$("#" + divid).fadeOut(500);
             $('#imgDiv1').animate({ opacity: 'hide', width: "350px", height: "250px"}, 900);

        }
      
        var zoom_timer;
        function ZoomImage()
        {  
			zoom_timer=setTimeout(function (){			
									if(isSourceSet)
									{
										window.ShowBigImage($("#slideshow").children().eq(imgIndex)[0].src);
									}
									else
									{
										window.ShowBigImage('');
									}
									 //
								   
									//var tempPosition = window.parent.yPosition;
									var tempPosition = yPosition;
								   
									tempPosition = tempPosition.replace('px','');                        
									//window.parent.document.documentElement.scrollTop = tempPosition - 25;
									document.documentElement.scrollTop = tempPosition - 100;
											}, 1)
        }
        function ZoomImage_1()
        {             
			if(isSourceSet){
			
				window.ShowBigImage($("#slideshow").children().eq(imgIndex)[0].src);
			}else{
				window.ShowBigImage('');
			}
			var tempPosition = '255';
			tempPosition = tempPosition.replace('px','');                        
			document.documentElement.scrollTop = tempPosition - 100;
        }
		function clear_zoom(){
			clearTimeout(zoom_timer);
		}
        function SetSrcTag()
        {
            
            isSourceSet = true;  
            try
            {          
            window.SetBigImage($("#slideshow").children().eq(imgIndex)[0].src);           
            }
            catch(e)
            {
            }
        }
        
        var clearNextTimer;
        var clearPreviousTimer;
        
        function NextImgCaller()
        {
            clearNextTimer = setInterval("slideSwitch(\"1\")",2500);  
        }
        
        function PreviousImgCaller()
        {
            clearPreviousTimer = setInterval("slideSwitch(\"-1\")",2500);
        }
        function NextImgCaller_1()
        {
            slideSwitch(1);
        }
        
        function PreviousImgCaller_1()
        {
           slideSwitch(-1);
        }
        
        function ClearImgNext()
        {
            try
            {
                
                 clearTimeout(clearNextTimer);
            }
            catch(e) { }
        }
        
        function ClearPreviousImg()
        {
            try
            {          
                 clearTimeout(clearPreviousTimer);
            }
            catch(e) { }
        }
        
        var ZoomImgTimer;
        
        function OpenBigImg()
        {
            ZoomImgTimer = setTimeout("ZoomImage()", 1000);
        }
        
        function ClearBigImgTimer()
        {
            try
            {
                clearTimeout(ZoomImgTimer);
            }
            catch(e){  }
        }
 
         function SetSlideImageByType(divID,Type)
        {
            document.getElementById('slideshow').innerHTML = '';
            document.getElementById('slideshow').innerHTML  = document.getElementById(divID).innerHTML ;  
            document.getElementById('TypeName').innerText = Type; 
        }
        function IframeOnLoad()
        {
        
                var hdqryval=20;
			    var pcCode = 1;
			    
			    try
			    {
			        hdqryval=document.getElementById('hdfdboqry').value;
			        document.getElementById('frameRight').src='/WebPages/Client/SignUp/ClientSignUp.aspx?btCode='+hdqryval;
			    }
			    catch(ex)
			    {
			    }
			    
			    try
			    {
			        pcCode = document.getElementById('hdfProductCode').value;
			        document.getElementById('frameRight').src='/WebPages/Client/SignUp/ClientSignUp.aspx?pc='+pcCode;
			    }
			    catch(ex)
			    {
			    }

			    
			    
        }