
function processMyForm(){ 
    alert('Thank you - we will respond as soon as possible.'); 
}

jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

function bookmark() {
    bookmarkurl="http://www.rewardonline.co.za"
    bookmarktitle="RewardOnline"
    if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
    else if (window.sidebar) // firefox
        window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
}

$.preloadImages("image1.gif", "images/slide01.jpg", "images/slide02.jpg", "images/slide03.jpg", "images/slide04.jpg", "images/slide05.jpg");

function mainmenu(){
$(" #nav a").removeAttr("title");
if(!$.browser.msie){
	$(" #nav ul ").css({opacity:"0.97"});
}// IE  - 2nd level Fix

$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first:hidden').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}




function headslider(){
    var i = 0;   
    setInterval(myslide1,5000);
   
function myslide1(){
        number = i +1;
        next = i + 2;
                $('.teaser'+ number).animate({opacity:0,left:"0px"},2000, function(){
                                                                                    $(this).css({left:"-1600px",opacity:1});
                                                                                    });
                if($(".teaseritem").length > number){
                $('.teaser'+ next).animate({left:"0px"},1000);
                i++;
                }else{
                $('.teaser1').animate({left:"0px"},1000);
                i = 0;
                }
    }

}

 $(document).ready(function(){					
mainmenu();
headslider();
if ($(".tooltip").length) {
simple_tooltip("a","tooltip");
}
if ($(".tabs").length) {
kriesi_tab('.tabs','h4','.sidebar_entry');
}

});

function initOverLabels () {
  if (!document.getElementById) return;      

  var labels, id, field;

  // Set focus and blur handlers to hide and show 
  // labels with 'overlabel' class names.
  labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {

    if (labels[i].className == 'overlabel') {

      // Skip labels that do not have a named association
      // with another field.
      id = labels[i].htmlFor || labels[i].getAttribute ('for');
      if (!id || !(field = document.getElementById(id))) {
        continue;
      } 

      // Change the applied class to hover the label 
      // over the form field.
      labels[i].className = 'overlabel-apply';

      // Hide any fields having an initial value.
      if (field.value !== '') {
        hideLabel(field.getAttribute('id'), true);
      }

      // Set handlers to show and hide labels.
      field.onfocus = function () {
        hideLabel(this.getAttribute('id'), true);
      };
      field.onblur = function () {
        if (this.value === '') {
          hideLabel(this.getAttribute('id'), false);
        }
      };

      // Handle clicks to label elements (for Safari).
      labels[i].onclick = function () {
        var id, field;
        id = this.getAttribute('for');
        if (id && (field = document.getElementById(id))) {
          field.focus();
        }
      };

    }
  }
};

function hideLabel (field_id, hide) {
  var field_for;
  var labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {
    field_for = labels[i].htmlFor || labels[i]. getAttribute('for');
    if (field_for == field_id) {
      labels[i].style.textIndent = (hide) ? '-10000px' : '0px';
      return true;
    }
  }
}

window.onload = function () {
  setTimeout(initOverLabels, 50);
};



