$(document).ready(function() { 
//Screen Size
if (screen.width>1024) { 
$("#warn").html("Photograph Daddy is best viewed at a screen width of 1024 pixels and may not look it's best on your screen.");
} 
//Comments
$(".photographdaddycom").parent().css("background","#EBEBDE");
$(".photographdaddycom").children().css("background","#EBEBDE");
//Welcome from SmartSillySassy
var from = getUrlVars()["from"];
if (from=='smartsillyandsassy'){
$("#warn").html("Welcome to Photographdaddy.com.<br/>It looks like you were checking out one of my stories from smartsillyandsassy.com which I've moved here, to my main blog. Feel free to look around and comment on anything that interests you.");
$("#warn").slideDown("slow");
}

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");   
    $.getScript(gaJsHost + "google-analytics.com/ga.js", function(){   
  
        try {   
            var pageTracker = _gat._getTracker("UA-75013-11");   
            pageTracker._trackPageview();   
        } catch(err) {}   
  
        var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|txt)$/i;   
  
        $('a').each(function(){   
            var href = $(this).attr('href');   
  
            if ((href.match(/^https?\:/i)) && (!href.match(document.domain))){   
                $(this).click(function() {   
                    var extLink = href.replace(/^https?\:\/\//i, '');   
                    pageTracker._trackEvent('External', 'Click', extLink);   
                });   
            }   
            else if (href.match(/^mailto\:/i)){   
                $(this).click(function() {   
                    var mailLink = href.replace(/^mailto\:/i, '');   
                    pageTracker._trackEvent('Email', 'Click', mailLink);   
                });   
            }   
            else if (href.match(filetypes) || href.match(/(rah_plugin_download)/g)){   
                $(this).click(function() {   
                    var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined;   
                    var filePath = href.replace(/^https?\:\/\/(www.)mydomain\.com\//i, '');   
                    pageTracker._trackEvent('Download', 'Click - ' + extension, filePath);   
                });   
            }   
        });   
    });   



});

// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

$(document).ready(function(){
 $('a[href*=file_download]').click(function(){
  try {
   var p = this.href.match(/http:\/\/[-a-zA-Z0-9\.]*(\/file_download\/[0-9]*\/.*)/)[1];
   pageTracker._trackPageview(p);
  } catch(err) {}
 })
})
