/*
	SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>

	jQuery v1.2.6 <http://jquery.com/>
	Copyright (c) 2008 John Resig
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
	This software is released under the GPL License <http://www.opensource.org/licenses/gpl-2.0.php>

	jQuery SWFObject Plugin v1.0.3 <http://jquery.thewikies.com/swfobject/>
	Copyright (c) 2008 Jonathan Neal
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
	This software is released under the GPL License <http://www.opensource.org/licenses/gpl-2.0.php>

*/

(function(A){A.swfobject=function(){var X="undefined",Q="object",D="Shockwave Flash",e="ShockwaveFlash.ShockwaveFlash",V="application/x-shockwave-flash",J="SWFObjectExprInst",H=window,d=document,M=navigator,I=[],L=[],U=[],K=null,S=null,E=false,Z,T,F,b,a,R,G,Y,C,P,O,B,W,c,N;Z=function(){var k=typeof d.getElementById!==X&&typeof d.getElementsByTagName!==X&&typeof d.createElement!==X,q=[0,0,0],l=null;if(typeof M.plugins!==X&&typeof M.plugins[D]===Q){l=M.plugins[D].description;if(l&&!(typeof M.mimeTypes!==X&&M.mimeTypes[V]&&!M.mimeTypes[V].enabledPlugin)){l=l.replace(/^[\S|\s]*\s+(\S+\s+\S+$)/,"$1");q[0]=parseInt(l.replace(/^([\S|\s]*)\.[\S|\s]*$/,"$1"),10);q[1]=parseInt(l.replace(/^[\S|\s]*\.([\S|\s]*)\s[\S|\s]*$/,"$1"),10);q[2]=/r/.test(l)?parseInt(l.replace(/^[\S|\s]*r([\S|\s]*)$/,"$1"),10):0}}else{if(typeof H.ActiveXObject!==X){var m=null,n=false;try{m=new ActiveXObject(e+".7")}catch(j){try{m=new ActiveXObject(e+".6");q=[6,0,21];m.AllowScriptAccess="always"}catch(i){if(q[0]===6){n=true}}if(!n){try{m=new ActiveXObject(e)}catch(h){}}}if(!n&&m){try{l=m.GetVariable("$version");if(l){l=l.split(" ")[1].split(",");q=[parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]}}catch(f){}}}}var o=M.userAgent.toLowerCase(),g=M.platform.toLowerCase();return{w3cdom:k,pv:q,webkit:jQuery.browser.safari?jQuery.browser.version:false,ie:jQuery.browser.msie,win:g?/win/.test(g):/win/.test(o),mac:g?/mac/.test(g):/mac/.test(o)}}();A(function(){var h=I.length;for(var f=0;f<h;f++){var j=I[f].id;if(Z.pv[0]>0){var g=A("#"+j);if(g.length){I[f].width=g.attr("width")?g.attr("width"):"0";I[f].height=g.attr("height")?g.attr("height"):"0";if(O(I[f].swfVersion)){if(Z.webkit&&Z.webkit<312){T(g[0])}W(j,true)}else{if(I[f].expressInstall&&!E&&O("6.0.65")&&(Z.win||Z.mac)){F(I[f])}else{b(g[0])}}}}else{W(j,true)}}});T=function(k){k=A(k);var g=k.find("object");if(g.length){var j=A("<embed />"),f=g[0].attributes;if(f){for(var h=0;h<f.length;h++){j.attr((f[h].nodeName==="DATA")?"src":f[h].nodeName,f[h].nodeValue)}}g.children().each(function(){if(this.nodeType===1&&this.nodeName==="PARAM"){j.attr(A(this).attr("name"),A(this).attr("value"))}});k.replaceWith(j)}};F=function(k){E=true;var i=A("#"+k.id);if(i.length){if(k.altContentId){var m=A("#"+k.altContentId)[0];if(m){K=m;S=k.altContentId}}else{K=a(i[0])}if(!/%$/.test(k.width)&&parseInt(k.width,10)<310){k.width="310"}if(!/%$/.test(k.height)&&parseInt(k.height,10)<137){k.height="137"}d.title=d.title.slice(0,47)+" - Flash Player Installation";var n=Z.ie&&Z.win?"ActiveX":"PlugIn",f=d.title,g="MMredirectURL="+H.location+"&MMplayerType="+n+"&MMdoctitle="+f,l=k.id;if(Z.ie&&Z.win&&i[0].readyState!==4){l+="SWFObjectNew";var h=A('<div id="'+l+'" />');i.before(h);i.css("display","none");var j=function(){i.remove()};P(H,"onload",j)}R({data:k.expressInstall,id:J,width:k.width,height:k.height},{flashvars:g},l)}};b=function(h){h=A(h);if(Z.ie&&Z.win&&h[0].readyState!==4){var g=A("<div/>");h.before(g);g.replaceWith(A(a(h[0])));h.css("display","none");var f=function(){h.remove()};P(H,"onload",f)}else{h.replaceWith(A(a(h[0])))}};a=function(g){g=A(g);var f=A("<div />");if(Z.win&&Z.ie){f.html(g.html())}else{g.find("object").children().each(function(){if(!(this.nodeType===1&&this.nodeName==="PARAM")&&!(this.nodeType===8)){A(this.cloneNode(true)).appendTo(f)}})}return f[0]};R=function(AB,z,g){var f,p=A("#"+g);if(p.length){if(typeof AB.id===X){AB.id=g}if(Z.ie&&Z.win){var AA="";for(var w in AB){if(AB[w]!==Object.prototype[w]){if(w.toLowerCase()==="data"){z.movie=AB[w]}else{if(w.toLowerCase()==="styleclass"){AA+=' class="'+AB[w]+'"'}else{if(w.toLowerCase()!=="classid"){AA+=" "+w+'="'+AB[w]+'"'}}}}}var y="";for(var v in z){if(z[v]!==Object.prototype[v]){y+='<param name="'+v+'" value="'+z[v]+'" />'}}p[0].outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AA+">"+y+"</object>";L[L.length]=AB.id;f=A("#"+AB.id)[0]}else{if(Z.webkit&&Z.webkit<312){var x=A('<embed type="'+V+'" />');for(var u in AB){if(AB[u]!==Object.prototype[u]){if(u.toLowerCase()==="data"){x.attr("src",AB[u])}else{if(u.toLowerCase()==="styleclass"){x.attr("class",AB[u])}else{if(u.toLowerCase()!=="classid"){x.attr(u,AB[u])}}}}}for(var t in z){if(z[t]!==Object.prototype[t]){if(t.toLowerCase()!=="movie"){x.attr(t,z[t])}}}p.replaceWith(x);f=x[0]}else{var h=A('<object type="'+V+'" />');for(var s in AB){if(AB[s]!==Object.prototype[s]){if(s.toLowerCase()==="styleclass"){h.attr("class",AB[s])}else{if(s.toLowerCase()!=="classid"){h.attr(s,AB[s])}}}}for(var q in z){if(z[q]!==Object.prototype[q]&&q.toLowerCase()!=="movie"){G(h[0],q,z[q])}}p.replaceWith(h);f=h[0]}}}return f};G=function(h,f,g){A(h).append(A('<param name="'+f+'" value="'+g+'" />'))};Y=function(g){var f=A("#"+g);if(f&&(f[0].nodeName==="OBJECT"||f[0].nodeName==="EMBED")){if(Z.ie&&Z.win){if(f[0].readyState===4){C(g)}else{H.attachEvent("onload",function(){C(g)})}}else{f.remove()}}};C=function(h){var g=A("#"+h);if(g.length){for(var f in g[0]){if(typeof g[0][f]==="function"){g[0][f]=null}}g.remove()}};P=function(h,f,g){h.attachEvent(f,g);U[U.length]=[h,f,g]};O=function(h){var g=Z.pv,f=h.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)||0;f[2]=parseInt(f[2],10)||0;return(g[0]>f[0]||(g[0]===f[0]&&g[1]>f[1])||(g[0]===f[0]&&g[1]===f[1]&&g[2]>=f[2]))?true:false};B=function(k,g){if(Z.ie&&Z.mac){return }var j=A("head"),i=A('<style media="screen" type="text/css" />');if(!(Z.ie&&Z.win)&&typeof d.createTextNode!==X){A(d.createTextNode(k+" {"+g+"}")).appendTo(i)}i.appendTo(j);if(Z.ie&&Z.win&&typeof d.styleSheets!==X&&d.styleSheets.length>0){var f=d.styleSheets[d.styleSheets.length-1];if(typeof f.addRule===Q){f.addRule(k,g)}}};W=function(i,f){var g=f?"visible":"hidden",h=A("#"+i);if(h.length){A(function(){h.css("visibility",g)})}else{B("#"+i,"visibility: "+g)}};c=function(g){var h=/[\\\"<>\.;]/;var f=h.exec(g)!==null;return f?encodeURIComponent(g):g};N=function(){if(Z.ie&&Z.win){window.attachEvent("onunload",function(){var o=U.length;for(var n=0;n<o;n++){U[n][0].detachEvent(U[n][1],U[n][2])}var h=L.length;for(var m=0;m<h;m++){Y(L[m])}for(var g in Z){Z[g]=null}Z=null;for(var f in jQuery.swfobject){jQuery.swfobject[f]=null}jQuery.swfobject=null})}}();return{registerObject:function(i,f,h){if(!Z.w3cdom||!i||!f){return }var g={};g.id=i;g.swfVersion=f;g.expressInstall=h?h:false;I[I.length]=g;W(i,false)},getObjectById:function(i){var f=null;if(Z.w3cdom){var g=A("#"+i);if(g.length){var h=g.find(Q)[0];if(!h||(h&&typeof g.SetVariable!==X)){f=g[0]}else{if(typeof h.SetVariable!==X){f=h}}}}return f},createCSS:function(g,f){if(Z.w3cdom){B(g,f)}},createSWF:function(h,g,f){if(Z.w3cdom){return R(h,g,f)}else{return undefined}},embedSWF:function(o,v,s,u,f,n,g,q,t){if(!Z.w3cdom||!o||!v||!s||!u||!f){return }s+="";u+="";if(O(f)){W(v,false);var r={};if(t&&typeof t===Q){for(var m in t){if(t[m]!==Object.prototype[m]){r[m]=t[m]}}}r.data=o;r.width=s;r.height=u;var p={};if(q&&typeof q===Q){for(var l in q){if(q[l]!==Object.prototype[l]){p[l]=q[l]}}}if(g&&typeof g===Q){for(var h in g){if(g[h]!==Object.prototype[h]){if(typeof p.flashvars!==X){p.flashvars+="&"+h+"="+g[h]}else{p.flashvars=h+"="+g[h]}}}}A(function(){R(r,p,v);if(r.id===v){W(v,true)}})}else{if(n&&!E&&O("6.0.65")&&(Z.win||Z.mac)){E=true;W(v,false);A(function(){var i={};i.id=i.altContentId=v;i.width=s;i.height=u;i.expressInstall=n;F(i)})}}},expressInstallCallback:function(){if(E&&K){var f=A("#"+J);if(f.length){f.replaceWith(A(K));if(S){W(S,true);if(Z.ie&&Z.win){A(K).css("display","block")}}K=null;S=null;E=false}}},getFlashPlayerVersion:function(){return{major:Z.pv[0],minor:Z.pv[1],release:Z.pv[2]}},getQueryParamValue:function(j){var h=d.location.search||d.location.hash;if(j===null){return c(h)}if(h){var g=h.substring(1).split("&");for(var f=0;f<g.length;f++){if(g[f].substring(0,g[f].indexOf("="))===j){return c(g[f].substring((g[f].indexOf("=")+1)))}}}return""},hasFlashPlayerVersion:O,removeSWF:function(f){if(Z.w3cdom){Y(f)}}}}()})(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);
		}
	},
	addsimp:function(target, cn, hname) {
		var node=$('#'+target);
		var imgs=$('.'+cn, node);
		
		imgs.each(function(){
			$(this).hover(function(){
				this.src=this.src.replace('.gif', '_on.gif');
			},function(){
				this.src=this.src.replace('_on.gif', '.gif');
			});
		});
		
	},
	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});
});
