var mobistarActiveItem = "start";
function mobistarSlideTo(el,contentId){
	if(el.id != mobistarActiveItem && mobistarActiveItem != ""){
		//$('mobistarPromoSubTitle').hide();
		$(el).style.zIndex = 100;
		try{$(mobistarActiveItem).style.cursor="pointer";}catch(e){}
		mobistarActiveItem = "";
		
		new Effect.Morph(el, {
			  style: 'width:232px;height:288px;top:0px;left:30px',
			  duration:1.4,
			  transition: Effect.Transitions.spring,
			  afterFinish: function(s){
			  	s.element.style.cursor="default";
			  	mobistarActiveItem = s.element.id;
			  	var bigContent = s.element.down('.mobistarPromoBigContent');
			  	var smallContent = s.element.down('.mobistarPromoSmallContent');
			  	if(bigContent && smallContent){
			  		bigContent.show();
			  		smallContent.hide();
			  	}
			  }
		     });
		new Effect.Morph(el, {
			  style: 'font-size:18px',
			  duration:.4,
			  transition: Effect.Transitions.linear
		     });
		new Effect.Fade($(el).down('img.mobistarPlus'),{
					duration: .5
				});
		
		var animations = [];
		var siblings = $(el).siblings();
		for(s=0;s<siblings.length;s++){
			siblings[s].style.zIndex = 50+s;
			var left = 30+232+35+(s*(147+5));
			animations.push(new Effect.Morph(siblings[s], {
									  style: 'width:147px;height:182px;top:50px;left:'+left+'px;font-size:12px',
									  sync: true,
									  afterSetup: function(s){
									  	var bigContent = s.element.down('.mobistarPromoBigContent');
									  	var smallContent = s.element.down('.mobistarPromoSmallContent');
									  	if(bigContent && smallContent){
									  		bigContent.hide();
									  		smallContent.show();
									  	}
									  	}}));
			animations.push(new Effect.Appear(siblings[s].down('img.mobistarPlus'), {
									  sync: true}));
		}
		new Effect.Parallel(animations,{duration:1});
		
		$("mobistarPromoContent").style.height = $("mobistarPromoContent").getHeight()+'px';
		
		$("mobistarPromoContent").childElements().each(function(s){
			if (s.visible()){
				new Effect.Fade(s,{
					duration: .5
				});
				$("mobistarPromoContent").style.height = s.getHeight();
			}
		});
		new Effect.Appear(contentId,{
			duration:.5,
			delay:.5,
			afterSetup:function(s){
				$("mobistarPromoContent").style.height = s.element.getHeight()+'px';
			}
		});
	}
}
function mobistarHover(el){
	el=$(el);
	if(el.id != mobistarActiveItem && mobistarActiveItem != ""){
		if (el.getWidth() == 147){
			el.style.zIndex = 75;
		   el.style.left = (parseInt(el.getStyle('left'))-6)+"px";
		   el.style.top = (parseInt(el.getStyle('top'))-9)+"px";
			el.style.width = "159px";
			el.style.height = "198px";
		}
		else if (el.getWidth() == 175) {
			el.style.zIndex = 75;
		   el.style.left = (parseInt(el.getStyle('left'))-6)+"px";
		   el.style.top = (parseInt(el.getStyle('top'))-9)+"px";
			el.style.width = "187px";
			el.style.height = "233px";
		}  
	}
}
function mobistarOut(el){
	if(el.id != mobistarActiveItem && mobistarActiveItem != ""){
		if (el.getWidth() == 159){
			el.style.zIndex = 50;
		   el.style.left = (parseInt(el.getStyle('left'))+6)+"px";
		   el.style.top = (parseInt(el.getStyle('top'))+9)+"px";
			el.style.width = "147px";
			el.style.height = "182px";
		}
		else if (el.getWidth() == 187) {
			el.style.zIndex = 50;
		   el.style.left = (parseInt(el.getStyle('left'))+6)+"px";
		   el.style.top = (parseInt(el.getStyle('top'))+9)+"px";
			el.style.width = "175px";
			el.style.height = "217px";
		}
	}
}

