// JavaScript Document
function pagePreview(actualurl) {
//brandingframe.close();
var framewin = window.open("","brandingframe");
framewin.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
 +'<html xmlns="http://www.w3.org/1999/xhtml">'
 +'<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'
 +'<title>Preview</title>'
 +'<link href="http://www.afgdev.com/afg3.0/css/framebranding.css" rel="stylesheet" type="text/css" />'
 +'<script type="text/javascript" src="http://www.afgdev.com/afg3.0/js/jquery-1.3.2.js"></script>'
 +'<script type="text/javascript" src="http://www.afgdev.com/afg3.0/js/iframeFix.js"></script>'
 +'</head>'
 +'<body>'
+'<div class="header" id="header-bar"><a href="http://www.avrettfreeginsberg.com"><img src="http://www.afgdev.com/afg3.0/images/afg.jpg" alt="fag" title="afg" style="float:left;"  border="0"/></a><a href="#" onclick="window.close();"><img src="http://www.afgdev.com/afg3.0/images/close_window.jpg"  style="float:right;" alt="close header" title="close header"  border="0"/></a>'
+'<a href="' + actualurl + '" target="_top"><img src="http://www.afgdev.com/afg3.0/images/remove_header.jpg" alt="remove header" style="float:right;" title="remove header" border="0"/></a></div>'
+'<iframe id="preview-frame" src="' + actualurl + '" frameborder="0" scrolling="auto" ></iframe>'
+"</body></html>"
)
framewin.document.close();
void(0);
}

jQuery(document).ready(function() {
	jQuery("#main, #footer").animate({opacity: 0},0).animate({opacity: 1},1000);
	jQuery("#main, #footer").removeClass("hide").addClass("show");
	
	
	
	jQuery(".menu a, a.thumbnailFeature, a.sorting").click(function(event){
		event.preventDefault();
		linkLocation = this.href;
		
		jQuery("#main, #footer").animate({opacity: 1},0).animate({opacity: 0},500, redirectPage);		
		
		
		
	});

	
	jQuery("a.afglink").click(function(event){
		event.preventDefault();
		linkLocation = this.href;
		pagePreview(linkLocation);

			
	});

		
	function redirectPage() {
window.location = linkLocation;

}

	} //functon end
); //ready end


/*

function highlight(targetEl){
	jQuery(targetEl).animate({backgroundColor: 'red'},500);
	jQuery(targetEl).addClass("live");
}

function kickit(){
	  jQuery("#main").animate({
							  opacity: 0,
							  left:"1000px"
							  },0).animate({
								opacity: 1,
							  	left:"0px"
							  },1000);
	jQuery("#main").removeClass("hide").addClass("show");
	
	jQuery("a").click(function(event){
		event.preventDefault();
		linkLocation = this.href;
		jQuery("#main").animate({
								opacity: 0,
							  	left:"-1000px"
							  },1000, redirectPage);		
	});
		
	function redirectPage() {
		window.location = linkLocation;
	}
	}
	
	
	
	
*/
