$(document).ready(function(){

// slider
	$('.slider-container').cycle({ 
    fx:     'scrollHorz', 
    speed:  900, 
    timeout: 4500, 
    next:   '.next', 
    prev:   '.prev',
    easing: 'bounceout', 
    delay:  -2000 
});

// slider-iframe
	$('.iframeBottom .slider-container').cycle({ 
    fx:     'scrollHorz', 
    speed:  900, 
    timeout: 4500, 
    next:   '.next', 
    prev:   '.prev',
    easing: 'bounceout', 
    delay:  -2000 
});

// tool-tip
$.fn.qtip.styles.cubz = { // Last part is the name of the style
   background: '#ffcb00',
   color: '#846700',
   fontWeight: 'bold',
   textAlign: 'center',
   border: {
      radius: 5,
      color: '#ffcb00'
   },
   name: 'cream' // Inherit the rest of the attributes from the preset dark style
}

$('.characters .lion').qtip({
   content: 'Wanna play?',
   show: 'mouseover',
   hide: 'mouseout',
   style: {tip:true, name:'cubz'},
   position: {
      corner: {
         target: 'topLeft',
         tooltip: 'bottomRight'
      }
   }
});

$('.characters .hipo').qtip({
   content: 'Hello!!!',
   show: 'mouseover',
   hide: 'mouseout',
   style: { name: 'cubz', tip: true },
   position: {
      corner: {
         target: 'topRight',
         tooltip: 'bottomLeft'
      }
   }
});

$('.characters .car').qtip({
   content: 'VROOM!!!',
   show: 'mouseover',
   hide: 'mouseout',
   style: { name: 'cubz', tip: true },
   position: {
      corner: {
         target: 'topLeft',
         tooltip: 'bottomRight'
      }
   }
});

$('.characters .birdy').qtip({
   content: 'Get a Quote!',
   show: 'mouseover',
   hide: 'mouseout',
   style: { name: 'cubz', tip: true },
   position: {
      corner: {
         target: 'topLeft',
         tooltip: 'bottomRight'
      }
   }
});

$('.characters .giraffe').qtip({
   content: 'Feed Me!!!',
   show: 'mouseover',
   hide: 'mouseout',
   style: { name: 'cubz', tip: true },
   position: {
      corner: {
         target: 'topLeft',
         tooltip: 'bottomRight'
      }
   }
});

// upload file
function selectFile() {  
    document.forms[0].file1.click();  
} 


// fade	
	$(".clients img").hover(
	function() {
	//$(this).stop().animate({"opacity": "0"}, "fast");
	$(this).css('opacity', '0');
	},
	function() {
	//$(this).stop().animate({"opacity": "1"}, "fast");
	$(this).css('opacity', '1');
	});
	
	$(".box").hover(
	function() {
	//$(".description", this).stop().animate({"marginTop": "0"}, "fast");
	$(".description", this).css('marginTop', '0px');
	},
	function() {
	//$(".description", this).stop().animate({"marginTop": "178"}, "fast");
	$(".description", this).css('marginTop', '205px');
	});	
	
//ColorBox
	$(".iframe").colorbox({width:"930px", height:"615px", iframe:true});
	$(".quoteFrame").colorbox({width:"600px", height:"820px", iframe:true});
	$(".designerFrame").colorbox({width:"600px", height:"930px", iframe:true});
	$(".programatorFrame").colorbox({width:"600px", height:"530px", iframe:true});



	// change background depending on user's time

  datetoday = new Date();
  timenow = datetoday.getTime();
  datetoday.setTime(timenow);
  thehour = datetoday.getHours();

  if (thehour >= 18)
    $('body').addClass('night');
  else if (thehour >= 15)
    $('body').addClass('day');
  else if (thehour >= 12)
    $('body').addClass('day');
  else if (thehour >= 6)
    $('body').addClass('day');
  else if (thehour >= 0)
    $('body').addClass('night');
  else
    $('body').addClass('general');
	
   if (thehour >= 18)
    $('.cloud6').addClass('moon');
  else if (thehour >= 15)
    $('.cloud6').addClass('sun');
  else if (thehour >= 12)
    $('.cloud6').addClass('sun');
  else if (thehour >= 6)
    $('.cloud6').addClass('sun');
  else if (thehour >= 0)
    $('.cloud6').addClass('moon');
  else
    $('.cloud6').addClass('sun');
	
  if (thehour >= 18)
    $('.cloud6-inner').addClass('moon');
  else if (thehour >= 15)
    $('.cloud6-inner').addClass('sun');
  else if (thehour >= 12)
    $('.cloud6-inner').addClass('sun');
  else if (thehour >= 6)
    $('.cloud6-inner').addClass('sun');
  else if (thehour >= 0)
    $('.cloud6-inner').addClass('moon');
  else
    $('.cloud6-inner').addClass('sun');

	/*
	function mouseXY()
	{
	var X = event.clientX;
	var Y = event.clientY;

	document.getElementById(".movingDiv").style.top=X;
	document.getElementById(".movingDiv").style.left=Y;
	}

	window.onload=mouseXY;*/

resize();
$(window).resize(function(){resize();})	
});
function resize(){
	if($("#header").width()>$(window).width()){
	$('#middle-bottom, #middle-top, #footer').width($("#header").width())
	}else {$('#middle-bottom, #middle-top, #footer').width('100%')}
	}

