iid='';
function sh(id){
	if($(id))$(id).setStyle('display',(($(id).getStyle('display')=='none')?'block':'none'));
}
function fq(t){
	$$('.q_r').each(function(itm){itm.setStyle('display', 'none');});
	$$(t).each(function(itm){itm.setStyle('display', 'block');});
	
}
function hrm(id, cls, q){
	//$$('.q').each(function(itm){itm.addClass('q');});
	$(q).removeClass('q');
	//$(q).getParents('a').removeClass('grey');
	$$('.'+cls).each(function(itm){itm.setStyle('display', 'none');});
	if(id!=iid){$(id).setStyle('display','block');iid=id}else{iid=''};
}
function si(tp,dr,fn){
	$('iw').set('html','<img src="/content/'+tp+'/i_'+dr+'/'+fn+'" id="zi">');
	$('pp').setStyle('display','block');$('pp').setStyle('top','0');
	$('pp').addEvents({
		'mouseup':function(e){sp(e);},'mousemove':function(e){sp(e);},
		'click':function(e){$('pp').removeEvents();$('pp').setStyle('display','none');}
	});
}
function sp(e){
	w=$('pp').getStyle('width').toInt();h=$('pp').getStyle('height').toInt();if(w==100){gs();}
	var iw=$('zi').getStyle('width').toInt();var ih=$('zi').getStyle('height').toInt();
	if(iw){
		$('iw').setStyle('left',((iw>w)?((e.client.x/w)*(w-iw)):((w-iw)/2)));
		$('iw').setStyle('top',((ih>h)?((e.client.y/h)*(h-ih)):((h-ih)/2)));
	}
}
function sq(s){
	$('q').set('html','<input type="text" name="qry" value="'+s+'" onfocus="this.value=\'\';this.onfocus=\'\'">');
}
function gs() {
	// IE patch
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    w = window.innerWidth;
    h = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    w = document.documentElement.clientWidth;
    h = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    w = document.body.clientWidth;
    h = document.body.clientHeight;
  }
 return Array(w, h);
}
window.addEvent('domready', function() {
	var list = $$('div.sld');
	list.each(function(e) {
		var myTransition = new Fx.Transition(Fx.Transitions.Sine, 3);
		var fx = new Fx.Tween(e, {wait:false, transition: myTransition.easeIn});
		e.setStyle('cursor', 'pointer');
		e.t = ((e.getStyle('top') == 'auto')? 116 : e.getStyle('top').toInt());
		e.getParent().addEvent('mouseenter', function(){
			fx.start('top', (e.t-116));
		});
		e.getParent().addEvent('mouseleave', function(){
			fx.start('top', e.t);
		});
	 	e.getParent().addEvent('click', function(){
			document.location.href = e.getChildren('.lnk').getElement('a');
		});
		
		
		
	});
});