//This script coded by smartdevice@hotmail.com(ahmetFirat)
//



        var bannerListSD;
        function Banner(ext,w,h,fileName,container)
        {
            this.ext = ext;
            this.w = w;
            this.h = h;
            this.fileName = fileName;
            this.container = container;
        }       
        
        var currentIndexSD = 0;
        var timerBannerSD = null;
        var bannerFolderSD = '';
        
        function changeImageSD()
        {               
            if(currentIndexSD == bannerListSD.length)
            {   
                 currentIndexSD  = 0;
            }
            
            getBannerImageSD();
            
            currentIndexSD = currentIndexSD + 1;           
        }
        
        function getBannerImageSD()
        { 
            switch(bannerListSD[currentIndexSD].ext)
            {
                case 'jpg':                    
                case 'gif':
                case 'png':
                    document.getElementById(bannerListSD[currentIndexSD].container).innerHTML = '<img src="' + bannerFolderSD +  bannerListSD[currentIndexSD].fileName + '.' + bannerListSD[currentIndexSD].ext + '" style="width: ' + bannerListSD[currentIndexSD].w + 'px ; height:' + bannerListSD[currentIndexSD].h +'px;"/>';                                       
                    
                break;
                case 'swf':
                
//                    strFlash = '<object width=" ' + bannerListSD[currentIndexSD].w + '" height="' + bannerListSD[currentIndexSD].h +'">';
//                    strFlash = strFlash + '<param name="movie" value="' + bannerListSD[currentIndexSD].fileName + '.' + bannerListSD[currentIndexSD].ext + '">';
//                    strFlash = strFlash + '<embed src="' + bannerListSD[currentIndexSD].fileName + '.' + bannerListSD[currentIndexSD].ext + '" width="' + bannerListSD[currentIndexSD].w + '" height="' + bannerListSD[currentIndexSD].h + '">';
//                    strFlash = strFlash + '</embed>';
//                    strFlash = strFlash + '</object>';
                    
                    strFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" ';
                    strFlash = strFlash + 'width="' + bannerListSD[currentIndexSD].w + '" height="' + bannerListSD[currentIndexSD].h + '" id="' + bannerListSD[currentIndexSD].fileName + '">';
                    strFlash = strFlash + '<param name="movie" value="' + bannerFolderSD + bannerListSD[currentIndexSD].fileName +'.swf" />';
                    strFlash = strFlash + '<param name="quality" value="high" />';
                    strFlash = strFlash + '<param name="bgcolor" value="#000" />';
                    strFlash = strFlash + '<embed  src="' + bannerFolderSD + bannerListSD[currentIndexSD].fileName +'.swf" ';
                    strFlash = strFlash + 'quality="high" bgcolor="#000" ';
                    strFlash = strFlash + 'width="' + bannerListSD[currentIndexSD].w + '" height="' + bannerListSD[currentIndexSD].h + '" ';
                    strFlash = strFlash + 'name="' + bannerListSD[currentIndexSD].fileName +'" align="" type="application/x-shockwave-flash" ';
                    strFlash = strFlash + 'plugspace="http://www.macromedia.com/go/getflashplayer"> ';
                    strFlash = strFlash + '</embed>';
                    strFlash = strFlash + '</object>';
                    
//                    strFlash = '<script type="text/javascript"> \n';
//                    strFlash = strFlash + "AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0',";
//                    strFlash = strFlash + "'width','" + bannerListSD[currentIndexSD].w + "',";
//                    strFlash = strFlash + "'height','" + bannerListSD[currentIndexSD].h + "',";
//                    strFlash = strFlash + "'src','" + bannerListSD[currentIndexSD].fileName + "',";
//                    strFlash = strFlash + "'quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie',";                    
//                    strFlash = strFlash + "'" +  bannerListSD[currentIndexSD].fileName + "'); \n";
//                    strFlash = strFlash + "<\/script>";    
//                    
                  
                    document.getElementById(bannerListSD[currentIndexSD].container).innerHTML = strFlash;
//                                document.getElementById(bannerListSD[currentIndexSD].container).innerText = strFlash;
                    

                break;                                                        
                default:    
                    document.getElementById(bannerListSD[currentIndexSD].container).innerText = 'This format not supported!'                   
                break;  
            }
        }
        
        function bannerStart(folder,interval)
	    {
	        bannerFolderSD = folder;
	        
		    if(bannerListSD.length != 0)
		    {
		        changeImageSD();		        
		    }
		    if (bannerListSD.length > 1)
		    {
		    timerBannerSD = setInterval("changeImageSD()",interval);	
		    }
	    }
	    
	    function bannerAdd(ext,w,h,fileName,container)
	    {
	        if(bannerListSD == null)
	        {
	            bannerListSD = new Array();   
	            var theBanner = new Banner(ext,w,h,fileName,container);    
	         bannerListSD.push(theBanner);     
	        }       
	        else
	        {
	         var theBanner = new Banner(ext,w,h,fileName,container);    
	         bannerListSD.push(theBanner); 
	        }
	        	             
	    }
        