/* jquery.swfobject.license.txt */
(function(A){A.flashPlayerVersion=function(){var D,B=null,I=false,H="ShockwaveFlash.ShockwaveFlash";if(!(D=navigator.plugins["Shockwave Flash"])){try{B=new ActiveXObject(H+".7")}catch(G){try{B=new ActiveXObject(H+".6");D=[6,0,21];B.AllowScriptAccess="always"}catch(F){if(D&&D[0]===6){I=true}}if(!I){try{B=new ActiveXObject(H)}catch(E){D="X 0,0,0"}}}if(!I&&B){try{D=B.GetVariable("$version")}catch(C){}}}else{D=D.description}D=D.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|,)(\d+)/);return[D[1]*1,D[3]*1,D[5]*1]}();A.flashExpressInstaller="expressInstall.swf";A.hasFlashPlayer=(A.flashPlayerVersion[0]!==0);A.hasFlashPlayerVersion=function(C){var B=A.flashPlayerVersion;C=(/string|integer/.test(typeof C))?C.toString().split("."):C;return(C)?(B[0]>=(C.major||C[0]||B[0])&&B[1]>=(C.minor||C[1]||B[1])&&B[2]>=(C.release||C[2]||B[2])):(B[0]!==0)};A.flash=function(M){if(!A.hasFlashPlayer){return false}var C=M.swf||"",K=M.params||{},E=document.createElement("body"),B,L,H,D,J,I,G,F;M.height=M.height||180;M.width=M.width||320;if(M.hasVersion&&!A.hasFlashPlayerVersion(M.hasVersion)){A.extend(M,{id:"SWFObjectExprInst",height:Math.max(M.height,137),width:Math.max(M.width,214)});C=M.expressInstaller||A.flashExpressInstaller;K={flashvars:{MMredirectURL:window.location.href,MMplayerType:(A.browser.msie&&A.browser.win)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}if(M.flashvars&&typeof K==="object"){A.extend(K,{flashvars:M.flashvars})}for(J in (I=["swf","expressInstall","hasVersion","params","flashvars"])){delete M[I[J]]}B=[];for(J in M){if(typeof M[J]==="object"){L=[];for(I in M[J]){L.push(I.replace(/([A-Z])/,"-$1").toLowerCase()+":"+M[J][I]+";")}M[J]=L.join("")}B.push(J+'="'+M[J]+'"')}M=B.join(" ");if(typeof K==="object"){B=[];for(J in K){if(typeof K[J]==="object"){L=[];for(I in K[J]){if(typeof K[J][I]==="object"){H=[];for(G in K[J][I]){if(typeof K[J][I][G]==="object"){D=[];for(F in K[J][I][G]){D.push(F.replace(/([A-Z])/,"-$1").toLowerCase()+":"+K[J][I][G][F]+";")}K[J][I][G]=D.join("")}H.push(G+"{"+K[J][I][G]+"}")}K[J][I]=H.join("")}L.push(window.escape(I)+"="+window.escape(K[J][I]))}K[J]=L.join("&amp;")}B.push('<PARAM NAME="'+J+'" VALUE="'+K[J]+'">')}K=B.join("")}if(!(/style=/.test(M))){M+=' style="vertical-align:text-top;"'}if(!(/style=(.*?)vertical-align/.test(M))){M=M.replace(/style="/,'style="vertical-align:text-top;')}if(A.browser.msie){M+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';K='<PARAM NAME="movie" VALUE="'+C+'">'+K}else{M+=' type="application/x-shockwave-flash" data="'+C+'"'}E.innerHTML="<OBJECT "+M+">"+K+"</OBJECT>";return A(E.firstChild)};A.fn.flash=function(C){if(!A.hasFlashPlayer){return this}var B=0,D;while((D=this.eq(B++))[0]){D.html(A.flash(A.extend({},C)));if(D[0].firstChild.getAttribute("id")==="SWFObjectExprInst"){B=this.length}}return this}}(jQuery));

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 * TERMS OF USE - jQuery Easing
 * Open source under the BSD License. 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE.
*/

jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	}
});

