// JavaScript Document
Effect.divSwap = function(element,container,next){
	var div = document.getElementById(container);
	var nodeList = div.childNodes;
	var queue = Effect.Queues.get('menuScope');

	if(queue.toArray().length<1){
		if(Element.visible(element)==false){
			for(i=0;i<nodeList.length;i++){
				if(nodeList.item(i).nodeName=="DIV" && nodeList.item(i).id!=element){
					if(Element.visible(nodeList.item(i))==true){
						//Effect.SlideUp(nodeList.item(i),{queue:{position:'end',scope:'menuScope',limit:2}})
						//Effect.Fade(nodeList.item(i),{queue:{position:'end',scope:'menuScope',limit:2}})
						Effect.BlindUp(nodeList.item(i),{queue:{position:'end',scope:'menuScope',limit:2}})
					}
				}
			}
			//Effect.SlideDown(element,{queue:{position:'end',scope:'menuScope',limit:2}})
			//Effect.Appear(element,{queue:{position:'end',scope:'menuScope',limit:2}})
			Effect.BlindDown(element,{queue:{position:'end',scope:'menuScope',limit:2}})
			Effect.Appear(element,{queue:{position:'end',scope:'menuScope',limit:2}})
			// PRODUCT DESC
			if(document.getElementById('product_desc'))
			{
				document.getElementById('product_desc').innerHTML = product_descriptions[next];
			}

	   }
   }
}

var current_product_rotation = 0;



//var product_big_image = Array("dummy_700.jpg","dummy_700.jpg","dummy_700.jpg","dummy_700.jpg");
//var product_big_image_sizes = Array("width:688px; height:639px;","width:688px; height:639px;","width:688px; height:639px;","width:688px; height:639px;");
function rotate_fn()
{
	tot_imgs = product_rotation.length;
	for(i=0; i<tot_imgs; i++)
	{
		vis = document.getElementById(product_rotation[i]).style.display;
		//alert(product_rotation[i] + " : " + vis);
		if(vis == "none")
		{
			// NOT SHOWING
		}
		else
		{
			// GET NEXT
			next = i+1;
			if(next == tot_imgs)
			{
				next = 0;
			}
			
			Effect.divSwap(product_rotation[next],'product_image_holder');
			
			// PRODUCT DESC
			if(document.getElementById('product_desc'))
			{
				document.getElementById('product_desc').innerHTML = product_descriptions[next];
			}
			break;
		}
	}
}

function fn_big_image()
{
	tot_imgs = product_rotation.length;
	for(i=0; i<tot_imgs; i++)
	{
		vis = document.getElementById(product_rotation[i]).style.display;
		//alert(product_rotation[i] + " : " + vis);
		if(vis == "none")
		{
			// NOT SHOWING
		}
		else
		{
			html = '<div class="img">';
			html += '<a href="#" title="Close" class="img_border" style="'+product_big_image_sizes[i]+' margin-left:0px;" onClick="fn_close_big();"><div class="product_close"></div></a>';
			html += '<div class="r_logo"></div>';
			html += '<img border="0" src="../media/jpg/'+product_big_image[i]+'" />';
			html += '</div>';
			
			document.getElementById('big_image').innerHTML = html;
			document.getElementById('big_image').style.display = "";
			break;
		}
	}
}

function fn_close_big()
{
	html = '';
	document.getElementById('big_image').innerHTML = html;
	document.getElementById('big_image').style.display = "none";
}
//document.getElementById('big_image').style.display = "none";
