// Break out of others' frames
if(top!= self) top.location.href = self.location.href
// then, from http://www.webmasterworld.com/forum91/2831.htm
if (top!= self)  
 if (location) top.location.replace(self.location.href) 
 else top.document.location.replace(self.document.location.href);

// From http://www.sightspecific.com/~mosh/Tricks/Unframe/ 
//////////////////////////////////////////////////////////////////////////
//
// Function unFrame:
// 		Called when webpage is being framed.  Load current page into top-level
//		window (unFrame).

//
///////////////////////////////////////////////////////////////////////////////

function unFrame() {
	top.location.href = self.location.href;				// unFrame
	}

///////////////////////////////////////////////////////////////////////////////
//
// Function err_handler:
// 		Handles all errors due to JavaScript.  The only error that is possible
// 		from this script is one in which top.location.hostname is unreadable
// 		which implies that it is not of this site.  So react by UnFraming.
//
//		This function and the following window.onerror statement MUST preceed
//		the check_If_Framed() function definition.
//
///////////////////////////////////////////////////////////////////////////////

function err_handler (msg, url, line) {						// Define the error handler
	unFrame();												// unFrame() this page
	return true;										// Do nothing (disallow warning dialog)
	}

window.onerror = err_handler;								// Register the error handler

///////////////////////////////////////////////////////////////////////////////
//
// Function check_If_Framed:
// 		Checks to see if this webpage is being framed by checking if the top
//		level frame's hostname (www.hostname.dom) is the same as the current
//		page's hostname.  If yes, do nothing.  If no, react by UnFraming.
//
///////////////////////////////////////////////////////////////////////////////

function check_If_Framed() {
	if (top.location.hostname == null) {				// If being "framed"...
		unFrame();										// unFrame() this page
		}
	}
	
///////////////////////////////////////////////////////////////////////
// Image Preloader  v1.0.1
// documentation: http://www.dithered.com/javascript/image_preloader/
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)

function preloadImages() {
	if (document.images) {
		for (var i = 0; i < preloadImages.arguments.length; i++) {
				(new Image()).src = preloadImages.arguments[i];
		}
	}
}

// AutoBlink
// Puts Google's Autolink on the Blink :)
// (c) 2005 Chris Ridings   http://www.searchguild.com
// Redistribute at will but leave this message intact

var linkcount;
function checklinks() {
	if (!(linkcount==document.links.length)) {
		// Something changed the links!
		// Iterate for an id of _goog
		for (i=0; i < document.links.length; i++) {
			if (document.links[i].id.substring(0,5)=="_goog") {
				// If we find an id of _goog then remove the link!
				var tr = document.links[i].parentTextEdit.createTextRange();
				tr.moveToElementText(document.links[i]);
				tr.execCommand("Unlink",false);
				tr.execCommand("Unselect",false);
			}
		}
	}
		setTimeout("checklinks()",500);
}
if (document.getElementById && document.createElement) {
	linkcount=document.links.length;
	setTimeout("checklinks()",500);
}
