﻿function getFacebookIFrameUrl() {
    var id = 7271269619;
    var stylesheetUrl = "http://clients:!Client2009!@aiesec.clients.dotagency.co.uk/style.css?v19";
    return "http:\/\/www.facebook.com\/connect\/connect.php?id=" + id + "&amp;connections=5&amp;stream=0&amp;logobar=0&amp;css=" + escape(stylesheetUrl) + "&amp;locale=en";
}

$(document).ready(function () {

    //Let's add the iframe dynamically so we still validate! Because facebook forces iframe
    var strVar = "<iframe src=\"" + getFacebookIFrameUrl() + "\" style=\"border: none; width: 300px; height: 170px;\" scrolling=\"no\" allowtransparency=\"true\" frameborder=\"0\"><\/iframe>";

    $('.iframe_add').prepend(strVar);

    $('#flickr').jflickrfeed({
        limit: 2,
        qstrings: {
             id: '39874045@N06'
        },
        itemTemplate:
			'<a href="{{image}}"><img src="{{image_s}}" alt="{{title}}" /></a>'
    }, function (data) {
        //Add the margin to the first image only
        $('#flickr img:first').css("margin-right", "10px");
    });

//    // Login
//    $('#loginButton').click(function () {
//        if ($('.login_hide').is(":visible")) {
//            $('.login_hide').hide();
//        } else {
//            $('.login_hide').show();
//        }
//    });

    // Search
//    $('#searchButton').click(function () {
//        if ($('.search_hide').is(":visible")) {
//            $('.search_hide').hide();
//        } else {
//            $('.search_hide').show();
//        }
//    });
});