/*
 * TERMS OF USE - EASING EQUATIONS
 * Open source under the BSD License.
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 9/11/2008
 * @author Ariel Flesler
 * @version 1.4
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(h){var m=h.scrollTo=function(b,c,g){h(window).scrollTo(b,c,g)};m.defaults={axis:'y',duration:1};m.window=function(b){return h(window).scrollable()};h.fn.scrollable=function(){return this.map(function(){var b=this.parentWindow||this.defaultView,c=this.nodeName=='#document'?b.frameElement||b:this,g=c.contentDocument||(c.contentWindow||c).document,i=c.setInterval;return c.nodeName=='IFRAME'||i&&h.browser.safari?g.body:i?g.documentElement:this})};h.fn.scrollTo=function(r,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};a=h.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=h(k),d=r,l,e={},p=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(d)){d=n(d);break}d=h(d,this);case'object':if(d.is||d.style)l=(d=h(d)).offset()}h.each(a.axis.split(''),function(b,c){var g=c=='x'?'Left':'Top',i=g.toLowerCase(),f='scroll'+g,s=k[f],t=c=='x'?'Width':'Height',v=t.toLowerCase();if(l){e[f]=l[i]+(p?0:s-o.offset()[i]);if(a.margin){e[f]-=parseInt(d.css('margin'+g))||0;e[f]-=parseInt(d.css('border'+g+'Width'))||0}e[f]+=a.offset[i]||0;if(a.over[i])e[f]+=d[v]()*a.over[i]}else e[f]=d[i];if(/^\d+$/.test(e[f]))e[f]=e[f]<=0?0:Math.min(e[f],u(t));if(!b&&a.queue){if(s!=e[f])q(a.onAfterFirst);delete e[f]}});q(a.onAfter);function q(b){o.animate(e,j,a.easing,b&&function(){b.call(this,r,a)})};function u(b){var c='scroll'+b,g=k.ownerDocument;return p?Math.max(g.documentElement[c],g.body[c]):k[c]}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);

/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 6/3/2008
 * @author Ariel Flesler
 * @version 1.2.6
 **/
