﻿$(document).ready(function() {
    //init rounded corners
    $('#footer,#pre-footer, #content, div.module, div.module2, div.module3, #hp-feature-callout').each(function(){
        $(this).corners("6px transparent");
    });
    
    //init fontsizer
    $("#fs1").click(function(){
        $(".col") .removeClass("small");
        $(".col").addClass("big");
    });
    $("#fs2").click(function(){
        $(".col").removeClass("big").removeClass("small");
    });
    $("#fs3").click(function(){
        $(".col") .removeClass("big");
        $(".col").addClass("small");
    });
    
    //init tooltips
    $(".tooltip").each(function(){
        $(this).tooltip({ 
            track: true, 
            delay: 0, 
            showURL: false, 
            bodyHandler: function() { 
                return $("#ref-"+ $(this).text()).html(); 
            },
            fade: 350  
        });
    });
    
    //init footer links
    $(".endolink").bind('click',function(e){
        e.preventDefault();
        endo(this.href);
     })
     
     //activate email links
    $('.emailLink').each(function(){
        $(this).mouseover(function(){
            linkVals = $(this).attr('name').split('|');
            $(this).attr('href','mailto:'+linkVals[0]+'@'+linkVals[1])
        });
    });
    
});

function warnContinue(url) {
	window.open(url, '', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=820,height=560');
	ntptEventTag( 'lc=' + escape( url ) + '&rf=' + escape( document.location ) );
	window.close();
}

function warnCancel(url) {
	window.close();
}

function leavingsite(url) {
    window.open(url,'leavingsite','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=0,width=430,height=290');
    ntptEventTag( 'lc=' + escape( url ) + '&rf=' + escape( document.location ) );
    return false;
}

 function endo(url) {
    window.open(url,'endo','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=827,height=740');
    ntptEventTag( 'lc=' + escape( url ) + '&rf=' + escape( document.location ) );
    return false;
 }
 
  function endoFlash(url) {
    window.open(url,'endo','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=827,height=740');
    ntptEventTag( 'lc=' + escape( url ) + '&rf=' + escape( document.location ) );
 }
 
