
var dom = {};
dom.query = jQuery.noConflict(true);

setInterval(overview, 5000);

var max 	 = 4;
var min 	 = 1;
var selected = 1;
var next 	 = 2;

function overview ()
{


	  dom.query(".overview" + selected).slideUp('slow');
	  dom.query(".overview" + next).slideDown('slow');

   	if(selected < 4 || next < 4)
   	{
	  if(selected != 4)
	  {
		  selected = selected + 1;
	  }
	  else
	  {
		selected = 1;
	  }
	  next 	   = selected + 1;
   	}
   	else
   	{
	  selected = 4;
	  next 	   = 1;
	  overview();
   	}


}

dom.query(function()
{


	dom.query("#aboutus").click(function(event) {
		event.preventDefault();
		dom.query("#aboutussub").show('slow');
		dom.query("#ourservicelinksub").hide('slow');
		dom.query("#ourcustomersub").hide('slow');

		dom.query("#proudctssub").hide('slow');
		dom.query("#faqsub").hide('slow');
	});

	dom.query("#ourservicelink").click(function(event) {
		event.preventDefault();
		dom.query("#ourservicelinksub").show('slow');
		dom.query("#aboutussub").hide('slow');
		dom.query("#ourcustomersub").hide('slow');
		dom.query("#proudctssub").hide('slow');
		dom.query("#faqsub").hide('slow');
	});

	dom.query("#ourcustomer").click(function(event) {
		event.preventDefault();
		dom.query("#ourcustomersub").show('slow');
		dom.query("#aboutussub").hide('slow');
		dom.query("#ourservicelinksub").hide('slow');
		dom.query("#proudctssub").hide('slow');
		dom.query("#faqsub").hide('slow');
	});

	dom.query("#faq").click(function(event) {
		event.preventDefault();
		dom.query("#faqsub").show('slow');
		dom.query("#aboutussub").hide('slow');
		dom.query("#ourservicelinksub").hide('slow');
		dom.query("#ourcustomersub").hide('slow');
		dom.query("#proudctssub").hide('slow');
	});

	dom.query("#proudcts").click(function(event) {
		event.preventDefault();
		dom.query("#proudctssub").show('slow');
		dom.query("#aboutussub").hide('slow');
		dom.query("#ourservicelinksub").hide('slow');
		dom.query("#ourcustomersub").hide('slow');
		dom.query("#faqsub").hide('slow');
	});

	dom.query("#faq").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);

	dom.query("#proudcts").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);


	dom.query("#ourcustomer").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);

	dom.query("#ourservicelink").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);
	
	dom.query("#datalink").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);	
	
dom.query("#datalink1").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);	
	dom.query("#mainlink").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);

	dom.query("#aboutus").hover(
	  function () {

		dom.query(this).fadeOut(100);
		dom.query(this).fadeIn(500);
		dom.query(this).css("background-position","0px bottom");
	  },
	  function () {

		dom.query(this).css("background-position","0px top");
	  }
	);



});

dom.query(window).load(function() {
	dom.query('#Slider').JSlider({ pauseTime:5000, pauseOnHover:false });
});

dom.query(document).ready(function(){
			dom.query("#nav-one li").hover(
				function(){ dom.query("ul", this).fadeIn("fast"); },
				function() { }
			);
	  	if (document.all) {
				dom.query("#nav-one li").hoverClass ("sfHover");
			}
	  });

		dom.query.fn.hoverClass = function(c) {
			return this.each(function(){
				dom.query(this).hover(
					function() { dom.query(this).addClass(c);  },
					function() { dom.query(this).removeClass(c); }
				);
			});
		};
