﻿function pop(url) {
  newwindow=window.open(url,'drucker_pop','height=700,width=1020,scrollbars=yes');
  if (window.focus) {newwindow.focus()}
  return false;
}

function social_pop(url) {
  newwindow=window.open(url,'social_pop','height=600,width=900,scrollbars=yes');
  if (window.focus) {newwindow.focus()}
  return false;
}

function wrongAnswer(obj) {
  $(obj).parent().css('border', '1px red solid');
}

function correctAnswer() {
  showForm();
}

function showForm() {
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById('raffle_form').style.visibility = 'visible';
  }
  else {
    if (document.layers) { // Netscape 4
      document.raffle_form.visibility = 'visible';
    }
    else { // IE 4
      document.all.raffle_form.style.visibility = 'visible';
    }
  }
  
  objElems = document.getElementById('question').elements;
  for(i=0;i<objElems.length;i++){
    $(objElems[i]).parent().css('border', '1px #fff solid');
    objElems[i].disabled = true;
  }
}

$(document).ready(function() {
  $(".cb_terms").colorbox();
  $("a[rel='chart']").colorbox();
  
  if (document.getElementById('question'))
  {
    objElems = document.getElementById('question').elements;
    for(i=0;i<objElems.length;i++){
      objElems[i].disabled = false;
      objElems[i].checked = false;
    }  
  }
  
  var x = document.getElementsByTagName('a');
  for (var i=0;i<x.length;i++) {
    if (x[i].getAttribute('type') == 'popup') {
      x[i].onclick = function () {
        return pop(this.href)
      }
      x[i].title += ' (Popup)';
    }
  }
  
  var x = document.getElementsByTagName('area');
  for (var i=0;i<x.length;i++) {
    if (x[i].getAttribute('type') == 'popup') {
      x[i].onclick = function () {
        return pop(this.href)
      }
    }  
    if (x[i].getAttribute('type') == 'social-pop') {
      x[i].onclick = function () {
        return social_pop(this.href)
      }      
      x[i].title += ' (Popup)';
    }
  }  
  
  $('.software_tab_right2a').divSlideShow( {width:410, height:280, loop:0, controlClass:'slide_buttons'} );
  $('.software_tab_right2b').divSlideShow( {width:410, height:280, loop:0, controlClass:'slide_buttons'} );
});
