
$(function() {
    // Popup Content
    $("#logos").find(".popup").each(function() {
        var title = $(this).attr('title');
        //console.log(title);
        switch(title) {
            case "wp7":
                
                $(this).html('<h2>Microsoft - Windows Phone 7</h2>\n\
<p>This newcomer to the mobile smartphone race packs quite the punch and takes a few risks, but it has to in order to survive. And survive it does.</p>\n\
<p>With native support for .NET languages, Silverlight, and the DirectX powered XNA library, development couldnt be more approachable and we couldn\'t be happier to develop for it.</p>');
                
                break;
            case "ios":
                
                $(this).html('<h2>Apple - iOS (iPhone/iPod Touch/iPad)</h2>\n\
<p>When people ask online "What phone should I get next", at last 70% of folk will blurt out "IPHONE!" of some variation. With its reputation for top grade PR and coining the phrase "theres an app for that" the Apple iOS is a force to be reckoned with in this industry.</p>\n\
<p>Powered by Objective-C and OpenGL and Fueld by the hopes and dreams of millions, its a simple device that can do pretty much anything you tell it to do.</p>');
                
                break;
            case "android":
                
                $(this).html('<h2>Google - Android</h2>\n\
<p>The first <i>real</i> answer to Apples iPhone was Googles Android platform, the main promise was open ended structure fueled by open source ideals. Basically: a computer in your pocket.<p>\n\
<p>Android is primarily powered by Java and everything that particular language has to offer. When asked to those in the know of "Which is the best/most powerful phone?", most typically mention phones that are powered by the Android OS. And indeed, its the closest thing you can get to carrying a mini computer on you at all times.</p>');
                
                break;
            case "blackberry":
                
                $(this).html('<h2>Research in Motion - Blackberry</h2>\n\
<p>RIM has a reputation to uphold, while not one of the first it certainly was the most prominant and popular PDA Phone available when first introduced. Since then it\'s been following calmly in the footsteps of Apple offering new servies and attempting to appeal to the general market, instead of just business moguls.</p>\n\
<p>Much like Android, BB is powered by Java and offers a complex and modern operating system to house just about any idea you set your mind to.</p>');
                
                break;
        }

       
    });
})


function contactus() {
    openModal(550, "Contact Us");
    $.post("ajax.php", {
        action: "GetContactUs"
    }, function(data) {
        $("#content").html(data);
        
        repositionModal();
    });
}

function openModal(mwidth, mtitle) {
    $("#modal").css("display", "none");
    $("#modal-wrapper").css("display", "none");
    $("#content").html("<center>Loading...<br /><img src=\"./images/ajax.gif\" /></center>");
    
    $("#modal-wrapper").css("width", mwidth+"px");
    $("#modal-title").html(mtitle);
    
    var hpos = ($(document).width()/2)-($("#modal-wrapper").width()/2);
    var vpos = ($(document).height()/2)/2;
    
    
    $("#modal-wrapper").css("left", hpos+"px");
    $("#modal-wrapper").css("top", vpos+"px");
    
    
    
    $("#modal").fadeIn('slow', function() {
        $("#modal-wrapper").fadeIn('slow', function() {
            
        });
    });
}

function repositionModal() {
    var hpos = ($(document).width()/2)-($("#modal-wrapper").width()/2);
    var vpos = ($(document).height()/2)-($("#modal-wrapper").height()/2);
    console.log("Doing it...");
    $("#modal-wrapper").animate({
        left: hpos,
        top: vpos
    }, 'slow', function() {
        
    });
}

function closeModal() {
    $("#modal").fadeOut('slow');
}



/* GOOGLE */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23232541-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


