/*
 * Copyright 2007 EDL FOUNDATION
 *
 * Licensed under the EUPL, Version 1.1 or as soon they
 * will be approved by the European Commission - subsequent
 * versions of the EUPL (the "Licence");
 * you may not use this work except in compliance with the
 * Licence.
 * You may obtain a copy of the Licence at:
 *
 * http://ec.europa.eu/idabc/eupl
 *
 * Unless required by applicable law or agreed to in
 * writing, software distributed under the Licence is
 * distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied.
 * See the Licence for the specific language governing
 * permissions and limitations under the Licence.
 */

function showRandomLogo(){
    var theImages = [];
    var theLogos = ["1","2","3","4","5","6","7"];
    for (i = 0; i < theLogos.length; i++){
       theImages[i] = "think_culture_logo_top_"+theLogos[i]+".jpg";
    }
    var j = 0;
    var p = theImages.length;
    var whichImage = Math.round(Math.random()*(p-1));
    document.write('<img alt="Europeana" title="Europeana" src="images/'+theImages[whichImage]+'"/>');
}

function showRandomSlogan(size){
    var theImages = [];
    var theLanguages = ["cs","da","de","el","en","es","et","fi","fr","ga","hu","is","it","lt","mt","nl","en","fr","de","pl","pt","ro","sk","sl","sp","sv","en","fr","de","en","fr","de"];
    for (i = 0; i < theLanguages.length; i++){
       theImages[i] = "think_culture_"+theLanguages[i]+".gif";
    }
    var j = 0;
    var p = theImages.length;
    var whichImage = Math.round(Math.random()*(p-1));
    document.write('<img alt="Think Culture" title="Think Culture" src="images/'+theImages[whichImage]+'"/>');
}

$(document).ready(function() {
// Oddly, on 150DPI IE7 normal font, the second grid div jumps below the first.
// So, when that happens, just setting the width with an extra pixel makes the grid jump into place again.
    if ($.browser.msie)
    {
        var primary_content_offset_top = $("#primary-content").position().top + 100;
        var primary_content_second_offset_top = $("#primary-content-second").position().top;
        if (primary_content_offset_top < primary_content_second_offset_top){
            $("#primary-content").width($("#primary-content").width() + 1);
        }
    }

});
