var Flash_OnClick = function(key, args) {
    if (typeof (jQuery) == 'undefined') return;
    if (key == 'caseStudy') {
        CaseStudy_Load(args);
    }
}
var CaseStudy_Load = function(id) {
    if (typeof (jQuery) == 'undefined') return;
	
	if(!id) {
		//Change the below to be the default text for when no case study is selected
		jQuery('.hideme').show();
		jQuery('#format_text').show();
		jQuery('#caseDiv').html('');
		jQuery('#testDiv').html('');
		jQuery('#sumDiv').html('');

		
		return;
	}
	
    var sPath = 'Data.ashx?command=getCaseStudyResult&id=' + id;
    var sUrl = '/webservices/dataproxy.php?wsOutput=json&wsPath=' + encodeURIComponent(sPath);
    jQuery.ajax({
        url: sUrl,
        context: document.body,
        success: function(meta) {
            //Turn on the following line to see the data
            //alert(meta);

            //TODO: replace #content with the appropriate DIVs
            meta = eval('(' + meta + ')');
			jQuery('#format_text').hide();
			jQuery('.hideme').hide();
            jQuery('#testDiv').html(meta.Testimonial);
            //jQuery('#sumDiv').html(meta.Summary);
            jQuery('#caseDiv').html(meta.CaseText);
        }
    });
}
var Center_LoadVideos = function(id) {
	//Add the center specific Flash videos
	//TODO: replace content with the appropriate DIV
	swfobject.embedSWF('/wp-content/themes/thesis_16/custom/video-player.swf', 'video_player', 213, 305, '8', '/flash/expressInstall.swf', {
		pType:2,
		pId: id
	}, { wmode: 'transparent' }, null);
}
var resizeIframe = function(height) { 
	var iframe = window.top.document.getElementById("Frame_Locator"); 
	iframe.setAttribute( "height", height ); 
	iframe.style.height = height + 'px'; 
} 


