function popupsized(ff, toscroll, w, h){
window.open(ff,"","toolbar=no,directories=no,resizable=no,scrollbars="+toscroll+",location=no,menubar=no,width="+w+",height="+h+",top=0,left=0");
}


// rounded corners for Internet Explorer
//DD_roundies.addRule('.quick_links, .success_story, .featured_partner', '10px');
//DD_roundies.addRule('#container2', '0 0 10px 10px');
//DD_roundies.addRule('.top_nav', '10px 10px 0 0');

//// equal height columns
//function equalHeight(group) {
//	var tallest = 0;
//	group.each(function() {
//		var thisHeight = $(this).height();
//		if(thisHeight > tallest) {
//			tallest = thisHeight;
//		}
//	});
//	group.height(tallest);
//}
<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

var profile = "#1";
var timer = 0;

$(document).ready(function() {

    // coda slider init
    $('#coda-slider-1').codaSlider({
        dynamicArrows: false,
        dynamicTabs: false
    });
    $("#coda-nav-1 li a").hover(function() {
        if (timer <= 0) { // Timer not started, then start timer and set selected profile
            profile = $(this).attr("href");
            selector = "#coda-nav-1 li a[href='" + profile + "']";
            timer = setTimeout("timer=0;$(\"" + selector + "\").click();", 250);
        }
        // Timer already started and profile is not current profile
        // then restart timer and set selected profile
        else if ($(this).attr("href") != profile) {
            profile = $(this).attr("href");
            selector = "#coda-nav-1 li a[href='" + profile + "']";
            clearTimeout(timer);
            timer = setTimeout("timer=0;$(\"" + selector + "\").click();", 250);
        }
    });
    $('h1.logo').click(function() {
        location = "Default.aspx";
    });

    // faq expand q&a
    $('.faq_item').hide();
    $('a.faq_link').click(function() {
        $(this).parent().find('.faq_item').slideToggle('fast');
        return false;
    });

    // quotes transition between slides
    if ($('#quote')[0]) {
        $('#quote').cycle({
            fx: 'scrollDown',
            pause: 1,
            // speed: 500
            timeout: 7000
        });
    }

    // tooltips
    $('.software_link').tooltip({
        track: true,
        delay: 0,
        showURL: false,
        showBody: false,
        fade: 250
    });

    //open rel=external in new window
    $('A[rel="external"]').click(function() {
        window.open($(this).attr('href'));
        return false;
    });
    $('A[rel="external nofollow"]').click(function() {
        window.open($(this).attr('href'));
        return false;
    });

    // Measure the number of lines
    if ($("#test").length == 0) {
        $("body").append("<div id='test'></div>");
    }
    var strLineHeight = $("#test").css('line-height'); // example: "12px"
    var lineHeight = Number(strLineHeight.substr(0, strLineHeight.length - 2)); // example: 12
    if (isNaN(lineHeight)) lineHeight = 13; // IE fix because css line-height returns "normal" instead of "12px"
    $("#discipline_ul li a, .product_ul li a, .partner_ul li a").each(function() {
        $("#test").width($(this).width());
        $("#test").html($(this).html());
        var testHeight = $("#test").height();
        var lines = testHeight / lineHeight;

        if (lines == 2) {
            $(this).parent().addClass("two_line");
        }
        else if (lines == 3) {
            $(this).parent().addClass("three_line");
        }
        else if (lines == 4) { // style not created yet
            $(this).parent().addClass("four_line");
        }
    });
    $("#test").remove(); // clean up
    // End line number measurement

    $(".product_ul").equalHeights();
    $(".partner_ul").equalHeights();

    $("#register_login_plus").toggle(
    function() {
        $("#register_login_popup").show()
    },
    function() {
        $("#register_login_popup").hide();
    });
    $("#locations_plus").toggle(
    function() {
        $("#locations_popup").show();
    },
    function() {
        $("#locations_popup").hide();
    });

    var search_default_value = $("input[id$='_SearchTB']").val();
    $("input[id$='_SearchTB']").focus(function() {
        if ($(this).val() == search_default_value) {
            $(this).val("");
        }
    });
    $("input[id$='_SearchTB']").blur(function() {
        if ($(this).val() == "") {
            $(this).val(search_default_value);
        }
    });
});



