﻿
    $(document).ready(function(){	

	    $("#slider").easySlider({
                            speed: 2000,
                            pause: 6000,
		    auto: true,
		    continuous: true 
	    });

    });	
    
    function jsonFlickrApi(rsp) 
    {    
        
        if (rsp == null || rsp.stat != 'ok')
            return;

        //variable "s" is going to contain  
        //all the markup that is generated by the loop below 
        var s = "";  
        
        s += "<table cellpadding='0' cellspacing='0' border='0'><tr>";
        //this loop runs through every item and creates HTML 
        var photoCount = 1; 
        for (var i=0; i < rsp.photos.photo.length; i++) 
        {  
            photo = rsp.photos.photo[ i ];    
            
            //notice that "t.jpg" is where you change the  
            //size of the image  
            t_url = "http://farm" + photo.farm +   ".static.flickr.com/" + 
                photo.server + "/" +   photo.id + "_" + photo.secret + "_" + 
                "t.jpg";      
            
            p_url = "http://www.flickr.com/photos/" +   photo.owner + "/" + photo.id;    
            
            s +=  '<td><a href="' + p_url + '" border="0">' + '<img alt="'+   photo.title + '"src="' + 
                t_url + '" width="85" height="85" border="0"/>' + '</a></td>';

            s += ((photoCount % 3 == 0 && i != 0) ? "</tr><tr>" : ""); 

            photoCount++;
        } 
        
        s += "</tr></table>";

        document.writeln(s);  
        //this tells the JavaScript to write  
        //everything in variable "s" onto the page
    }
    
