/**
 * @author gdimousis
 */

 $(document).ready(function(){
        $('.slide').hide();
		 $('.show_first .slide:first').show();
		 $('.show_first .slider:first').addClass("active");
 	var flv="http://www.ontelecoms.com/onv/";
	
		
				 
		 
		 $('li.slider').click(function(){
			if($(this).hasClass('active')){
				 $(this).removeClass('active');
				$(this).find('.slide').slideUp(600);
			}else{
				 $(this).addClass('active');
				$(this).find('.slide').slideDown(500);
			}
		 })
                
         
         
         $('li.slider .slide').toggle(function(e){
         
         }, function(e){
         
         })
          $('li.slider .slide a').click(function(){
		  	window.location=$(this).attr('href');
         })
	
	
	
	$("#tabs, #tabs2").tabs({selected: 0});

           
	
	$('#subnav .gbox').hover(function(){
		$(this).find('ul:first').fadeIn(200);
	}, function(){
		$(this).find('ul:smenu').fadeOut(300);
	})
	
	
	$('#subnav .gbox li').hover(function(){
		$(this).find('ul:first').fadeIn(200);
	}, function(){
		$(this).find('ul:smenu').fadeOut(300);
	})
        
     $('.block').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	})

	/* $('#flash_big').flash(
            { src: flv+'flash/onfriends2.swf',
             wmode:'transparent',
              width: 500,
              height: 150 },
            { version: 9 }
        );
	
	 $('#banner').flash(
            { src: flv+'flash/510x245_01.swf',
            wmode:'transparent',
              width: 510,
              height: 245 },
            { version: 9 }
        );*/
        
            
	
	
	/* $('#ontv').flash(
            { src: flv+'flash/ontv2.swf',
             wmode:'transparent',
              width: 311,
              height: 175 },
            { version: 9 }
        );
        
        $('#adv').flash(
             { src: 'http://www.on.gr/on/flash/promo.swf',
             wmode:'transparent',
              width: 410,
              height: 350 },
            { version: 9 }
        );
        
      */
        
	$('#registration').hover(function(){
		var normal = $(this).attr('src');
		var hover = normal.replace('registration.jpg','registration_green.jpg');
		$(this).attr('src', hover);
	}, function(){
		var hover = $(this).attr('src');
		var normal = hover.replace('registration_green.jpg','registration.jpg');
		$(this).attr('src', normal);
	})
        
    $('#registration2').hover(function(){
		var normal = $(this).attr('src');
		var hover = normal.replace('registration2.jpg','registration_green2.jpg');
		$(this).attr('src', hover);
	}, function(){
		var hover = $(this).attr('src');
		var normal = hover.replace('registration_green2.jpg','registration2.jpg');
		$(this).attr('src', normal);
	})
	
	$('.online').hover(function(){
		var normal = $(this).attr('src');
		var hover = normal.replace('online.jpg','online_hover.jpg');
		$(this).attr('src', hover);
	}, function(){
		var hover = $(this).attr('src');
		var normal = hover.replace('online_hover.jpg','online.jpg');
		$(this).attr('src', normal);
	})
	
	$('.online_offer').hover(function(){
		var normal = $(this).attr('src');
		var hover = normal.replace('online_offer.jpg','online_offer_hover.jpg');
		$(this).attr('src', hover);
	}, function(){
		var hover = $(this).attr('src');
		var normal = hover.replace('online_offer_hover.jpg','online_offer.jpg');
		$(this).attr('src', normal);
	})
	
	
	
        
       /* var count=0;
        var pages=$('.res').length;
        function changePage(count){
        $('.res').each(function(i){
        
                if (i!=count){
                    $(this).hide();
                }else{
                    $(this).show();
                    textPage= i+1+" / "+pages
                    $('#Pagination span').html(textPage);
                }
                
        
        })
        
        }
        
        $('.prev').click(function(){
            if (count>=1){
                count--;
                changePage(count);
                $(this).removeClass('current');
            }else{
                $(this).addClass('current');
                $('.next').removeClass('current');
            }
        
        })
        
        
         $('.next').click(function(){
            if (count < pages-1){
                count++;
                changePage(count);
                 $(this).removeClass('current');
            }else{
                $(this).addClass('current');
                 $('.prev').removeClass('current');
            }
        
        })
        
        
        changePage(count);*/
        
        
        

	
	

 })
