/**
 * @author David
 */

//document.domain = "galgiani.com";

$(document).ready(function(){
	frameset();
	iframe();
	pdf2thickbox();
});

function frameset(){
	$("a[target*='right']").click(function(){
		//		alert($(this).attr('href'));
		//		$(".col2").load($(this).attr('href'));
		
		$(".col2").load('remotebody.php?url=' + $(this).attr('href'));
		/*
		 url = 'remotebody.php?url='+$(this).attr('href');
		 $.get(url, function(data){
		 alert("Data Loaded: " + data);
		 $(".col2").html(data);
		 });
		 */
		return false;
	});
}	
	
function iframe(){

	$("a[target*='iframe']").click(function(){
//		alert($(this).attr('href'));
		$(".col2").html('');
		$(".col2").append('<iframe id="iframe" width="100%" height="2000px" frameborder="0" border="0" src="'+$(this).attr('href')+'"></iframe>');
		$('#iframe').load(function(){
			alert(this.contentWindow.document.body.offsetHeight);
			//this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
		});
		
		return false;
	});	

}

	
function pdf2thickbox(){
		$("a[target*='shadowbox']").each(function(){
			$(this).attr('href', $(this).attr('href') + "?KeepThis=true&TB_iframe=true&height=550&width=800");
			$(this).addClass('thickbox');
		}
		);
}
