jQuery(document).ready(
	function() {
		jQuery('html').css('height', jQuery('#header').css('height'));
		jQuery(document).pngFix();
		jQuery('#catalog li[name!=logo]').hover(
			function() {
				jQuery(this).addClass('cat-active');
			}, function() {
				jQuery(this).removeClass('cat-active');
			}
		);
		jQuery('div.but').click(
			function() {
				var id = jQuery(this).attr('id').substr(3);
				jQuery('#submenu'+ id).show();
			}
		);
		jQuery('.submenu li').hover(
			function() {
				jQuery(this).addClass('menu-active');
			}, function() {
				jQuery(this).removeClass('menu-active');
			}
		).click(
			function() {
				var text = jQuery(this).text();
				var id = jQuery(this).parent().attr('id').substr(7);
				jQuery('#but'+id).find('span').text(text);
				jQuery(this).parent().hide();
			}
		);
		/*
		if(jQuery('div.window').length > 0) {
			//Set Default State of each portfolio piece
			jQuery(".paging").show();
			jQuery(".paging a:first").addClass("active");
				
			//Get size of images, how many there are, then determin the size of the image reel.
			var imageWidth = jQuery(".window").width();
			var imageSum = jQuery(".image_reel img").size();
			var imageReelWidth = imageWidth * imageSum;
			
			//Adjust the image reel to its new size
			jQuery(".image_reel").css({'width' : imageReelWidth});
			
			//Paging + Slider Function
			rotate = function(){	
				var triggerID = jQueryactive.attr("rel") - 1; //Get number of times to slide
				var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
		 
				jQuery(".paging a").removeClass('active'); //Remove all active class
				jQueryactive.addClass('active'); //Add active class (the jQueryactive is declared in the rotateSwitch function)
				
				var pos = 34*triggerID + 'px';
				jQuery('.paging').animate({backgroundPosition: pos}, 500);
				
				//Slider Animation
				jQuery(".image_reel").animate({ 
					left: -image_reelPosition
				}, 500 );
				
			}; 
			
			//Rotation + Timing Event
			rotateSwitch = function(){		
				play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
					jQueryactive = jQuery('.paging a.active').next();
					if ( jQueryactive.length === 0) { //If paging reaches the end...
						jQueryactive = jQuery('.paging a:first'); //go back to first
					}
					rotate(); //Trigger the paging and slider function
				}, 7000); //Timer speed in milliseconds (3 seconds)
			};
			
			rotateSwitch(); //Run function on launch
			
			//On Hover
			jQuery(".image_reel a").hover(function() {
				clearInterval(play); //Stop the rotation
			}, function() {
				rotateSwitch(); //Resume rotation
			});	
			
			//On Click
			jQuery(".paging a").click(function() {	
				jQueryactive = jQuery(this); //Activate the clicked paging
				//Reset Timer
				clearInterval(play); //Stop the rotation
				rotate(); //Trigger rotation immediately
				rotateSwitch(); // Resume rotation
				return false; //Prevent browser jump to link anchor
			});	
			
		}
		*/
		if(jQuery('#si_promo').length > 0) {
			jQuery(".si_wrap a:first").addClass("si_active");
			//Get size of images, how many there are, then determin the size of the image reel.
			var imageWidth = jQuery('.si_scins').width();
			var imageSum = jQuery(".si_wrap img").size();
			var imageReelWidth = imageWidth * imageSum;
			//Adjust the image reel to its new size
			jQuery(".si_wrap").css({'width' : imageReelWidth});
			//Paging + Slider Function
			rotate = function(){	
				var triggerID = jQueryactive.attr("rel") - 1; //Get number of times to slide
				var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
		 
				jQuery(".si_buttons a").removeClass('active'); //Remove all active class
				jQueryactive.addClass('active'); //Add active class (the jQueryactive is declared in the rotateSwitch function)
				
				var pos = (5+(30*triggerID+5*triggerID)) + 'px';
				jQuery('.si_buttons').animate({backgroundPosition: pos}, 500);
				
				//Slider Animation
				jQuery(".si_wrap").animate({ 
					marginLeft: -image_reelPosition
				}, 500 );
				
			}; 
			
			//Rotation + Timing Event
			rotateSwitch = function(){		
				play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
					jQueryactive = jQuery('.si_buttons a.active').next();
					if ( jQueryactive.length === 0) { //If paging reaches the end...
						jQueryactive = jQuery('.si_buttons a:first'); //go back to first
					}
					rotate(); //Trigger the paging and slider function
				}, 7000); //Timer speed in milliseconds (3 seconds)
			};
			
			rotateSwitch(); //Run function on launch
			
			//On Hover
			jQuery(".si_wrap a").hover(function() {
				clearInterval(play); //Stop the rotation
			}, function() {
				rotateSwitch(); //Resume rotation
			});	
			
			//On Click
			jQuery(".si_buttons a").click(function() {	
				jQueryactive = jQuery(this); //Activate the clicked paging
				//Reset Timer
				clearInterval(play); //Stop the rotation
				rotate(); //Trigger rotation immediately
				rotateSwitch(); // Resume rotation
				return false; //Prevent browser jump to link anchor
			});	
			
			
		}
		jQuery('#slider div.belt div.panel img').hover(
			function() {
				switch(jQuery(this).attr('class')) {
					case 'pos1': topx = '10px'; leftx = '0px'; break;
					case 'pos2': topx = '10px'; leftx = '200px'; break;
					case 'pos3': topx = '10px'; leftx = '390px'; break;
					case 'pos4': topx = '10px'; leftx = '590px'; break;
					case 'pos5': topx = '240px'; leftx = '0px'; break;
					case 'pos6': topx = '240px'; leftx = '200px'; break;
					case 'pos7': topx = '240px'; leftx = '390px'; break;
					case 'pos8': topx = '240px'; leftx = '590px'; break;
					case 'pos9': topx = '470px'; leftx = '0px'; break;
					case 'pos10': topx = '470px'; leftx = '200px'; break;
					case 'pos11': topx = '470px'; leftx = '390px'; break;
					case 'pos12': topx = '470px'; leftx = '590px'; break;
				}
				jQuery(this).css('z-index', '10');
				jQuery(this).stop().animate({top: topx, left: leftx, width: '240px', height: '285px'}, 0);	
			}, function() {
				switch(jQuery(this).attr('class')) {
					case 'pos1': topx = '40px'; leftx = '30px'; break;
					case 'pos2': topx = '40px'; leftx = '230px'; break;
					case 'pos3': topx = '40px'; leftx = '420px'; break;
					case 'pos4': topx = '40px'; leftx = '630px'; break;
					case 'pos5': topx = '270px'; leftx = '30px'; break;
					case 'pos6': topx = '270px'; leftx = '230px'; break;
					case 'pos7': topx = '270px'; leftx = '420px'; break;
					case 'pos8': topx = '270px'; leftx = '640px'; break;
					case 'pos9': topx = '500px'; leftx = '30px'; break;
					case 'pos10': topx = '500px'; leftx = '230px'; break;
					case 'pos11': topx = '500px'; leftx = '420px'; break;
					case 'pos12': topx = '500px'; leftx = '620px'; break;
				}
				jQuery(this).css('z-index', '1');
				jQuery(this).stop().animate({top: topx, left: leftx, width: '180px', height: '220px'}, 0);	
			}
		);
		/*jQuery('#slider div.belt div.panel div').hover(
			function() {
				var src = jQuery(this).css('background');
				src = src.replace('.png','_big.png');
				jQuery(this).css('background', src);
				switch(jQuery(this).attr('class')) {
					case 'pos1': topx = '10px'; leftx = '0px'; break;
					case 'pos2': topx = '10px'; leftx = '200px'; break;
					case 'pos3': topx = '10px'; leftx = '390px'; break;
					case 'pos4': topx = '10px'; leftx = '590px'; break;
					case 'pos5': topx = '240px'; leftx = '0px'; break;
					case 'pos6': topx = '240px'; leftx = '200px'; break;
					case 'pos7': topx = '240px'; leftx = '390px'; break;
					case 'pos8': topx = '240px'; leftx = '590px'; break;
					case 'pos9': topx = '470px'; leftx = '0px'; break;
					case 'pos10': topx = '470px'; leftx = '200px'; break;
					case 'pos11': topx = '470px'; leftx = '390px'; break;
					case 'pos12': topx = '470px'; leftx = '590px'; break;
				}
				jQuery(this).animate({top: topx, left: leftx, width: '240px', height: '285px'});	
			}, function() {
				var src = jQuery(this).css('background');
				src = src.replace('_big.png','.png');
				jQuery(this).css('background', src);
				switch(jQuery(this).attr('class')) {
					case 'pos1': topx = '40px'; leftx = '30px'; break;
					case 'pos2': topx = '40px'; leftx = '230px'; break;
					case 'pos3': topx = '40px'; leftx = '420px'; break;
					case 'pos4': topx = '40px'; leftx = '630px'; break;
					case 'pos5': topx = '270px'; leftx = '30px'; break;
					case 'pos6': topx = '270px'; leftx = '230px'; break;
					case 'pos7': topx = '270px'; leftx = '420px'; break;
					case 'pos8': topx = '270px'; leftx = '640px'; break;
					case 'pos9': topx = '500px'; leftx = '30px'; break;
					case 'pos10': topx = '500px'; leftx = '230px'; break;
					case 'pos11': topx = '500px'; leftx = '420px'; break;
					case 'pos12': topx = '500px'; leftx = '620px'; break;
				}
				jQuery(this).animate({top: topx, left: leftx, width: '180px', height: '285px'});	
			}
		);*/
	}
);
function showAuth() {
	var obj = jQuery('#auth-fields');
	if(obj.is(':hidden'))
		obj.fadeIn(300);
	else
		obj.fadeOut(200);
	return false;
}
// Show alert message
function showAlert( content )
{
	var e = $("<div id='alert_text' class='popup'></div>");
	$('body').append(e);
	$('#alert_text').html(content);
	$('#alert_text').css({'opacity':'0', 'display':'block'});
	$('.sh-bg').css({'opacity':'0', 'display':'block'});
	$('.sh-bg').animate({
		opacity: 1
	}, 150, function(){
		$('#alert_text').animate({
			opacity: 1
		}, 150, function(){
			$(".popup-close").click(function(){
				hideAlert();
			});
		});
	});
}

// Hide alert message
function hideAlert()
{
	$('.sh-bg').animate({
		opacity: 0
	}, 150, function(){
		$('#alert_text').animate({
			opacity: 0
		}, 150, function(){
			$('#alert_text').remove();
			$('.sh-bg').hide();
		});
	});
}

eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[njQuery=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[njQuery=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))
