var resetting;
var lastclicked = null;

function createSilverlight()
{
	var scene = new HomePageProjects.Page();
	Silverlight.createObjectEx({
		source: "homepageprojects/Page.xaml",
		parentElement: document.getElementById("SilverlightControlHost"),
		id: "SilverlightControl",
		properties: {
			width: "100%",
			height: "100%",
			version: "1.0"
		},
		events: {
			onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
		}
	});
}


if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}

function thumb_click(sender, args)
{
    switch (lastclicked.Name)
    {
        case "menu1":
            window.open("http://www.generaltours.com");
            break;
        case "menu2":
            window.open("http://www.themeathouse.com");
            break;
        case "menu3":
            window.open("http://www.nextelraceexperience.com");
            break;
        case "menu4":
            window.open("http://www.nflaccesstour.com");
            break;
        case "menu5":
            window.open("http://www.studentloansolutions.com");
            break;
    }
}

function canvas_load(sender, args)
{
    sender.Resources.findName("loadmenu").Begin();
    lastclicked = sender;
    load_details();
}

function thumbmouseenter(sender, args)
{
    sender.Resources.findName("thumbmouseenter").Begin();
}

function thumbmouseleave(sender, args)
{
    sender.Resources.findName("thumbmouseleave").Begin();
}

function menu_mouseenter(sender, args)
{
    sender.findName("menumouseenter").Stop();
    sender.findName("menumouseenter")["Storyboard.TargetName"] = sender.Name;
    sender.findName("menumouseenter").Begin();
}

function menu_mouseleave(sender, args)
{
    sender.findName("menumouseleave").Stop();
    sender.findName("menumouseleave")["Storyboard.TargetName"] = sender.Name;
    sender.findName("menumouseleave").Begin();
}

