function visibility(id,nakyyko)
{
  document.getElementById(id).style.visibility=nakyyko;
}

function openWindow(url,width,height)
{
  var popup = window.open(url,'gallery',eval("'directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=no, width="+width+", height="+height+"'"))
  if (popup)
  {
    popup.focus();
  }
}

var myimages=new Array();
function preloadimages()
{
  for(i=0;i < preloadimages.arguments.length;i++)
  {
    myimages[i]=new Image();
    myimages[i].src=preloadimages.arguments[i];
  }
}
preloadimages("/themes/radio86/images/email_on.gif", "/themes/radio86/images/print_on.gif", "/themes/radio86/images/comment_on.gif");

function changePic(id, newpic)
{
  document.getElementById(id).setAttribute('src', newpic);
}

function openInParent(url)
{
  if(!window.opener)
    window.open(url,'_blank')
  else
  {
    window.opener.location=url
    window.opener.focus();
  }

}

/****************************************************************************/
/*                             TUNER                                        */
/****************************************************************************/

/*function main_kwicks(){
  $('.kwicks').kwicks({
        maxWidth: 205,
    duration: 800,
        easing: 'easeOutQuint'
    });
}

$(document).ready(function(){
   main_kwicks();
});*/

function main_kwicks(){
  jQuery(".kwicks").kwicks({
        maxWidth: 205,
    duration: 800,
        easing: 'easeOutQuint'});

  jQuery(".kwicks_left").kwicks({
        maxWidth: 205,
    duration: 800,
        easing: 'easeOutQuint'});
}

jQuery(document).ready(function(){
   main_kwicks();
});

// Shows a popup survey if math random matches the set number
// Afterwards, sets a cookie so that you have seen the popup. The cookie is set to expire in 90 days.
jQuery(document).ready(function() {
  var survey_seen = jQuery.cookie('survey_seen');
  var rand        = Math.ceil(6*Math.random());
  var browser     = navigator.appName;

  if ( browser == "Microsoft Internet Explorer" ) {
    jQuery('#survey_overlay').css('background', 'none');
  }

  if ( rand == 1  &&  survey_seen != 'yes' ) {
    setTimeout("jQuery.cookie('survey_seen', 'yes', { expires: 90, path: '/' });", 7500);
    setTimeout("jQuery('#survey_overlay').fadeIn(100);", 7500);
    jQuery('#close_survey, #close_survey2').click(function() {
      jQuery('#survey_overlay').fadeOut(100);
    });
  }
});