
//index check
var isindex=true;

var $window=$(window);

//tupperware main object
var tpm={

	imageroot : '/images/',

	//archivedataxml : 'archive.xml',
	archivedataxml : 'archive.asp',

	$header : null,
	$wrap : null

}

//archive
tpm.archive={

	$obj : null,
	$btnopen : null,
	$btnclose : null,
	$btnprev : null,
	$btnnext : null,
	$movingobj : null,
	$items : null,

	active : false,
	opened : false,

	no : 0,
	shownum : 7,
	movingsize : 100,

	itemresettimer : null,

	open : function(){
		tpm.archive.$obj.css('top', 77).animate({ height:128 }, { queue:false, duration:1000, step:tpm.archive.openclosestep, easing:'easeInOutExpo' });
		tpm.archive.opened=true;
	},

	close : function(){
		tpm.archive.$obj.animate({ height:0 }, { queue:false, duration:1000, step:tpm.archive.openclosestep, easing:'easeOutExpo' });
		tpm.archive.opened=false;
	},

	openclosestep : function(now){
		tpm.archive.$btnopen.data('image').css('top', -(now/3));
	},

	btnover : function(e){
		$(e.currentTarget).animate({ opacity:1 }, { queue:false, duration:300 });
	},

	btnout : function(e){
		$(e.currentTarget).animate({ opacity:0.7 }, { queue:false, duration:300 });
	},

	btnclick : function(e){
		tpm.archive.no=($(e.currentTarget).data('flag')=='prev')? tpm.archive.no-1 : tpm.archive.no+1;
		tpm.archive.$movingobj.animate({ marginLeft:-tpm.archive.movingsize*tpm.archive.no }, { queue:false, duration:750, easing:'easeInOutExpo' });
		tpm.archive.btnsetting();
	},

	btnsetting : function(){
		var option={ queue:false, duration:300 };
		for(var i=-1, $tg; ++i<2;){
			$tg=(!i)? tpm.archive.$btnprev : tpm.archive.$btnnext;
			if($tg.data('active') && ((!i && tpm.archive.no==0) || (i && tpm.archive.no>=tpm.archive.$items.length-tpm.archive.shownum))){
				$tg.data('active', false).unbind('mouseenter', tpm.archive.btnover).unbind('mouseleave', tpm.archive.btnout).unbind('click', tpm.archive.btnclick)
					.css('cursor', 'default').animate({ opacity:0.3 }, option);
			}else if(!$tg.data('active')){
				$tg.data('active', true).bind('mouseenter', tpm.archive.btnover).bind('mouseleave', tpm.archive.btnout).bind('click', tpm.archive.btnclick)
					.css('cursor', 'pointer').animate({ opacity:0.7 }, option);
			}
		}
	},

	itemover : function(e){
		clearTimeout(tpm.archive.itemresettimer);
		var no=$(e.currentTarget).data('no');
		for(var i=-1, max=tpm.archive.$items.length; ++i<max;){
			tpm.archive.$items[i].animate({ opacity:(i==no)? 1 : 0.5 }, { queue:false, duration:300 });
		}
	},

	itemout : function(){
		tpm.archive.itemresettimer=setTimeout(function(){
			tpm.archive.itemreset();
		}, 200);
	},

	itemreset : function(){
		for(var i=-1, max=tpm.archive.$items.length; ++i<max;){
			tpm.archive.$items[i].animate({ opacity:1 }, { queue:false, duration:300 });
		}
	},

	itemclick : function(e){
		tpm.archive.close();
		var id=$(e.currentTarget).attr('id').split('prevarchive_')[1];
		$.ajax({
			url : tpm.archivedataxml+'?mn_seq='+id,
			//url : tpm.archivedataxml+'?mn_seq___='+id,
			success : tpm.quiz.onloadxml
		});
	}

}

