function toggle_leftmenu_panel(ref) {
	$(".menu-level-0 ul").hide("slow");
	$("#"+ref).show("slow");
}
function toggle_cta_panel() {
	if(document.getElementById('cta_panel').className == "show")
		document.getElementById('cta_panel').className="hide";
	else
		document.getElementById('cta_panel').className="show";
}
function toggle_social_panel() {
	if(document.getElementById('social_cta_panel').className == "show")
		document.getElementById('social_cta_panel').className="hide";
	else
		document.getElementById('social_cta_panel').className="show";
}
function addToFavorites(pageName, urlAddress) {
	if (window.sidebar) // Mozilla Firefox Bookmark
		window.sidebar.addPanel(pageName, urlAddress,"");
	else if( window.external ) // IE Favorite
		window.external.AddFavorite(urlAddress, pageName);
	else if(window.opera && window.print) // Opera Hotlist
		return true;
}
// Page ready function
$(document).ready(function () {
	$(".newWindow").click(function() {
			var newWindow = window.open(this.getAttribute('href'), '_blank');
			newWindow.focus();
		});
	if(document.getElementById("color").href.search("colors1") > 1) {
		$("#colorLogo").replaceWith('<img src="/design/plain_site/images/varColor1/companyLogo-varColor1.gif" alt="ADL Insulflex Inc. -Solving high temperature problems worldwide" width="366" height="54" border="0" />');
		$("#leftCR").replaceWith('<img src="/design/plain_site/images/varColor1/copyright1-varColor1.gif" alt="" width="8" height="17" />');
		$("#rightCR").replaceWith('<img src="/design/plain_site/images/varColor1/copyright3-varColor1.gif" alt="" width="8" height="17" />');
	}
	if(document.getElementById("color").href.search("colors2") > 1) {
		$("#colorLogo").replaceWith('<img src="/design/plain_site/images/varColor1/companyLogo-varColor1.gif" alt="ADL Insulflex Inc. -Solving high temperature problems worldwide" width="366" height="54" border="0" style="padding-top: 15px;" />');
		$("#menuwrapper").css('background-image', 'url(http://www.adlinsulflex.com/design/plain_site/images/nav-white.gif)');
		$("#leftCR").remove();
		$("#rightCR").remove();
	}
	if($(document.getElementById("menustyle")).hasClass("2")) {
		$(".nav1").hide();
		$(".nav2").show();
		$("#footer").hide();
	}
	else {
		$(".nav2").hide();
	}
});