Accessing external var

Accessing external var

Hi, I've been writing a script using the Flickr API.

Basically it takes photos from a certain set and user and puts those in the fancybox format. The problem I have now is that whenever I want the set to change, I have the edit the javascript,. Instead I want to be able to change this in the html where it's being called.

Here's the script:

  1. (document).ready(function(){
  2.    //insert your Flickr API key
  3.    var api='6f9bff414d8f176e5c15359934c741bb'
  4.    //insert the ID of the set you want to use
  5.    var photoset='72157624543526492'
  6.   
  7.    //creating custom feed from chosen set
  8.    var url='http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=' +api+'&photoset_id='+photoset+'&media=photos&format=json&jsoncallback=?'
  9.      
  10.        $.getJSON(url, function(data){
  11.            $.each(data.photoset.photo, function(idx, item){
  12.                   
  13.                 //making var for original image
  14.                var photourlz = 'http://farm5.static.flickr.com/' +item.server+ '/' +item.id+ '_' +item.secret+ '_z.jpg';
  15.                //making var for the thumbnails
  16.                var photourls = 'http://farm5.static.flickr.com/' +item.server+ '/' +item.id+ '_' +item.secret+ '_s.jpg';
  17.                //take title from feed so it can be used in the viewer
  18.                var title = item.title;
  19.               
  20.                //put the photos in the DIV
  21.                $('#photos').append('<div id=photo><a rel="photoset" title="'+title+ '" href=" '+photourlz+' "><img src=" '+photourls+' " alt=""/></a></div>');
  22.                //give those photos the FancyBox treatment
  23.                 $("a[rel=photoset]").fancybox({
  24.                     'transitionIn'    :    'fade',
  25.                     'transitionOut'    :    'fade',
  26.                     'speedIn'        :    600,
  27.                     'speedOut'        :    200,
  28.                     'overlayShow'    :    false,
  29.                     'titleShow'        :     true,
  30.                     'titlePosition' :    'inside'
  31.             });
  32.                               
  33.            });
  34.           
  35.        });
  36.       
  37.       
  38.    
  39. });
So is it possible to call the vars when I include the script in an external page?

Like

  1. <script type="text/javascript" src="FancyFlickr.js">
  2.         // insert api & photoset vars
  3.         </script>
Thanks in advance!