//quiz
tpm.quiz={

	$obj : null,
	$loading : null,

	$start : null,
	$question : null,
	$wrong : null,
	$result : null,
	$nowobject : null,

	isfirst : true,

	answer : {

		over : function(e){
			$(this).addClass('answer_over');
		},

		out : function(e){
			$(this).removeClass('answer_over');
		},

		click : function(e){
			var $this=$(this);
			$this.addClass('answer_on');
			if(parseInt($this.attr('class').match(/answer([1-2])/)[1])===$this.parent().data('rightanswer')){
				if($this.data('step')==tpm.quiz.$question.length-1){
					tpm.quiz.move('result');
				}else{
					tpm.quiz.move('question', $(this).data('step')+1);
				}
			}else{
				tpm.quiz.move('wrong', $(this).data('step'));
			}
		}

	},

	tryagain : function(e){
		tpm.quiz.move('tryagain', $(this).data('step'));
	},

	move : function(flag, no){

		var $nextobject=(flag=='start')? tpm.quiz.$start : 
			(flag=='result')? tpm.quiz.$result : 
			(flag=='question' || flag=='tryagain')? tpm.quiz.$question[no] : 
			tpm.quiz.$wrong[no];

		if(flag!='wrong' && flag!='tryagain'){
			$nextobject.css('left', 960);
		}

		if(flag=='tryagain'){
			$nextobject.find('p').each(function(index){
				if(index>0) $(this).removeClass('answer_on');
			});
		}

		if(flag=='wrong'){
			$nextobject.animate({ top:0 }, { queue:false, duration:850, easing:'easeOutBounce', complete:oncomplete});
		}else if(flag=='tryagain'){
			tpm.quiz.$nowobject.animate({ top:-512 }, { queue:false, duration:850, easing:'easeInOutExpo', complete:oncomplete});
		}else{
			tpm.quiz.$nowobject.animate({ left:-960 }, { queue:false, duration:850, easing:'easeInOutExpo', step:function(now){
				$nextobject.css('left', 960+now);
			}, complete:oncomplete});
		}

		function oncomplete(){
			tpm.quiz.$nowobject=$nextobject;
		}

	},

	onloadxml : function(data){

		//tpm.quiz.xmldata=jQuery.parseXML(data);
		tpm.quiz.xmldata=data;

		tpm.quiz.$loading.appendTo(tpm.quiz.$obj);

		if(tpm.quiz.isfirst){
			tpm.quiz.isfirst=false;
			tpm.quiz.setting();
		}else{
			tpm.quiz.clear(tpm.quiz.setting);
		}

	},

	setting : function(){

		tpm.quiz.$obj.empty().append(tpm.quiz.$loading);

		tpm.quiz.$start=tpm.quiz.createitem($('main image', tpm.quiz.xmldata).text())
			.append($('<p class="btn start"><img src="'+tpm.imageroot+'main/btn_quiz_start.png" alt="" /></p>')
				.css('top', -150)
				.click(function(){
					tpm.quiz.move('question', 0);
				})
			)
			.appendTo(tpm.quiz.$obj);
		tpm.quiz.$start.find('p.image').css('opacity', 0);

		tpm.quiz.$start.find('img:first').load(tpm.quiz.onloadfirstimage);

	},

	onloadfirstimage : function(){

		tpm.quiz.$loading.remove();

		tpm.quiz.$nowobject=tpm.quiz.$start;

		tpm.quiz.$start.find('p.image').animate({ opacity:1 }, { queue:false, duration:750, complete:function(){
			tpm.quiz.$start.find('p.start').animate({ top:150 }, { queue:false, duration:750, easing:'easeOutElastic' });
		}});

		var i, max, items=$('question item', tpm.quiz.xmldata);

		tpm.quiz.$question=[];
		tpm.quiz.$wrong=[];
		for(i=-1, max=items.length; ++i<max;){

			tpm.quiz.$question[i]=tpm.quiz.createitem($('image', items[i]).text())
				.css('left', 960)
				.data('rightanswer', parseInt($('rightanswer', items[i]).text()))
				.append($('<p class="btn answer1">답변1</p>')
					.data('step', i)
					.mouseover(tpm.quiz.answer.over)
					.mouseout(tpm.quiz.answer.out)
					.click(tpm.quiz.answer.click)
				)
				.append($('<p class="btn answer2">답변2</p>')
					.data('step', i)
					.mouseover(tpm.quiz.answer.over)
					.mouseout(tpm.quiz.answer.out)
					.click(tpm.quiz.answer.click)
				)
				.appendTo(tpm.quiz.$obj);

			tpm.quiz.$wrong[i]=tpm.quiz.createitem($('wrongimage', items[i]).text())
				.css('top', -512)
				.append($('<p class="btn tryagain"><img src="'+tpm.imageroot+'main/btn_quiz_tryagain.png" alt="Try Again" /></p>')
					.data('step', i)
					.click(tpm.quiz.tryagain)
				)
				.appendTo(tpm.quiz.$obj);
		}

		tpm.quiz.$result=tpm.quiz.createitem($('result image', tpm.quiz.xmldata).text())
			.css('left', 960)
			.append($('<p class="btn tryagain2"><img src="'+tpm.imageroot+'main/btn_quiz_tryagain2.png" alt="다시하기" /></a></p>')
				.click(function(){
					tpm.quiz.clear(tpm.quiz.setting);
					tpm.quiz.setting();
				})
			)
			.append($('<p class="btn poductdetail"><a href="'+$('result linktodetail', tpm.quiz.xmldata).text()+'" target="'+$('result linktodetail', tpm.quiz.xmldata).attr('target')+'"><img src="'+tpm.imageroot+'main/btn_quiz_productdetail.png" alt="제품상세" /></a></p>'))
			//.append($('<p class="btn poductbuy"><a href="'+$('result linktobuy', tpm.quiz.xmldata).text()+'" target="'+$('result linktobuy', tpm.quiz.xmldata).attr('target')+'"><img src="'+tpm.imageroot+'main/btn_quiz_productbuy.png" alt="제품구매" /></a></p>'))
			.append($('<p class="btn poductbuy"><a href="#" onClick="goShop(\'' + $('result linktobuy', tpm.quiz.xmldata).text() + '\')"><img src="'+tpm.imageroot+'main/btn_quiz_productbuy.png" alt="제품구매" /></a></p>'))
			.appendTo(tpm.quiz.$obj);

	},

	createitem : function(imageurl){
		return $('<div class="item"><p class="image"><img src="'+imageurl+'" alt="" /></p></div>');
	},

	clear : function(callback){
		tpm.quiz.$nowobject.animate({ top:512 }, { queue:false, duration:750, easing:'easeInExpo', complete:callback});
	}

}

