function openStokke(returnurl){

	var newUrl = "http://www.stokke.com/layouts/siibs/movie.aspx?lang=en&q=high&mime=flash&RETURNSUCCESS=" + escape(returnurl);
	var options = "height=635,width=680,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes";
	//alert(returnurl);
 	window.open(newUrl, null, options);
}

function ShowAgreementVideo(successurl)
{
	openStokke(successurl);
}

function ShowAgreement(pid)
{
	var newUrl = "/questionnaire/questions.asp?RETURNSUCCESS=/" + pid + "/questionnaire-product.html";
	var options = "status=yes, toolbar=no, menu=no, scrollbars=yes";	
	window.open(newUrl, '', options);	 
}

function ShowAgreementBundle(pid, bid)
{
	var newUrl = "/questionnaire/questions.asp?RETURNSUCCESS=/Bundle.aspx?BundleID=" + bid + "&display=true";
	var options = "status=yes, toolbar=no, menu=no, scrollbars=yes";	
	window.open(newUrl, '', options);	 
}

function OpenEmailAddress(pid)
{
	// thewindow=window.open('/EmailAFriend.aspx?pid=' + pid,'anew',config='height=560,width=425,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');

	Shadowbox.open( { content:    '/EmailAFriend.aspx?pid=' + pid
		 , type:        "iframe" 
		 , title:      "Email a friend" 
		 , height:     560
				     , width:      425
		 , options :   {loadingImage:"/images/loading-light.gif" 
				, handleUnsupported:  'link' 
				, modal:true
				} 

		 } ); 
	
}

// ShowFullImg - param is required for moreproductdetails
// as the link is generated in the code
function ShowFullImg(imgName)
{
	var lastSlash = 0;
	var finalName = "";
	var fileName = "";
	var imgNameInput = new Boolean(1);

	//alert('Param imgName: ' + imgName);
	
	if (imgName == "")
	{
		// main product image
		imgName = document.ProductImage.src;				
		lastSlash = imgName.lastIndexOf("/");
		imgNameInput = 0;
	}
				
	if (imgNameInput)
	{				
		fileName = "/ProductImages";
		finalName = fileName + "/fullsize/" + imgName;
	}
	else
	{	
		// main product image							
		if (lastSlash > 0)
		{
			fileName = imgName.substr(lastSlash+1);										
			finalName = imgName.substr(0, lastSlash) + "/fullsize/" + fileName;										
		}																						
		else
		{
			finalName = imgName;
		}
	}
	
	// alert('finalName: ' + finalName);
					
	// open a image display
	Shadowbox.open({
		title:      '',
		type:       'img',
		content:    finalName
	});
}		

addLoadEvent(Shadowbox.init);
