/* Author: lisianne.com */
/* jQuery functions to add interactivity/behavior to DiraAtelier*/

/* ABOUT US */
$(function(){
	$('p#mouseClickDian').css("display", "none");
	$('p#mouseClickKiera').css("display", "none");											 
      });
  
  $(function(){
        $('img#dianThumb').bind('mouseover',function(event) {
		$(this).attr("src","images/DianAltThumb.jpg");
	$('p#mouseOverDian').css("display", "none");
	$('p#mouseClickDian').css("display", "block");											 
		  return false;
	      });
      });
  
  $(function(){
        $('img#dianThumb').bind('mouseout',function(event) {
		$(this).attr("src","images/AboutDianThumb.jpg");
		$('p#mouseOverDian').css("display", "block");
	$('p#mouseClickDian').css("display", "none");												 
		  return false;
	      });
      });
  
  $(function(){
        $('img#kieraThumb').bind('mouseover',function(event) {
		$(this).attr("src","images/KieraAltThumb.jpg");
	$('p#mouseOverKiera').css("display", "none");
	$('p#mouseClickKiera').css("display", "block");											 
		  return false;
	      });
      });
  
  $(function(){
        $('img#kieraThumb').bind('mouseout',function(event) {
	$(this).attr("src","images/AboutKieraThumb.jpg");
		$('p#mouseOverKiera').css("display", "block");
	$('p#mouseClickKiera').css("display", "none");
	return false;
	      });
      });
  
/* PRODUCT PAGE */
	$(function(){
        $('#productThumb a').add('#altviews a').lightBox({
		fixedNavigation:true,
	overlayBgColor: '#fff',
	overlayOpacity: 0.6,
	containerBorderSize: 20
   })
   });
   

	
      $(function(){
        $('.thumb img')
          .bind('click',function(event) {
		  var altSrc=changeToMedium(this.src);
		  $('#productThumb img').attr('src', altSrc);
		  var altHref=changeToLarge(this.src);
		  $('#productThumb a').attr('href', altHref);
		  var altFormat=this.alt;
		  $('#productThumb img').attr('class', altFormat );
		  return false;
		    })
      });
	  
	  $(function(){
        $('a#careInstructions')
          .bind('click',function(event) {
		  openWindow('careInstructions.html', 860, 800);
		  return false;
		  
		    })
      });
	  
	  $(function(){
        $('a#sizechart')
          .bind('click',function(event) {
		  openWindow('sizechart.html', 860, 700);
		  return false;
		  
		    })
      });
	  
function openWindow(url, w, h) {
    var options = "width=" + w + ",height=" + h + ",";
    options += "resizable=yes,scrollbars=yes,status=no,";
    options += "menubar=yes,toolbar=no,location=no,directories=no";
    var newWin = window.open(url, 'newWin', options);
    newWin.focus();
  }

	  
	  function changeToMedium(text) {
      return text.replace("Crop", "Medium").replace("product/crop","product/medium");
      }
	  function changeToLarge(text) {
      return text.replace("Crop", "Large").replace("product/crop","product/large");
      }

/* Horizontal Navigation Menu  IE6*/
/* -------------                  */

function FN_mv() {
	this.className+=" hover";
}
function FN_mt() {
	this.className=this.className.replace(/ hover/,"");
}
function FN_initMnC(m) {
	var menu,lis=[];
	menu= document.getElementById(m);
	if (menu) lis = menu.getElementsByTagName("li");
	for (var x=0;x<lis.length;x++) {
		lis[x].onmouseover=FN_mv;
		lis[x].onmouseout=FN_mt;
	}
}


/* Sizechart */