//banners
tpm.banners={

	$obj : null,
	$items : null,

	length : 0,

	resettimer : null,

	over : function(e){
		clearTimeout(tpm.banners.resettimer);
		var no=$(e.target).data('no');
		for(var i=-1; ++i<tpm.banners.length;){
			tpm.banners.$items[i].data('dimmed').animate({ opacity:(i==no)? 0 : 0.3 }, { queue:false, duration:300 });
		}
	},

	out : function(e){
		tpm.banners.resettimer=setTimeout(function(){
			for(var i=-1; ++i<tpm.banners.length;){
				tpm.banners.$items[i].data('dimmed').animate({ opacity:0 }, { queue:false, duration:300 });
			}
		}, 100);
	},

	click : function(e){
		var a=e.target.parentNode.getElementsByTagName('a')[0];
		if(a.onclick) a.onclick();
		else{
			if(a.target && a.target=='_blank') window.open(a.href);
			else location.href=a.href;
		}
	}

}

//counseling
tpm.counsel={

	$obj : null,

	nowno : 0,

	length : 0,
	opened : false,
	opentop : 77,
	closetop : 590,
	closeheight : 94,
	minheight : 691,

	$tabs : null,
	tabsteps : [0, 0, 0],
	tabstepmax : 10,
	tabsteptimer : [null, null, null],

	itemlinksettimer : null,
	itemlinkshowcomplete : false,

	$itemwrap : null,
	$items : null,

	tabover : function(e){
		var $tg=$(e.currentTarget);
		if($tg.data('clicked')) return;
		var no=$tg.data('no');
		tpm.counsel.tabeffect(no, true);
	},

	tabout : function(e){
		var $tg=$(e.currentTarget);
		if($tg.data('clicked')) return;
		var no=$tg.data('no');
		tpm.counsel.tabeffect(no, false);
	},

	tabclick : function(e){
		var $tg=$(e.currentTarget);
		$tg.data('clicked', true);
		tpm.counsel.nowno=$tg.data('no');
		tpm.counsel.tabfocus(tpm.counsel.nowno);
		tpm.counsel.itemopen(tpm.counsel.nowno);
		return false;
	},

	tabfocus : function(no){
		for(var i=-1; ++i<tpm.counsel.length;){
			if(i!=no && tpm.counsel.$tabs[i].data('link').data('clicked')){
				tpm.counsel.$tabs[i].data('link').data('clicked', false).trigger('mouseleave');
			}
			tpm.counsel.$tabs[i].data('link').animate({ opacity:(i==no)? 1 : 0 }, { queue:false, duration:500 });
		}
	},

	tabeffect : function(no, on){
		clearTimeout(tpm.counsel.tabsteptimer[no]);
		if((on && tpm.counsel.tabsteps[no]==tpm.counsel.tabstepmax-1) || (!on && tpm.counsel.tabsteps[no]==0)) return;
		else{
			tpm.counsel.tabsteps[no]=(on)? tpm.counsel.tabsteps[no]+1 : tpm.counsel.tabsteps[no]-1;
			tpm.counsel.$tabs[no].data('arrow1').css('backgroundPosition', -(tpm.counsel.tabsteps[no]*22)+'px 0');
			tpm.counsel.$tabs[no].data('arrow2').css('backgroundPosition', -(tpm.counsel.tabsteps[no]*22)+'px -22px');
			tpm.counsel.tabsteptimer[no]=setTimeout(function(){
				tpm.counsel.tabeffect(no, on);
			}, 30);
		}
	},

	itemopen : function(no){
		tpm.counsel.itemreset();
		if(!tpm.counsel.opened){
			if(tpm.archive.opened) tpm.archive.close();
			tpm.banners.$obj.animate({ top:622 }, { queue:false, duration:750, easing:'easeInOutExpo' });
			tpm.counsel.opened=true;
			tpm.counsel.itemshow(no, true);
		}else{
			tpm.counsel.itemshow(no);
		}
		tpm.counsel.$obj.animate({ top:tpm.counsel.opentop, height:tpm.counsel.resize(true) }, { queue:false, duration:1000, easing:'easeInOutExpo' });
	},

	itemreset : function(){
		var top=tpm.counsel.resize(true);
		for(var i=-1, j, max; ++i<tpm.counsel.length;){
			tpm.counsel.$items[i].css('top', top).stop(true);
			tpm.counsel.$items[i].data('title').css('top', tpm.counsel.$items[i].data('title').data('originalpos')+100).stop(true);
			for(j=-1, max=tpm.counsel.$items[i].data('link').length; ++j<max;){
				tpm.counsel.$items[i].data('link')[j].css({
					top : tpm.counsel.$items[i].data('link')[j].data('originalpos').y-20,
					opacity : 0
				}).stop(true);
			}
		}
	},

	itemshow : function(no, withopen){
		tpm.counsel.itemlinkshowcomplete=false;
		for(var i=-1, j, max; ++i<tpm.counsel.length;){
			tpm.counsel.$items[i].css('zIndex', (i==no)? 1 :0);
		}
		tpm.counsel.$items[no].animate({ top:0 }, { queue:false, duration:1000, easing:'easeOutExpo', complete:function(){
			tpm.counsel.itemlinkshow($(this).data('no'));
		}});
		tpm.counsel.$items[no].data('title').animatedelay((withopen)? 500 : 100, function(){
			var $this=$(this);
			$this.animate({ top:$this.data('originalpos') }, { queue:false, duration:1200, easing:'easeOutQuart' });
		});
	},

	itemclose : function(){
		tpm.banners.$obj.animate({ top:528 }, { queue:false, duration:1200, easing:'easeInOutExpo' });
		tpm.counsel.$obj.animate({ top:tpm.counsel.closetop, height:tpm.counsel.closeheight }, { queue:false, duration:1000, easing:'easeInOutExpo'});
		tpm.counsel.nowno=-1;
		tpm.counsel.tabfocus(tpm.counsel.nowno);
		tpm.counsel.opened=false;
	},

	itemlinkshow : function(no){
		for(var i=-1, max=tpm.counsel.$items[no].data('link').length; ++i<max;){
			tpm.counsel.$items[no].data('link')[i][0].onanimatecomplete=(i==max-1)? function(){
				tpm.counsel.itemlinkshowcomplete=true;
			} : null;
			tpm.counsel.$items[no].data('link')[i].animatedelay(i*150, function(){
				$(this).animate({ top:$(this).data('originalpos').y, opacity:1 }, { queue:false, duration:400, easing:'easeOutSine', complete:this.onanimatecomplete});
			});
		}
	},

	itemlinkover : function(e){
		if(!tpm.counsel.itemlinkshowcomplete) return;
		clearTimeout(tpm.counsel.itemlinksettimer);
		$target=$(e.currentTarget);
		tpm.counsel.itemlinkset($target.data('itemno'), $target.data('no'));
	},

	itemlinkout : function(e){
		if(!tpm.counsel.itemlinkshowcomplete) return;
		$target=$(e.currentTarget);
		tpm.counsel.itemlinksettimer=setTimeout(function(){
			tpm.counsel.itemlinkset($target.data('itemno'), -1);
		}, 200);
	},

	itemlinkset : function(itemno, no){
		for(var i=-1, max=tpm.counsel.$items[itemno].data('link').length; ++i<max;){
			tpm.counsel.$items[itemno].data('link')[i].animate({ opacity:(i==no || 0>no)? 1 : 0.5 }, { queue:false, duration:400 });
		}
	},

	resize : function(isreturn){
		var height=$window.height()-tpm.counsel.opentop;
		if(tpm.counsel.minheight>height) height=tpm.counsel.minheight;
		if(isreturn && isreturn===true) return height;
		if(tpm.counsel.opened) tpm.counsel.$obj.css('height', height);
		for(var i=-1, j, max; ++i<tpm.counsel.length;){
			if(i!=tpm.counsel.nowno) tpm.counsel.$items[i].css('top', height);
		}
	}

}

