$(function() {
//    $( "button, input:submit" ).button();

//    $('.paginated').dataTable();


});




function popup(id, title)
{
    $(id).dialog({title: title, width: 600});
}



function link()
{

}

var is_logged_in = function(){
    var r;
    $.ajax({
        url: '/ajax/users/status',
        async: false,
        dataType: 'json',
        success: function(response){
            r = response.logged_in;
        }
    });
    return r;
}

function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; } } window.onload = externalLinks;


$(document).ready(function(){

        /*$("#nav_products").mouseover(function(e){
            $(this).doTimeout( 'nav', 250, over, e.target );
        }); */  
        $("#nav_products").mouseover(function(){
             $("#product_rollover").show();
        });  
        $("#product_rollover").mouseover(function(){
             $("#product_rollover").show();
        });          
        
//        $(".product_select").mouseover(function(){
//            $("#product_rollover").show();
//        });


         $("#nav_all").mouseout(function(){
             $("#product_rollover").hide();
        }); 

        /* function over( elem ) {
            //$('subnav-wrap-'+$(elem).attr('id')).fadeIn(150).show();
           $("div#product_rollover").fadeIn(50).show();
        } */

 
 
});

function callFloodlight_new(source, type, cat) {
        var tag_url="http://fls.doubleclick.net/activityi;src=" + source + ";type=" + type + ";cat=" + cat + ";ord=1;num="+Math.floor(Math.random()*999999)+"?";
        if(document.getElementById("DCLK_FLDiv")){var flDiv=document.getElementById("DCLK_FLDiv");}
        else{var flDiv=document.body.appendChild(document.createElement("div"));flDiv.id="DCLK_FLDiv";flDiv.style.display="none";}
        var DCLK_FLIframe=document.createElement("iframe");
        DCLK_FLIframe.id="DCLK_FLIframe_"+Math.floor(Math.random()*999999);
        DCLK_FLIframe.src=tag_url;
        flDiv.appendChild(DCLK_FLIframe);
}

function callFloodlight_same(source, type, cat, url) {
        var tag_url="http://fls.doubleclick.net/activityi;src=" + source + ";type=" + type + ";cat=" + cat + ";ord=1;num="+Math.floor(Math.random()*999999)+"?";
        if(document.getElementById("DCLK_FLDiv")){var flDiv=document.getElementById("DCLK_FLDiv");}
        else{var flDiv=document.body.appendChild(document.createElement("div"));flDiv.id="DCLK_FLDiv";flDiv.style.display="none";}
        var DCLK_FLIframe=document.createElement("iframe");
        DCLK_FLIframe.id="DCLK_FLIframe_"+Math.floor(Math.random()*999999);
        DCLK_FLIframe.src=tag_url;
        flDiv.appendChild(DCLK_FLIframe);
        setTimeout("window.location.href = '" + url + "';", 1000);

}

function callStaticFL(source, type, cat) {
        var axel = Math.random() + "";
        var num = axel * 1000000000000000000;
        var tag_url = new Image();
        tag_url.src = "http://ad.doubleclick.net/activity;src=" + source + ";type=" + type + ";cat=" + cat + ";ord=1;num="+num+"?";

}


