
jQuery.noConflict();
var j$ = jQuery;

j$(document).ready(function(){
	
	pngfix();
	
	j$(function() { 
		j$('#cart-box .open a').click(
			function () {
				j$('#cart-box').stop().animate({width: '181px',height: '474px',paddingRight:'0px'}, 'fast',
						function () {
						j$('#cart-box .col2').stop().animate({opacity: 1}, 'fast');
					}

				);
			}
				
		);
		j$('#cart-box .close a').click(
			function () {
				j$('#cart-box .col2').stop().animate({opacity: 0}, 'fast',
					function () {
						j$('#cart-box').stop().animate({width: '30px',height: '220px',paddingRight:'0px'}, 'fast');
					}
				
				);
			}
				
		);

		j$("#nav ul").treeview({
			persist: "cookie",
			/*animated: "medium",*/
			cookieId: "nh-nav"
		});
	
	
		j$(".nav1 a").hover(function() {
		  j$(this).next("em").animate({opacity:"show", top:"-31"}, "slow");
		},
		function(){
		  j$(this).next("em").animate({opacity:"hide", top:"-41"}, "fast");
		});
		
	
	});
	
	
});

/*  loading
**************************************************************
j$(window).load(function() {
	j$('#loading').fadeOut("slow");
	j$(function(){
		j$('#cart-box .scroll-pane').jScrollPane();
	});


});
*/
/*  zoom
***************************************************************/
j$(function(){
	j$("#zoomArea").imageNavigator(
		{
			areaWidth: 433,
			areaHeight:433,
			draggerStyle:"1px solid #C00",
			navOpacity:.8
		})
})






/*  cart box scrool
***************************************************************/
/*j$(function(){
	j$('#cart-box .scroll-pane').jScrollPane();
});
*/

/*  png pix
***************************************************************/
function pngfix(){ if(navigator.userAgent.match (/MSIE (5\.5|6\.)/)){for(var i=0; i<document.images.length; i++){
	var img = document.images[i];if (img.src.match (/\.png/i)){ var imgStyle = "display:inline-block;";
	if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
	var html = "<span style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'" + img.src + "\', sizingMethod='image');\"></span>";img.outerHTML = html;i = i-1;}}}
}

/*  hidden (nav) under contents 
***************************************************************/
function setPosition() {
	w = (window.innerWidth==undefined ? document.body.clientWidth : window.innerWidth);
	h = (window.innerHeight==undefined ? document.body.clientHeight : window.innerHeight);
	j$(function() {		
		var d  = document.getElementById("wrapper");	
		//var m2 = document.getElementById("main2").offsetHeight;	
		//var n  = document.getElementById("nav").offsetHeight;	
		
		/* initialize scrollable */
		j$("#nav").css({
					'top':'',
					'height':(h-100)+'px',
					'width':'',
					'padding':'',
					'overflow':'hidden',
					'position':''
		});
		
	});
}

function getPosition() {
	setInterval("setPosition()",100);
}

function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}

addEvent(window,"load",getPosition);



