function isIE()
{
	ua = navigator.userAgent;
	if (ua.indexOf("MSIE")>=0)
	{ return true } else {return false}
}

function animateResize(increment,limit,id){
    var item=document.getElementById(id);
    if (item.h<=limit){
        item.h+=increment;
        item.style.height=item.h+"px";
    } else {
        clearInterval(item.animator);
        item.animator=null;
    }
}

function displayRollup(id){
    var item=document.getElementById(id);
    if (!item.expanded){
		hideProductDetails(id);
		hideProductDetails(id);
		item.expanded=true;
		item.style.display="block";
		if (!isIE()){
			maxheight=item.clientHeight;
			item.style.height="0px";
			item.h=0;
			item.maxh=maxheight;
			item.animator=setInterval("animateResize(7,maxheight,'"+id+"')",50);
		}
    } else {hideProductDetails(id)}
}
function hideProductDetails(id){
    var item=document.getElementById(id);
    item.style.display="none";
    item.expanded=false;
    item.style.height="";
    if (item.animator)
        clearInterval(item.animator);
}

function fadeInImages(){
    var images=document.getElementsByTagName("img");
	var blendcount=0;
    for (var i=0; i<images.length;i++){
        if (images[i].className=="fade_in"){
            setTimeout('opacity("'+images[i].id+'",0,100,1000);',blendcount*1000);
			blendcount++;
        }
    }
}

function changeImage(object,suffix,ext,folder){
    object.src="images/"+folder+object.id+suffix+"."+ext;
}

