﻿        function ppt(){
        
        this.showSlideShow = function(){
            var self =new ppt(); 
            var slide = document.getElementById("bposppt");             
            self.DetectBrowser(); 
            
            if(self.isFF){
             slide.removeAttribute("class");             
             slide.setAttribute("style"," DISPLAY: block; top: 320px; left: 360px; POSITION: absolute;Z-INDEX:1000; background-color: #000;");
            }else if(self.isIE){
            slide.style.display = "block";
            slide.style.position = "absolute"; 
            slide.style.top = "320px";
            slide.style.left = "360px";
            slide.style.zIndex = "1000"; 
            slide.style.borderColor = "#F0F0F0"; 
            }
        };
      
        
        this.hide =function(){
        var slide = document.getElementById('bposppt');
        var self =new ppt(); 
        self.DetectBrowser();
        
         if(self.isFF){
            if(slide.hasAttribute('style')){
                slide.removeAttribute('style'); 
            }
            slide.setAttribute('style', 'display :none;'); 
            }else if(self.isIE){                
                slide.style.display ="none";
            }
        };
        
        this.increaseSize = function(obj){
        var self =new ppt();    
        self.DetectBrowser();     
           // var img = document.getElementById("<%=Image1.ClientID %>");
          var img = document.getElementById(obj); 
            var imgStyle = new Array(); 
            var height = 300, width=300; 
             if(self.isFF){ 
            if(img.hasAttribute('style')){
                var styleStr = img.getAttribute('style'); 
                    var x= new Array(); 
                    x =styleStr.split(';'); 
                    var length = x.length; 
                    for(var i =0; i<length; i++){                    
                       if(x[i].indexOf(':')!=-1){
                            imgStyle[x[i].substring(0, x[i].indexOf(':')).toString().replace(/^\s*|\s*$/g, '')] = x[i].substring(x[i].indexOf(':')+1, x[i].length).replace(/^\s*|\s*$/g, '');                   
                       }
                    }   
                       if(typeof(imgStyle["height"])!=undefined){
                        height =parseInt(self.returnInt(imgStyle["height"])); 
                       }  
                       if(typeof(imgStyle["width"])!=undefined){
                        width = parseInt(self.returnInt(imgStyle["width"])); 
                       }                      
                    
                    if(height<1000 && width <1000){
                        height =parseInt(height)+ 100; 
                        width =parseInt(width) + 100; 
                    }
                    img.removeAttribute('style'); 
                    
            }
            
            img.setAttribute('style', 'border-width:0px; height: '+height+'px; width: '+width+'px;'); 
            }else if(self.isIE){
                height = parseInt(self.returnInt(img.style.height)); 
                width = parseInt(self.returnInt(img.style.width));
                 
                if(height<1000 && width <1000){
                        height =parseInt(height)+ 100; 
                        width =parseInt(width) + 100; 
                    }
                    
                img.style.borderWidth = "0"; 
                img.style.height = height+"px";
                img.style.width = width+"px";
            }
        }; 
        
        
        this.decreaseSize = function(obj){
        var self =new ppt(); 
         self.DetectBrowser();   
            //var img = document.getElementById("<%=Image1.ClientID %>");
            var img = document.getElementById(obj); 
            var imgStyle = new Array(); 
            var height = 300, width=300; 
            if(self.isFF){ 
            if(img.hasAttribute('style')){
                var styleStr = img.getAttribute('style'); 
                    var x= new Array(); 
                    x =styleStr.split(';'); 
                    var length = x.length; 
                    for(var i =0; i<length; i++){                    
                       if(x[i].indexOf(':')!=-1){
                            imgStyle[x[i].substring(0, x[i].indexOf(':')).toString().replace(/^\s*|\s*$/g, '')] = x[i].substring(x[i].indexOf(':')+1, x[i].length).replace(/^\s*|\s*$/g, '');                   
                       }
                    }  
                    
                    if(typeof(imgStyle["height"])!=undefined){
                        height =parseInt(self.returnInt(imgStyle["height"])); 
                       }  
                    if(typeof(imgStyle["width"])!=undefined){
                        width =parseInt(self.returnInt(imgStyle["width"])); 
                       }                      
                    
                    if(height>316 && width >388){
                        height = parseInt(height)-100; 
                        width = parseInt(width)-100; 
                    }
                    img.removeAttribute('style'); 
                    
            }
            
            img.setAttribute('style', 'border-width:0px; height: '+height+'px; width: '+width+'px;'); 
            }else if(self.isIE){
                height = parseInt(self.returnInt(img.style.height)); 
                width = parseInt(self.returnInt(img.style.width));
                 
                if(height>316 && width >388){
                        height = parseInt(height)-100; 
                        width = parseInt(width)-100; 
                    }
                
                img.style.borderWidth = "0"; 
                img.style.height = height+"px";
                img.style.width = width+"px";
            }
        }; 
        
        
        this.remove_WhiteSpace = function(field){
            return field.replace(/^\s*|\s*$/g, ''); 
        }; 
        
        this.returnInt = function(field){
           if(this.remove_WhiteSpace(field).length>0)
           {
                if(field.indexOf('p')!=-1){
                    return parseInt(field.substring(0, field.indexOf('p'))); 
                }
            return parseInt(field);
            }
            return parseInt(0);             
        };  
        
        this.DetectBrowser = function()
        {
           var val = navigator.userAgent.toLowerCase();
          // var self = new ppt(); 
           if(val.indexOf("firefox") > -1)
           {
               this.isFF = true;
           } 
           else if(val.indexOf("opera") > -1)
           {
               this.isOP = true;
           }
           else if(val.indexOf("msie") > -1)
           {
               this.isIE = true;
           }
           else if(val.indexOf("safari") > -1)
           {
               this.isIE = true;
           }
       };
       this.isFF= false;  
       this.isOP = false; 
       this.isIE =false; 
    } 
