/* Usage 

1:  Get JQuery (jquery.com)
2: Put these lines in your header  ( assuming the name of the jquery here )
	<script type="text/javascript" src="scripts/jquery-1.1.2.js"></script>

	<script type="text/javascript" src="scripts/div_toggler.js"></script>
3: 
	Learn how to use jQuery Selectors ( mostly like CSS )
4:
	
	<style>
	div#floater{
		position:absolute; 
		margin-left:25%; 
		margin-right:auto; 
		top:250px; 
		height:50%;
		width:600px;
		z-index:50;
		padding:10px;
		padding-top:0px;
		border:1px solid #000;
		text-align:right;
		background-color:#1476a0;
	}

	div#floater a{
		color: #000;
	}
	div#floater a:hover{
		color: #FFF;
	}

	iframe#floater_iframe{
		width:100%;
		height:95%;
		border:none;
	}
	
	</style>
	<script type="text/javascript">
		$(document).ready(function(){
			$("a.thing_with_href").ifloat();
		});
	</script>
*/


jQuery.stamp=function(){
 	var d = new Date();
 	var time = d.getTime();
 	return time;
};

jQuery.fn.ifloat = function(){
 	this.each(function(){
 		jQuery.post( jQuery(this).attr("href") , { tstamp: jQuery.stamp() }, function(data){ });
 	} );
	this.click(function(){
		jQuery("#floater").remove();
		jQuery("body").append("<div id=\"floater\"/>");
		jQuery("#floater").append("<a href=\"#\" class=\"windclose\">[x]</a>");
		jQuery("#floater").append("<iframe id=\"floater_iframe\"/>");
		jQuery("#floater").append("<div style=\"text-align:center;width:100%\"><a href=\"#\" class=\"windclose\">Close This Window</a></div>");
		jQuery("#floater_iframe").attr("src",jQuery(this).attr("href") );
		jQuery("#floater_iframe > a").click(function(){
		 			jQuery("#floater").remove();
		 			return false;
 		});
		jQuery("a.windclose").click(function(){
		 			jQuery("#floater").remove();
		 			return false;
	 	});
		return false;
	});
	return false;

};