function load_details()
{
    switch (lastclicked.Name)
    {
        case "menu1":
            lastclicked.findName("quotetext").Text = "\"MI has given General Tours a truly state-of-the-art travel marketing website.\"";
            lastclicked.findName("quotesource").Text = "(Craig Davis, CFO, General Tours)";
            lastclicked.findName("descriptiontext").Text = "Mighty Innovation is primary developer for a complete overhaul of the General Tours website and delivers state-of-the-art functionality for the travel agency industry.\n\nWe developed a model offering full control over all attributes of any vacation offered, custom pricing grid uploads, partner-targeted specials and prices, seamless integration from tour details through booking, and much more.\n\nGeneral Tours is forecasted to book over $2 million in vacations with MI's solution in the first year alone.\n\nTo see the fruits of this effort, visit GeneralTours.com.";
            lastclicked.findName("projectname").Text = "Vacation Shopping at General Tours";
            lastclicked.findName("slsthumb").source = "homepageprojects/gentoursthumb.jpg";
            break;
        case "menu2":
            lastclicked.findName("quotetext").Text = "\"MI provided us with a powerful and dynamic solution that allows us to manage every aspect of our online offerings.\"";
            lastclicked.findName("quotesource").Text = "(Chris Carragher, Marketing Director, The Meat House)";
            lastclicked.findName("descriptiontext").Text = "Mighty Innovation gives The Meat House online shopping, allowing meat lovers the ability to order from their entire product line and ship orders anywhere nationwide.\n\nMI also provided The Meat House the ability to manage every category, product and price in the online catalog, as well as complete content management over their press releases and announcements published on TheMeatHouse.com.\n\nWithin just months, The Meat House earned back every penny they invested in MI's custom solution.";
            lastclicked.findName("projectname").Text = "Online Shopping at The Meat House";
            lastclicked.findName("slsthumb").source = "homepageprojects/meathousethumb.jpg";
            break;
        case "menu3":
            lastclicked.findName("quotetext").Text = "\"This is a true representation of data-driven interactivity\"";
            lastclicked.findName("quotesource").Text = "(Clint Taylor, CEO, Mighty Innovation)";
            lastclicked.findName("descriptiontext").Text = "Mighty Innovation is chosen as primary developer for NextelRaceExperience.com, the website for a tour giving people the chance to compete nationwide on NASCAR racing simulators and create custom personalized pictures of themselves with the Nextel Cup.\n\nWe provide the engine that drives a real-time leaderboard, user registration, photo customization, marketing surveys, and overall tour stop management\n\nFor more information, visit NextelRaceExperience.com.";
            lastclicked.findName("projectname").Text = "The Nextel Race Experience";
            lastclicked.findName("slsthumb").source = "homepageprojects/nextelthumb.jpg";
            break;
        case "menu4":
            lastclicked.findName("quotetext").Text = "\"Another representation of first-class data-driven interactivity for two years running.\"";
            lastclicked.findName("quotesource").Text = "(Clint Taylor, CEO, Mighty Innovation)";
            lastclicked.findName("descriptiontext").Text = "For the second year running, Mighty Innovation is chosen to develop this nationwide internet promotional tour.\n\nOur expertise provides the NFLAccessTour.com staff the tools to manage the tour's voting windows, select and notify finalists/winners, and analyze statistics for each stop across the football nation.\n\nFor more details, visit NFLAccessTour.com.";
            lastclicked.findName("projectname").Text = "NFL Access Tour 2006 & 2007";
            lastclicked.findName("slsthumb").source = "homepageprojects/nflthumb.jpg";
            break;
        case "menu5":
            lastclicked.findName("quotetext").Text = "\"Since MI's state-of-the-art client management system, productivity has grown 200%.\"";
            lastclicked.findName("quotesource").Text = "(Mark Gazda, CEO, Student Loan Solutions)";
            lastclicked.findName("descriptiontext").Text = "Mighty Innovation provides Student Loan Solutions (SLS) a full enterprise web application that tracks and manages all aspects of sales, marketing, customer and employee activity. \n\nWeb marketing referrals are tracked; sales activity is logged by SLS sales staff; SLS customer service logs each step of every client's progress; customers view their account status in real-time; managers and executives access real-time efficiency reports on sales, marketing and customer service.\n\nMI's custom CRM solution has increased SLS's employee and management productivity more than twofold.";
            lastclicked.findName("projectname").Text = "CRM at Student Loan Solutions";
            lastclicked.findName("slsthumb").source = "homepageprojects/slsthumb.jpg";
            break;
        default:
            lastclicked.findName("quotetext").Text = "";
            lastclicked.findName("quotesource").Text = "";
            lastclicked.findName("descriptiontext").Text = "Every day, Mighty Innovation integrates award-winning, cutting-edge technical expertise with enterprise-wide business experience to create web applications focused on the most profitable business result.\n\nOur impeccable reputation spanning many industries is the result of our ability to quickly and accurately translate business vision and requirements into practical, technical goals.\n\nWe invite you to check out some of our portfolio, and then contact us with any questions about how we can help your business succeed!";
            lastclicked.findName("projectname").Text = "Click the tabs on the left to begin!";
            lastclicked.findName("slsthumb").source = "";
            break;
    }
    
    lastclicked.findName("menuclick").Begin();
}

function reset_completed(sender, args)
{
    load_details();
}

function menu_mouseclick(sender, args)
{
    //sender.findName("resetdetails").Stop();
    //sender.findName("menuclick").Stop();

    resetting = true;
    lastclicked = sender;
    sender.findName("resetdetail").Begin();

}

/*
function mouseenter(sender, args)
{
    if (partnerdown && sender.Name != "partners")
        canvas_mouseleave(sender, args)
    sender.Resources.findName("mouseoverstory").Stop();
    sender.Resources.findName("mouseoverstory")["Storyboard.TargetName"] = sender.Name + "_scale";
    sender.Resources.findName("mouseoverstory").Begin();
}
*/
