// JavaScript Document
var xmlhttp
var xmlhttpPM
function showProducts()
{
	xmlhttp=GetXmlHttpObject();
	xmlhttpPM=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	xmlhttp.onreadystatechange=stateProductsChanged;
	xmlhttp.open("GET","products.html",true);
	xmlhttp.send(null);
	xmlhttpPM.onreadystatechange=stateProductMenuChanged;
	xmlhttpPM.open("GET","productmenu.html",true);
	xmlhttpPM.send(null);
}
function stateProductsChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("mainright").innerHTML=xmlhttp.responseText;
  }
}
function stateProductMenuChanged()
{
if (xmlhttpPM.readyState==4)
  {
  document.getElementById("prefooterright").innerHTML=xmlhttpPM.responseText;
  }
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
// Intro Picture Slideshow
$(document).ready(function() {
    $('.intro').cycle({
		fx: 'fade', timeout: 1000 // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});
// Main Picture Slideshow
$(document).ready(function() {
    $('.pics').cycle({
		fx: 'fade', random: 1, timeout: 6000 // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
});
// JQuery side menu
$(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings().css({backgroundImage:"url(left.png)"});
	});
});
// Where has your hair been carousel
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        scroll: 5
    });
});
// Carousel captions
$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'152px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagnal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'152px', left:'152px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'100px'},{queue:false,duration:160});
	});
	$('.prodgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'100px'},{queue:false,duration:160});
	});
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
	});
});