//index video player
tpm.indexvideo={

	$container : null,

	open : function(no){
		if(!tpm.indexvideo.$container){
			tpm.indexvideo.$container=$('<div id="videoplayercontainer"><div id="IndexVideoPlayer"></div></div>').appendTo($('body'));
		}
		tpm.indexvideo.$container.show();
		dimmed.show({ callback:function(){
			swfobject.embedSWF("/flash/01_main/IndexVideoPlayer.swf?configXML=/flash/xml/configIndex.xml&videoIndex="+no, "IndexVideoPlayer", "820", "550",
				swfobject.defaultSet.ver,
				swfobject.defaultSet.install,
				'',
				swfobject.defaultSet.params
			);
		}});
	},

	close : function(){
		tpm.indexvideo.$container.html('<div id="IndexVideoPlayer"></div>').hide();
		dimmed.hide();
	}

}
var closeCompleteIndexVideoPlayer=tpm.indexvideo.close;

// jQuery ready
$(function(){

	var i, j, max;
	tpm.$header=$('#header');
	tpm.$wrap=$('#wrap');

	//archive
	tpm.archive.$obj=$('#archive');
	tpm.archive.$btnopen=$('<div class="archive_btn"><img src="'+tpm.imageroot+'/main/btn_archive_off.png" alt="Tupperware Archive" /></div>')
		.click(tpm.archive.open)
		.appendTo(tpm.$header);
	tpm.archive.$btnopen.data('image', tpm.archive.$btnopen.find('img:first'));
	tpm.archive.$btnclose=$('<p class="close"></p>')
		.click(tpm.archive.close)
		.appendTo(tpm.archive.$obj.find('div.inside'));
	var $prevarchives=tpm.archive.$obj.find('div.prevarchives');
	tpm.archive.$btnprev=$prevarchives.find('p.btnprev')
		.data({ 'flag':'prev', 'active':false });
	tpm.archive.$btnnext=$prevarchives.find('p.btnnext')
		.data({ 'flag':'next', 'active':true });
	tpm.archive.$movingobj=$prevarchives.find('ul:first');
	tpm.archive.$items=tpm.archive.$movingobj.find('li')
	for(i=-1, max=tpm.archive.$items.length; ++i<max;){
		tpm.archive.$items[i]=$(tpm.archive.$items[i])
			.data('no', i)
			.mouseenter(tpm.archive.itemover)
			.mouseleave(tpm.archive.itemout)
			.click(tpm.archive.itemclick);
	}
	tpm.archive.active=tpm.archive.$items.length>tpm.archive.shownum;
	if(!tpm.archive.active){
		tpm.archive.$btnprev.remove();
		tpm.archive.$btnnext.remove();
		tpm.archive.$movingobj.parent().css({
			'width' : (100*tpm.archive.$items.length+5),
			'marginLeft' : 81+(100*(7-tpm.archive.$items.length))
		});
	}else{
		tpm.archive.$movingobj.css({
			width : tpm.archive.$items.length*tpm.archive.movingsize+10,
			marginLeft : -tpm.archive.movingsize*(tpm.archive.$items.length-tpm.archive.shownum)
		});
		tpm.archive.no=tpm.archive.$items.length-tpm.archive.shownum;
		tpm.archive.btnsetting();
	}

	//quiz
	tpm.quiz.$obj=$('#quiz').css('height', 606);
	tpm.quiz.$loading=tpm.quiz.$obj.find('p.loading');

	//banners
	$('#banners').css('marginTop', 0).wrap('<div id="bannerswrap"></div>');
	tpm.banners.$obj=$('#bannerswrap');
	tpm.banners.$items=tpm.banners.$obj.find('li');
	for(i=-1, tpm.banners.length=tpm.banners.$items.length; ++i<tpm.banners.length;){
		tpm.banners.$items[i]=$(tpm.banners.$items[i]);
		tpm.banners.$items[i].data('dimmed', $('<span></span>')
			.data('no', i)
			.css('opacity', 0)
			.mouseenter(tpm.banners.over)
			.mouseleave(tpm.banners.out)
			.click(tpm.banners.click)
			.appendTo(tpm.banners.$items[i]));
	}

	//counseling
	tpm.counsel.$obj=$('#counseling').css({ position:'absolute', top:tpm.counsel.closetop, height:tpm.counsel.closeheight, overflow:'hidden' });
	tpm.counsel.$tabs=tpm.counsel.$obj.find('div.tabs li');
	for(i=-1, tpm.counsel.length=tpm.counsel.$tabs.length; ++i<tpm.counsel.length;){
		tpm.counsel.$tabs[i]=$(tpm.counsel.$tabs[i]);
		tpm.counsel.$tabs[i]
			.data('arrow1', $('<span></span>').appendTo(tpm.counsel.$tabs[i]))
			.data('link', tpm.counsel.$tabs[i].find('a:first').data('no', i).data('clicked', false)
				.mouseenter(tpm.counsel.tabover)
				.mouseleave(tpm.counsel.tabout)
				.click(tpm.counsel.tabclick)
			)
			.data('arrow2', $('<span></span>').appendTo(tpm.counsel.$tabs[i].data('link')));
	}
	tpm.counsel.$itemwrap=tpm.counsel.$obj.find('div.contents')
		.css({ position:'absolute', margin:0 })
		.append($('<span class="close"></span>').css('opacity' ,0.5)
			.mouseenter(function(){
				$(this).animate({ opacity:1 }, { queue:false, duration:300 });
			})
			.mouseleave(function(){
				$(this).animate({ opacity:0.5 }, { queue:false, duration:300 });
			})
			.click(tpm.counsel.itemclose));
	tpm.counsel.$items=tpm.counsel.$itemwrap.children();
	for(i=-1; ++i<tpm.counsel.length;){
		tpm.counsel.$items[i]=$(tpm.counsel.$items[i]).css('position', 'absolute');
		tpm.counsel.$items[i].data('no', i)
			.data('title', tpm.counsel.$items[i].find('h3'))
			.data('link', tpm.counsel.$items[i].find('li'));
		tpm.counsel.$items[i].data('title').data('originalpos', parseInt(tpm.counsel.$items[i].data('title').css('top')));
		for(j=-1, max=tpm.counsel.$items[i].data('link').length; ++j<max;){
			tpm.counsel.$items[i].data('link')[j]=$(tpm.counsel.$items[i].data('link')[j]);
			tpm.counsel.$items[i].data('link')[j]
				//.css('opacity', 0)
				.data('no', j)
				.data('itemno', i)
				.data('originalpos', { 
					x : parseInt(tpm.counsel.$items[i].data('link')[j].css('left')),
					y : parseInt(tpm.counsel.$items[i].data('link')[j].css('top'))
				})
				.mouseenter(tpm.counsel.itemlinkover)
				.mouseleave(tpm.counsel.itemlinkout);
			if(i==2){
				tpm.counsel.$items[i].data('link')[j].find('a:first').data('no', j+1)
					.click(function(){
						tpm.indexvideo.open($(this).data('no'));
						return false;
					});
			}
		}
	}

	$window.resize(tpm.counsel.resize);

//	tpm.archive.$items[tpm.archive.$items.length-1].trigger('click');
	tpm.archive.$items[0].trigger('click');
	
	if(jQuery.ua.ie) $('body').find('a').each(function(){this.hideFocus=true});

});


function goShop(url) {
	alert("타파웨어 제품을 구매하시려면 브랜즈몰 아이디로 재로그인 하셔야 됩니다");
	window.open(url);
}
