var time_ticker = 8000;

var images_quote = new Array();

images_quote[0] = new Array();
images_quote[0]['link'] = "#1";
images_quote[0]['image'] = "http://www.nadeah.com/2011/images/headerbg_05_blk.jpg"

images_quote[1] = new Array();
images_quote[1]['link'] = "#2";
images_quote[1]['image'] = "http://www.nadeah.com/2011/images/headerbg_06_blk.jpg";

images_quote[2] = new Array();
images_quote[2]['link'] = "#3";
images_quote[2]['image'] = "http://www.nadeah.com/2011/images/headerbg_01.jpg";

images_quote[3] = new Array();
images_quote[3]['link'] = "#4";
images_quote[3]['image'] = "http://www.nadeah.com/2011/images/headerbg_02.jpg";

images_quote[4] = new Array();
images_quote[4]['link'] = "#5";
images_quote[4]['image'] = "http://www.nadeah.com/2011/images/headerbg_03.jpg";

var current_images_quote = 0;
var alertTimerId = setTimeout("change_image_quote()",time_ticker);

function show_banner()
{
	document.write('<div id="image_quote" style="display:block; width:892px; height:363px;"><a href="'+images_quote[0]['link']+'"><img src="'+images_quote[0]['image']+'" border="0"></a></div>');
}

function change_image_quote(){
	clearTimeout(alertTimerId);
	current_images_quote = current_images_quote+1;
	if(current_images_quote == images_quote.length)
	{
		current_images_quote = 0;
	}
      newsrc = images_quote[current_images_quote]['image'];
      newlink = images_quote[current_images_quote]['link'];

      $('#image_quote img').fadeOut(300, function(){
            $(this).attr('src',newsrc).bind('onreadystatechange load', function(){
                  if (this.complete) 
                  {
                  	$(this).fadeIn(300);
                  	$('#image_quote a').attr('href',newlink);
                  }
            });
       }); 
       alertTimerId = setTimeout("change_image_quote()",time_ticker);
}
function change_image_quote_right(){
    clearTimeout(alertTimerId);
	current_images_quote = current_images_quote-1;
	if(current_images_quote == images_quote.length)
	{
		current_images_quote = 0;
	}
	if(current_images_quote == -1)
	{
		current_images_quote = images_quote.length - 1;
	}
      newsrc = images_quote[current_images_quote]['image'];
      newlink = images_quote[current_images_quote]['link'];

      $('#image_quote img').fadeOut(300, function(){
            $(this).attr('src',newsrc).bind('onreadystatechange load', function(){
                  if (this.complete) 
                  {
                  	$(this).fadeIn(300);
                  	$('#image_quote a').attr('href',newlink);
                  }
            });
       }); 
      alertTimerId = setTimeout("change_image_quote()",time_ticker);
}

function change_image_quote_left(){
	clearTimeout(alertTimerId);
	current_images_quote = current_images_quote-1;
	if(current_images_quote == images_quote.length)
	{
		current_images_quote = 0;
	}
	if(current_images_quote == -1)
	{
		current_images_quote = images_quote.length - 1;
	}
      newsrc = images_quote[current_images_quote]['image'];
      newlink = images_quote[current_images_quote]['link'];

      $('#image_quote img').fadeOut(300, function(){
            $(this).attr('src',newsrc).bind('onreadystatechange load', function(){
                  if (this.complete) 
                  {
                  	$(this).fadeIn(300);
                  	$('#image_quote a').attr('href',newlink);
                  }
            });
       }); 
      alertTimerId = setTimeout("change_image_quote()",time_ticker);
}
