$(document).ready(function () {
 
    // This makes the link inside the iframe open in parent window
    $('a.colorbox').click(function (event) {
		//if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } 											
        event.preventDefault(); // this just cancels the default link behavior.
        top.showColorBox($(this).attr("href")); //this makes the parent window load the showColorBox function, using the a.colorbox href value
    });
	

$("a.example").live("click", function(e){
  e.preventDefault(); 
  top.showColorBox($(this).attr("href")); 
});


});


//This function only needs to be available in the parent window, but no harm in loading it for both. Notice this is NOT in the $(document).ready on purpose.
function showColorBox(imageURL) {
    $.fn.colorbox({ innerWidth: "700px", innerHeight: "650px", iframe: true, transition: "elastic", opacity: .6, open: true, href: imageURL });
}
