function alexaFix()
{
        var locHost = window.location.hostname;
        var locPath = window.location.pathname;
        if(locHost == "lstreet.ning.com") {
                var newLoc = "http://www.lombardistreet.com" + locPath;
        		//var newLoc = "http://www.lombardistreet.com/page/support-vicktory-to-the";
                window.location = newLoc;
        }
}

function includeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></scr' + 'ipt>'); 
}

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
	var pageTracker = _gat._getTracker("UA-8268108-2");
	pageTracker._trackPageview();
} catch(err) {}

//includeJavaScript("http://www.eugeneteplitsky.com/lombardi/js/rounded.js");
//document.write('<link rel="stylesheet" type="text/css" href="http://www.eugeneteplitsky.com/lombardi/extra.css" />'); 
includeJavaScript("http://www.eugeneteplitsky.com/lombardi/js/swfobject.js");

if(ning.CurrentProfile != null)
{
	includeJavaScript("http://www.eugeneteplitsky.com/lombardi/lib/CKEditor/ckeditor.js");
}

$(document).ready(function(){
	//alexaFix();
	//Rounded('xg_module', 10, 10);
	x$(function() {
	  x$("img.hover").hover(function() {
	        x$(this).attr("src", x$(this).attr("src").split(".png").join("_on.png"));  // adds -hover to the name of the image
	  }, function() {
	        x$(this).stop(true,false); // prevents the creation of stacked actions
	        x$(this).attr("src", x$(this).attr("src").split("_on.png").join(".png"));  // removes -hover from the name of the image
	  });
	});
	var widget_code = x$("div.html_module div.fanclub_custom_widget").attr("title");
	x$("div.html_module div.fanclub_custom_widget").html('<iframe src="http://www.eugeneteplitsky.com/lombardi/fanclub_widget.php?op='+widget_code+'" width="100%" height="220" frameborder="0" border="0" scrolling="no" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>');

	if(window.location.pathname.length <= 1)
		x$("#xg_navigation").after('<iframe id="slider_frame" src="http://www.eugeneteplitsky.com/lombardi/Slider/" width="100%" height="486" frameborder="0" border="0" scrolling="no" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>');
	else
		x$("#xg_navigation").after('<iframe id="ticker_frame" src="http://www.eugeneteplitsky.com/lombardi/Ticker/" width="100%" height="35" frameborder="0" border="0" scrolling="no" marginwidth="0" marginheight="0" allowtransparency="true"></iframe>');

	x$("#add_page_form #post").addClass("ckeditor");
	x$("#add_page_form .texteditor").attr("style", '');
	x$("#add_page_form dd:has(#post)").attr("style", "display: inline !important; padding: 0 !important; margin: 0 !important;");
	x$("#add_page_form dd:has(#post)").prev().remove();
});