$(document).ready(function(){
	$(".intext").toggleVal();
	$("#global li, #nav li, #carousel li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});
  

    if($("#carousel").length) {
      $this = $("#carousel");
      $this.find("ul.tabs li").each(function(){
        
        if($(this).text().length <= 18) {
          $(this).addClass('override');
          $(this).addClass('small');
        }
      });
    }

    /* ###
  this makes all images in footer black and white, with colors appearing when mouse is over them 
   !!! requires grayscale.js !!! don't give the images padding for Opera's sake.
  */
  jQuery(window).load(function($) { // wait until all images are loaded.
	grayscale.prepare( jQuery('.partner_logo img') );
	grayscale( jQuery('.partner_logo img') );
        jQuery(".partner_logo img").css("display","inline");
	jQuery('.partner_logo img').hover(function() {
		grayscale.reset( jQuery(this) );
	}, function() {
		grayscale( jQuery(this) );
	});
  });
  /* eof */

  //news ticker
  $("#new_ticker_list").newsticker()

  //countdown
  $('#defaultCountdown').countdown({
   until: new Date(parseInt(ips.engAttributes.countdownDate.split(",")[0]), parseInt(ips.engAttributes.countdownDate.split(",")[1]), parseInt(ips.engAttributes.countdownDate.split(",")[2]), parseInt(ips.engAttributes.countdownDate.split(",")[3]), parseInt(ips.engAttributes.countdownDate.split(",")[4])),
   format: 'DHMS',
    /* By Ten Seven Interactive http://ten7i.com */
    layout: '<div id="t7_timer">'+
    '<div id="t7_vals">'+
    '<div id="t7_d" class="t7_numbs">{dnnn}</div>'+
    '<div id="t7_h" class="t7_numbs">{hnn}</div>'+
    '<div id="t7_m" class="t7_numbs">{mnn}</div>'+
    '<div id="t7_s" class="t7_numbs">{snn}</div>'+
    '</div>'+
    '<div id="t7_labels">'+
    '<div id="t7_dl" class="t7_labs">days</div>'+
    '<div id="t7_hl" class="t7_labs">hours</div>'+
    '<div id="t7_ml" class="t7_labs">mins</div>'+
    '<div id="t7_sl" class="t7_labs">secs</div>'+
    '</div>'+
    '<div id="t7_timer_over"></div>'+
    '</div>'
    });
  })

function checkEmail(myForm) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.recipientEmail.value)){ 
  document.getElementById('objectResponse').innerHTML="<h3>Loading...</h3>";
  return (true) 
  }
  alert("Feil e-post, test igjen.")
  return (false)
}