;(function($){var g=location.href.replace(/#.*/,''),h=$.localScroll=function(a){$('body').localScroll(a)};h.defaults={duration:1e3,axis:'y',event:'click',stop:1};h.hash=function(a){a=$.extend({},h.defaults,a);a.hash=0;if(location.hash)setTimeout(function(){i(0,location,a)},0)};$.fn.localScroll=function(b){b=$.extend({},h.defaults,b);return(b.persistent||b.lazy)?this.bind(b.event,function(e){var a=$([e.target,e.target.parentNode]).filter(c)[0];a&&i(e,a,b)}):this.find('a,area').filter(c).bind(b.event,function(e){i(e,this,b)}).end().end();function c(){var a=this;return!!a.href&&!!a.hash&&a.href.replace(a.hash,'')==g&&(!b.filter||$(a).is(b.filter))}};function i(e,a,b){var c=a.hash.slice(1),d=document.getElementById(c)||document.getElementsByName(c)[0],f;if(d){e&&e.preventDefault();f=$(b.target||$.scrollTo.window());if(b.lock&&f.is(':animated')||b.onBefore&&b.onBefore.call(a,e,d,f)===!1)return;if(b.stop)f.queue('fx',[]).stop();f.scrollTo(d,b).trigger('notify.serialScroll',[d]);if(b.hash)f.queue(function(){location=a.hash;$(this).dequeue()})}}})(jQuery);

/* wrap scroll inspired from quirksmode.org */
var WPSCROLL={
	init:function(id, mod, offset){
		this.id='#'+id;
		this.target=$(this.id);
		this.mode=mod;
		
		this.initPos=this.target.offset().top;
		
		if (this.mode=='top') {
			this.offset=(window.innerHeight)? window.innerHeight/2 : document.documentElement.clientHeight/2;
			this.target.css({position:'absolute', marginLeft:'910px', top:this.initPos+'px'});
		} else {
			this.offset=5;
		}
		
		window.onscroll = document.documentElement.onscroll = WPSCROLL.countdown;
		WPSCROLL.setMenuOffset();
	},
	countdown:function() {
		if (this.timer) clearInterval(this.timer);
		this.timer=setTimeout('WPSCROLL.setMenuOffset()', 300);
	},
	setMenuOffset:function() {
		var header = WPSCROLL.target;
		if (!header) return;
		var currentOffset = document.documentElement.scrollTop || document.body.scrollTop; // body for Safari
		var startPos=WPSCROLL.initPos || 0;
		var desiredOffset=0;
		
		switch(WPSCROLL.mode) {
			case 'top':
				desiredOffset = (currentOffset>=startPos)? currentOffset+WPSCROLL.offset : startPos;
			break;
			case 'marginTop':
			default:
				desiredOffset = (currentOffset>=startPos)? (currentOffset-startPos)+WPSCROLL.offset : 0;
			break;
		}
		
		var aniobj={};
		aniobj[WPSCROLL.mode]=desiredOffset+'px';
		
		$(WPSCROLL.id).animate(aniobj, 500);
	}
}

/* target: affected target, cn: search class, hname: hover name default 'b' */
var SWAPIMG={
	init:function(){},
	add:function(target, cn, hname) {
		var node=document.getElementById(target);
		var as=node.getElementsByTagName('a');
		var imgs=$('.'+cn, $('#'+target));
		var len=imgs.length; var ext; var ispng=false;
		var src; var hsrc; var hfix=hname || 'b';
		var img; var pfix;
		
		for (var i=0;i<len;i++) {
			img=imgs[i];
			src=img.src;
			ext=src.substr(src.lastIndexOf('.'), src.length);
			ispng=(ext=='.png')? true : false;
			pfix=src.substring(0, src.indexOf(ext));
			hsrc=pfix+hfix+ext;
			
			preloader.add(hsrc);
			SWAPIMG.addOverOut(as[i], img, src, hsrc, ispng);
		}
	},
	addOverOut:function(target, img, src, hsrc, ispng) {
		target.onmouseover=function() {
			img.src=hsrc;
			if (pngfix && ispng) supersleight.exec(img);
		}
		
		target.onmouseout=function() {
			img.src=src;
			if (pngfix && ispng) supersleight.exec(img);
		}
	}
}

var preloader={
	init:function(){
		if (preloader.list) {
			var len=preloader.list.length;
			var cache=[];
			for (var i=0;i<len;i++) {
				cache[i]=new Image();
				cache[i].src=preloader.list[i];
			}
		}
	},
	add:function(src){
		if (!preloader.list) preloader.list=[];
		preloader.list.push(src);
	}
}

function initGallery(){
	$(window).ready(function () {
	  var slideWidth=0;
	  var slideIndex=1;
	  var ga_frame=$('#ga_frame');
	  var targs=$('div.sliderGallery ul li');
	  $('div.sliderGallery ul li:first').addClass('select');
	  if (pngfix) sli.push('slider');
	  
	  targs.each(function(i, ele) {
		slideWidth+=$(this).outerWidth()+parseInt($(this).css('margin-right'));
		
		$(this).hover(function(){
		  $(this).addClass('hover');
		}, function() {
		  $(this).removeClass('hover');
		});
		
		var src=$('img', this).attr('src').replace('s.jpg', '.jpg');
		preloader.add(src);
		
		$(this).click(function(){
		  $('div.sliderGallery ul li:nth-child('+slideIndex+')').removeClass('select');
		  slideIndex=i+1;
		  
		  $(this).addClass('select');
		  
		  ga_frame.fadeOut('fast', function(){
			ga_frame.attr('src', src);
			ga_frame.fadeIn('slow');
		  });
		});
	  });
	  
	  var animating=false;
	  
	  $('div.sliderGallery').each(function () {
		if (targs.length>5) {
		var ul = $('ul', this);
		ul.width(slideWidth);
		var productWidth = ul.innerWidth() - $(this).outerWidth();
		var lastpos=0;
		
		var oncomp=function(){
			animating=false; slider.slider('enable'); if (!$.browser.msie) slider.fadeTo('fast', 1);
		};
		
		var slider = $('.slider').slider({
		  handle: '.handle',
		  min: 0,
		  max: productWidth,
		  animate:true,
		  slide: function (ev, ui) {
			if (!animating) {ul.css('left', '-' + ui.value + 'px'); lastpos=ui.value;}
		  },
		  stop: function (ev, ui) {
			if (!animating && ui.value!=lastpos) {
			  animating=true;
			  slider.slider('disable');
			  if (!$.browser.msie) slider.fadeTo('fast', 0.33);
			  ul.animate({ 'left' : '-' + ui.value + 'px' }, 500, 'easeInOutQuad', oncomp);
			}
		  }
		});
		} else {
		  if (!$.browser.msie) $('.slider').fadeTo('fast', 0.33);
		  else $('.slider').hide();
		}
	  });
	  
	});
}

function initComp(){
	$(window).ready(function () {
	  var slideWidth=0;
	  
	  $('div.cp_photo ul li').each(function(i, ele) {
		slideWidth+=$(this).outerWidth()+parseInt($(this).css('margin-right'));
	  });
	  
	  var animating=false;
	  
	  $('div.slider').each(function () {
		$('.cp_slider').width(slideWidth);
		
		var productWidth = slideWidth - $(this).outerWidth();
		var lastpos=0;
		
		var oncomp=function(){
			animating=false; slider.slider('enable'); if (!$.browser.msie) slider.fadeTo('fast', 1);
		};
		
		var stepping=188;
		var va=0;
		
		var slider = $('.slider').slider({
		  handle: '.handle',
		  min: 0,
		  max: productWidth,
		  animate:true,
		  //stepping:188,
		  slide: function (ev, ui) {
			if (!animating) {
				va=Math.round((ui.value/stepping))*stepping;
				//$('.cp_slider').css('left', '-' + ui.value + 'px'); lastpos=ui.value;
				$('.cp_slider').css('left', '-' + va + 'px'); lastpos=va;
			}
		  },
		  stop: function (ev, ui) {
			  va=Math.round((ui.value/stepping))*stepping;
			  
			//if (!animating && ui.value!=lastpos) {
			if (!animating && va!=lastpos) {
			  animating=true;
			  slider.slider('disable');
			  if (!$.browser.msie) slider.fadeTo('fast', 0.33);
			  
			  //va=Math.round((ui.value/stepping))*stepping;
			  //$('.cp_slider').animate({ 'left' : '-' + ui.value + 'px' }, 500, 'easeInOutQuad', oncomp);
			  $('.cp_slider').animate({ 'left' : '-' + va + 'px' }, 500, 'easeInOutQuad', oncomp);
			}
		  }
		});
	  });
	  
	});
}

function initIndexTab() {
	$(window).ready(function () {
	  var slideWidth=0;
	  var cursor=0;
	  var vcursor=4;
	  var vcount=4;
	  
	  var ul=$('div.is_tab ul');
	  var conts=$('div.is_cont div');
	  var offset=null;
	  
	  $(conts[0]).show();
	  var target=$('div.is_tab ul li:first-child');
	  target.addClass('hover');
	  
	  
	  //$('div.is_tab ul li:last-child').css('margin-right', '0');
	  var vlen=$('div.is_tab ul li').length;
	  vcursor=vcount;
	  
	  $('div.is_tab ul li').each(function(i, ele) {
		if (!offset) offset=$(this).outerWidth()+parseInt($(this).css('margin-right'));
		slideWidth+=$(this).outerWidth()+parseInt($(this).css('margin-right'));
		
		//hover effect
		$(this).mouseover(
		  function(){
			if (cursor!=i) {
				$(this).addClass('hover');
				
				$(conts[cursor]).hide();
				target.removeClass('hover');
				
				cursor=i;
				target=$(this);
				
				$(conts[cursor]).show();
			}
		  }
		);
	  });
	  
	  ul.width(slideWidth);
	  
	  var dest=0;
	  
	  $('.is_arrl').click(function(){
	    if (vcursor>vcount) {
		  vcursor--;
		  dest=offset*(vcursor-vcount);
		  //$(ul).css('margin-left', '-'+dest+'px');
		  $(ul).animate({ marginLeft : '-' + dest + 'px' }, 300);
		}
	  });
	  
	  $('.is_arrr').click(function(){
	    if (vcursor<vlen) {
		  vcursor++;
		  dest=offset*(vcursor-vcount);
		  //$(ul).css('margin-left', '-'+dest+'px');
		  $(ul).animate({ marginLeft : '-' + dest + 'px' }, 300);
		}
	  });
	  
	});
}

function ieLayerFix(){
	$(document).ready(function() {
	  $('div.nav_sub').append('<iframe></iframe>');
	});
}

var jumpMenu={
	init:function(){
		$(document).ready(function() {
		  var sel=$('.jumpMenu');
		  sel.change(function(){
		    //window.location.href=sel.val();
			window.location.href=sel.val()==0?'buy.php':'buy.php?id='+sel.val();
		  });
		});
	}
}

var pngfix=false;
var initpage=null;
/* jquery 1.2.6 */
$(document).ready(function() {
	var locmenu=$('#loc_menu');
	var op=function(){locmenu.slideToggle('normal');};
	
	$('#qlc_btn').click(op);
	$('#qlc_close').click(op);
	
	if (initpage) initpage();
	preloader.init();
	$.localScroll({easing:'easeInOutQuad', duration:800});
});

