﻿if(typeof(IK) == 'undefined')
IK= {};

IK.Home = {
over: function(that, index, leftoffset)
{
that = $(that);
if(that ==undefined)
this.LastHover = undefined;

this.LastHover = {that:that, index:index, leftoffset:leftoffset};
if(typeof(IK.Home.artworkArray) == 'undefined' )
{
	var parent = $('featuredArt')
	IK.Home.artworkArray = new Array();
	IK.Home.artworkArray[0] = parent.down().down().next('.imageHover'); 
	IK.Home.artworkArray[1] = parent.down().next().down().next('.imageHover');
	IK.Home.artworkArray[2] = parent.down().next(1).down().next('.imageHover');
	IK.Home.artworkArray[3] = parent.down().next(2).down().next('.imageHover');
	IK.Home.artworkArray[4] = parent.down().next(3).down().next('.imageHover');
	IK.Home.artworkArray[5] = parent.down().next(4).down().next('.imageHover');
	IK.Home.artworkArray[6] = parent.down().next(5).down().next('.imageHover');
	IK.Home.artworkArray[7] = parent.down().next(6).down().next('.imageHover');
}

for(var x = 0; x <= 7; x++)
{
	if(index == x )
	{
	wallart = $('Wall' + x);
	if(IK.Home.artworkArray[x]!= null)
	{
		var featuredposition = $('featuredArt').positionedOffset();
		wallart.style.left = featuredposition.left + 5 + leftoffset + "px";	
		wallart.style.top = featuredposition.top + "px";
		 wallart.show();
		IK.Home.artworkArray[x].show();
		
		if(Prototype.Browser.IE6 == true)
		{
			var imagepos = that.positionedOffset();
			IK.Home.artworkArray[x].style.position = 'absolute';
			IK.Home.artworkArray[x].style.left = imagepos.left  ;	
			IK.Home.artworkArray[x].style.top =imagepos.top + 112 ;
			IK.Home.artworkArray[x].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/backgrounds/black-70.png",sizingMethod="scale");'
			IK.Home.artworkArray[x].style.backgroundImage = "none";
			IK.Home.artworkArray[x].style.background = ''; 
			that.style.marginTop = '0px';
			that.style.marginBottom = '0px';
			that.style.paddingTop = '0px';
			that.style.paddingBottom = '0px';
			IK.Home.artworkArray[x].style.paddingBottom = 0
			IK.Home.artworkArray[x].style.paddingTop= 0
			IK.Home.artworkArray[x].style.marginBottom = 0
			IK.Home.artworkArray[x].style.marginTop = 0
			wallart.style.left = featuredposition.left + 10 + leftoffset + "px";	
			wallart.style.top = featuredposition.top + -3 +"px";
			wallart.height = 308;
		
		}
	}
}
else	
{

if($('Wall' + x ) != null)
{ 
$('Wall' + x).hide();
IK.Home.artworkArray[x].hide();
}
}

} 

oldindex = index;

}
,out: function(that, wallart)
{
this.onImage = false;
if(this.onDiv)
{
 wallart = $(wallart);
 that = $(that)
 var info = that.next();
	info.hide();
	if(wallart != null)
	wallart.hide();
}
}
,outDiv: function(that)
{

that = $(that).previous()
this.onDiv = false;
if(this.onImage)
{
 wallart = $('wallArtDiv');
 
 
 var info = that.next();
	info.hide();
	if(wallart != null)
	wallart.hide();
}
}

,overDiv:function(that)
{
this.onDiv = true;
}
, gotoFeaturedImage: function(that)
{
that = $(that)
Util.Nav(that.previous().href)
	

}

}


Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring (navigator.userAgent.indexOf("MSIE")+5))==6; 


if(Prototype.Browser.IE6 == true)
{
//var loginDiv = $('pageHeaderTopRightLinks');
var searchDiv = $('rightSearch')
var searchPos = searchDiv.positionedOffset();

//loginDiv.style.position = 'absolute'
//loginDiv.style.width = 200
//loginDiv.style.left = searchPos.left + 150;

}

function Hideit ()
{
IK.Home.onDiv = true;
homeTimeout = IK.Home.over(null, -1 , 0);

}

Event.observe('abarwrapper','mouseover', Hideit)
Event.observe('pageHeaderMainTabs', 'mouseover', Hideit);
Event.observe('homeR2', 'mouseover', Hideit);
Event.observe('divPromo', 'mouseover', Hideit);

