window.addEvent('domready', function() {
var images = ["images/Banner-home.jpg","images/Banner-franch.jpg","images/Banner-Ads.jpg","images/Banner-corp.jpg","images/Banner-Priv.jpg"];


new Asset.images(images, {

onComplete: function() {

	//var effect = $('box').effect('background-color', {duration: 5000});
	var periodical;
	var count = 0;
	var which_one = 0;
	
	var text = "";
	var title = "";
	var image = "";
	var im_num = "";
	var im_num_a = "";
	var flash_im = "";
	var flash_im2 = "";

	var hide = function(){
		$('flash_box').getElement('.text_holder').fade('out') //fade out text
		//$(flash_im2).fade('out');		
		$(flash_im2).tween('left', -500); //off stage left
		periodical_show = show.periodical(500); //7000
		}
 
	var show = function (){
			$clear(periodical_show);
			$('numbers').getElement(im_num_p).setStyles({'background-color':'transparent','background-image':'url(images/dot.png)','background-repeat':'no-repeat'});
			$('numbers').getElement(im_num_a_p).setStyles({'color':'#FFFFFF','padding-left':'0px'});
			
			$('numbers').getElement(im_num).setStyles({'background-color':'transparent','background-image':'url(images/dot_sel.png)','background-repeat':'no-repeat'});
			$('numbers').getElement(im_num_a).setStyles({'color':'#3B42A4','padding-left':'1px'});
			$('title').set('html', title);
			$('flash_text').set('html', text);
			//$(flash_im).set('src', image);
			
			//$(flash_im).fade('in');
			$(flash_im).setStyles({'display':'inline'});
			$(flash_im2).setStyles({'display':'none'});
			$(flash_im).tween('left', 0); //on stage
			$(flash_im2).set('src', image);
			$(flash_im2).tween('left', 1700); //off stage right
			$('flash_box').getElement('.text_holder').fade('in') //fade in text
		}
		
	var fx = function() {
		count = count+1;
		if(count==0||count==2||count==4)
		{
			flash_im = "flash_img";
			flash_im2 = "flash_img2";
		}
		else
		{
			flash_im = "flash_img2";
			flash_im2 = "flash_img";
		}
		
		if(count==0)
		{
			title = "<a href='about_leap.php'>About LEAP</a>";	
			text = "<p>Established in Paphos Cyprus in 2008 Leap Wireless has grown into a major provider of Wireless internet and internet based advertising in the Paphos area.</p><br/><p>Using advanced technologies and routing protocols developed in house Leap Wireless provides a cheap reliable service to tourists and residents of Paphos alike.</p><br/><p>The Future for Leap is moving fast , as we constantly expand and improve stability, Leap is ready to rolled out over Cyprus and beyond with a system of limited franchises</p>";
			image = "images/Banner-franch.jpg"; 
			im_num = '.1';
			im_num_a = '.1_a';
			im_num_p = '.6';
			im_num_a_p = '.6_a';
		}
		if(count==1)
		{
			title = "<a href='franchising.php'>Franchising</a>";	
			text = "<p>Leap Wireless  is currently in the process of developing a prospectus  for Leap franchises  fro the following regions of Cyprus: Nicosia, Limassol, and Larnaca, as well as master franchise for  other countries.</p><br/><p>If you would like to register for an advanced copy  of this exciting proposal, please leave us your details and we will forward you a copy once the documentation is complete.</p>";
			image = "images/Banner-Ads.jpg";
			im_num = '.2';
			im_num_a = '.2_a';
			im_num_p = '.1';
			im_num_a_p = '.1_a';
		}
		if(count==2)
		{
			title = "<a href='advertising.php'>Leap Ads</a>";	
			text = "<p>Reach out to thousands of potential clients who are at the door step of your business today. Leap offers  local companies a  chance to display their online advertising  to a local audience  on a vast variety of  international websites from the BBC to Bebo and Facebook.</p><br/><p>LeapAds can be purchased for as little as 2 Euro cents per impression. In a world where conventional media ads can cost 1000 s of Euros, LeapAds  represent excellent value for money.</p>";		
			image = "images/Leap-store-ban";
			im_num = '.3';
			im_num_a = '.3_a';	
			im_num_p = '.2';
			im_num_a_p = '.2_a';			
		}
		if(count==3)
		{
			title = "<a href='store.php'>Leap Store</a>";	
			text = "<p>Choose from the wide range of Wireless Inrenet top-up cards. If you need WI-Fi just for a day or want to use it regularly we have the right Leap plan for you.</p><br/><p>Find the right product to improve your signal strength or establish a link to your nearest access point with a long range Wireless card from Leap.</p>";			
			image = "images/Banner-corp.jpg";
			im_num = '.4';
			im_num_a = '.4_a';		
			im_num_p = '.3';
			im_num_a_p = '.3_a';			
		}
		if(count==4)
		{
			title = "<a href='corporate.php'>Leap Corporate</a>";	
			text = "<p>Hotels and other establishments can tap into a valuable source of new income by providing wireless internet throughout their establishment.</p><br/><p>With online payments and easy payment plans make the most of your business space and provide a valuable service for your custmers.  To arrange a site survey for your business, please contact us.</p>";
			image = "images/Banner-Priv.jpg";
			im_num = '.5';
			im_num_a = '.5_a';		
			im_num_p = '.4';
			im_num_a_p = '.4_a';			
		}
		if(count==5)
		{
			title = "<a href='private.php'>Leap Private</a>";	
			text = "<p>Whether you are an individual Wi-Fi user or a group of residentslooking for a hassle free Wi-Fi in your development don't miss the chance to become a part Leap network today.</p><br/><p>Leap provides you with a high quality Wireless Internet without any commitment and obligations.</p><br/><p>FREE installation. FREE maintenance. NO contract. Pay-As-You-Go.</p>";
			image = "images/Banner-home.jpg";	
			im_num = '.6';
			im_num_a = '.6_a';	
			im_num_p = '.5';
			im_num_a_p = '.5_a';
			count=-1;
		}		
		hide();
		
	}
	periodical = fx.periodical(7000); //7000

	$('flash_banner').addEvent("mouseenter", function(){
			$clear(periodical);
			
		});
			//this clears the periodical, and highlights the timer bar
		$('flash_banner').addEvent("mouseleave", function(){
			//fx();
			periodical = fx.periodical(7000);
		});
	}
	});
});