var onShow = "";var onShowStat = false;var descSeq = [];var showIdx = 0;var num_content;var imgShow;var imgNum;var pageShow;var trackerDefined = false;var pageTracker;var gaUserVar;var openFloatTimer = 500;var closeFloatTimer = 500;$(document).ready(function(){	$.each($("div.shwrap"),function(idx,obj){		$(obj).children('.sh').css({			"opacity":0		});		$(obj).mouseenter(			function(){				$(this).children('.sh').animate({					"opacity":1				},"fast");				descObj = $($(obj).children('.sh')[0]).next();				if(descObj.hasClass('side-desc')){					$("#left-thumb").html(descObj.html()).show().css({						"opacity":0					}).animate({						"opacity":1					},"fast");				}			}		);		$(obj).mouseleave(			function(){				$(this).children('.sh').animate({					"opacity":0				},"fast");				$("#left-thumb").html("").animate({					"opacity":0				},"fast").hide();			}		);				if(!$(obj).hasClass('nodef')){			$(obj).click(function(event){				event.stopPropagation();				fid = $(this).attr('rel');				if(typeof(fid) != 'undefined'){					showFloat(fid);				}			});		}	});		$.each($(".float-left-content"),function(idx,obj){		id = $(obj).attr("id");		descSeq.push(id);		$($("#"+id+" .img-wrap-outer")[0]).css({			"left":idx * 750		});	});		num_content = $(".float-left-content").length;	$("#sliderContent").css({		"position":"absolute",		"top":0,		"left":0,		"width":num_content * 750,		"height":"100%"	});});function chgImg(idx){	if(idx == '+'){		chgImg(parseInt(imgShow) + 1);	}else if(idx == '-'){		chgImg(parseInt(imgShow) - 1);	}else{		if(idx < 1) idx = 1;		if(idx > imgNum) idx = imgNum;		if(idx != imgShow){			$($("#pnumImg a")[idx - 1]).addClass('active');			$($("#pnumImg a")[imgShow - 1]).removeClass('active');			imgAlt = $($($("#"+onShow+" .img-wrap .theImg")[idx - 1]).children("img")[0]).attr('alt');			imgClass = $($($("#"+onShow+" .img-wrap .theImg")[idx - 1]).children("img")[0]).attr('class');			$("#"+onShow+" .img-wrap").animate({				"left":-750 * (idx-1)			},800,function(){				if(typeof(imgAlt) != 'undefined'){					$("#img-caption-wrap").html("<div id='img-caption' class='"+imgClass+"'>"+imgAlt+"</div>");				}else{					$("#img-caption-wrap").html("");				}				hw = 500;				h = $("#img-caption-wrap").height();				$("#img-caption-wrap").css({					"top":hw - h - 23				});			});			imgShow = idx;		}	}}function chgPage(idx){	if(idx != pageShow){		$($("#pnumPg a")[idx - 1]).addClass('active');		$($("#pnumPg a")[pageShow - 1]).removeClass('active');		$("#rs-text").animate({			"marginLeft":(idx - 1) * -300		},"fast");		pageShow = idx;	}}function slideTo(idx){	if(idx == '+'){		slideTo(parseInt(showIdx) + 1);	}else if(idx == '-'){		slideTo(parseInt(showIdx) - 1);	}else{		if(idx < 1) idx = 1;		if(idx > num_content) idx = num_content;		showIdx = parseInt(idx);		onShow = descSeq[showIdx - 1];		$("#sliderContent").animate({			"left":(showIdx-1) * -750		},800);		imgNum = 0;		imgShow = 0;				pg = $($("#"+onShow+" h5")[0]).text();		pgStr = pg;				$.each($("#"+onShow+" .img-wrap .theImg"),function(idx,obj){			if(imgShow == 0) imgShow = 1;			imgNum++;		});		$($("#"+onShow+" .img-wrap-outer")[0]).css({			"left":(showIdx-1) * 750		});		imgAlt = $($($("#"+onShow+" .img-wrap .theImg")[imgShow - 1]).children("img")[0]).attr('alt');		imgClass = $($($("#"+onShow+" .img-wrap .theImg")[imgShow - 1]).children("img")[0]).attr('class');		if(typeof(imgAlt) != 'undefined'){			$("#img-caption-wrap").html("<div id='img-caption' class='"+imgClass+"'>"+imgAlt+"</div>");		}else{			$("#img-caption-wrap").html("");		}		hw = 500;		h = $("#img-caption-wrap").height();		$("#img-caption-wrap").css({			"top":hw - h - 23		});		prx_num_content = "<span class='psign'>";		prx_num_content += "<a href=\"javascript:chgImg('-')\">-</a>";		prx_num_content += "<a href=\"javascript:chgImg('+')\">+</a>";		prx_num_content += "</span> ";		prx_num_content += "<span class='pnum' id='pnumImg'>";		for(x=1;x<=imgNum;x++){			if(x == 1)				prx_num_content += "<a class='active' href=\"javascript:chgImg("+x+")\">"+x+"</a>";			else				prx_num_content += "<a href=\"javascript:chgImg("+x+")\">"+x+"</a>";		}		prx_num_content += "</span> ";		$("#float-number").html(prx_num_content);		$("#"+onShow+" .img-wrap").css({			"width":750 * imgNum		});				rc = $($("#"+onShow+" .text-right")[0]).html();		rc = typeof(rc) == 'undefined'?"":rc;		$("#rs-text").html(rc);		pg = 0;		prx_num_content = "<span class='pnum' id='pnumPg'>";		$.each($("#rs-text .page"),function(idx,obj){			pg++;			if(pg == 1)				prx_num_content += "<a class='active' href=\"javascript:chgPage("+pg+")\">"+pg+"</a>";			else				prx_num_content += "<a href=\"javascript:chgPage("+pg+")\">"+pg+"</a>";		});		prx_num_content += "</span> ";		if(pg > 0){			$("#rs-text").css({				"width":pg*300,				"marginLeft":0			});			$("#rs-page").html(prx_num_content);			pageShow = 1;		}else{			$("#rs-page").html("");		}		imgShow = 0;		chgImg(1);		runAnalytics(pgStr);	}}function showFloat(id){	if(!onShowStat){		if(typeof(id) == 'undefined')			id = 1;		onShowStat = true;		$("#float-left-wrapper,#float-right-wrapper").css({			"opacity":1		});		$("#float-wrapper-bg").animate({			"height":530		},openFloatTimer);		$("#float-wrapper").animate({			"height":505		},openFloatTimer);		$("#col-fix-left, #content, #col-fix-right").animate({			"top":"+=500",			"opacity":0.2		},openFloatTimer,function(){			$("#col-fix-left, #content, #col-fix-right").unbind("click");			$("#col-fix-left, #content, #col-fix-right").unbind("mouseenter");			$("#col-fix-left, #content, #col-fix-right").unbind("mouseleave");			$("#col-fix-left, #content, #col-fix-right").bind("click",function(){				closeFloat();			});			$("#float-wrapper").bind("mouseenter",function(){				$("#float-left-wrapper,#float-right-wrapper").animate({					"opacity":1				},"fast");				$("#col-fix-left, #content, #col-fix-right").animate({					"opacity":0.2				},"fast");			});			$("#float-wrapper").bind("mouseleave",function(){				$("#float-left-wrapper,#float-right-wrapper").animate({					"opacity":0.2				},"fast");				$("#col-fix-left, #content, #col-fix-right").animate({					"opacity":1				},"fast");			});			slideTo(id);		});	}else{		if(typeof(id) == 'undefined')			id = 1;		slideTo(id);	}}function closeFloat(){	if(onShowStat){		onShowStat = false;		$("#float-wrapper,#float-wrapper-bg").animate({			"height":0		},closeFloatTimer);		$("#col-fix-left, #content, #col-fix-right").animate({			"top":"-=500",			"opacity":1		},closeFloatTimer);		$("#col-fix-left, #content, #col-fix-right").unbind("click");		$("#col-fix-left, #content, #col-fix-right").unbind("mouseenter");		$("#col-fix-left, #content, #col-fix-right").unbind("mouseleave");		runAnalytics();	}}function runAnalytics(pages){	try {		if(!trackerDefined){			pageTracker = _gat._getTracker(gaUserVar);			trackerDefined = true;		}		if(typeof(pages) != 'undefined'){			pageTracker._trackPageview('/'+pages);		}else{			pageTracker._trackPageview();		}	} catch(err) {}}
