// --------------------------------------------------
// INIT 
// --------------------------------------------------

function initFlash() {

	window.hasflash = true;
	if (jQuery.browser.flash) {
	

		$('#flMediaContent').html('<a href="ur-channel_files/mc.swf"></a>');
		$('#flMediaContent a').media( {
			//width: 892, 
			//width: 870,
			width: 800,
			height: 250, 
			autoplay: true, 
			bgColor:'#000000',
			attrs:     {
				id:  'mc',
				name:  'mc',
				scale: 'exactfit',
				allowScriptAccess:'sameDomain' },
				params:     { 
					id:  'mc',
					name:  'mc',
					allowScriptAccess: value="sameDomain",
					scale: value= 'exactfit'
				}
		}); 
		$('#homepageLeftColumn').html('<a href="ur-channel_files/left-words.swf"></a>');	
		$('#homepageLeftColumn a').media( {
			width: 100,
			height: 500, 
			bgColor:'#000000',
			attrs:     { id:  'leftWords',  name:  'leftWords', allowScriptAccess:'sameDomain' },
			params:     { 
				id:  'leftWords',
				name:  'leftWords',
				allowScriptAccess: value="sameDomain" }
		}); 
		$('#homepageRightColumn').html('<a href="ur-channel_files/right-words.swf"></a>');	
		$('#homepageRightColumn a').media( {
			width: 100,
			height: 500, 
			bgColor:'#000000',
			attrs:     { id:  'rightWords',  name:  'rightWords', allowScriptAccess:'sameDomain' },
			params:     { 
				id:  'rightWords',
				name:  'rightWords',
				allowScriptAccess: value="sameDomain" }
		}); 		
			
		$('.left').click(function(){
			tellFlash("left")
		});
		
		$('.right').click(function(){
			tellFlash("right")
		});
	
	}
	
	
	
	
	
	
}
// --------------------------------------------------
// FLASH DETECTION 
// --------------------------------------------------

/*
*jQuery browser plugin detection 1.0.2
* http://plugins.jquery.com/project/jqplugin
* Checks for plugins / mimetypes supported in the browser extending the jQuery.browser object
* Copyright (c) 2008 Leonardo Rossetti motw.leo@gmail.com
* MIT License: http://www.opensource.org/licenses/mit-license.php
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.
*/

(function($){if(typeof $.browser==="undefined"||!$.browser){var browser={};$.extend(browser);}var pluginList={flash:{activex:"ShockwaveFlash.ShockwaveFlash",plugin:/flash/gim},sl:{activex:["AgControl.AgControl"],plugin:/silverlight/gim},pdf:{activex:"PDF.PdfCtrl",plugin:/adobe\s?acrobat/gim},qtime:{activex:"QuickTime.QuickTime",plugin:/quicktime/gim},wmp:{activex:"WMPlayer.OCX",plugin:/(windows\smedia)|(Microsoft)/gim},shk:{activex:"SWCtl.SWCtl",plugin:/shockwave/gim},rp:{activex:"RealPlayer",plugin:/realplayer/gim},java:{activex:navigator.javaEnabled(),plugin:/java/gim}};var isSupported=function(p){if(window.ActiveXObject){try{new ActiveXObject(pluginList[p].activex);$.browser[p]=true;}catch(e){$.browser[p]=false;}}else{$.each(navigator.plugins,function(){if(this.name.match(pluginList[p].plugin)){$.browser[p]=true;return false;}else{$.browser[p]=false;}});}};$.each(pluginList,function(i,n){isSupported(i);});})(jQuery);

// --------------------------------------------------
// ARRAY
// --------------------------------------------------

window.targetObjectArray = {


	"mc1": {"url":"ur_show/", "id":"URChannel_1"},
	"mc2": {"url":"ur_broadcast/","id":"URChannel_2"},
	"mc3": {"url":"ur_creative/","id":"URChannel_3"},
	"mc4": {"url":"ur_kiosk/",  "id":"URChannel_4"},
	"mc5": {"url":"ur_training/", "id":"URChannel_5"},
	
	"mc6": {"url":"ur_tunes/",  "id":"URChannel_6"},
	"mc7": {"url":"ur_kiosk/",  "id":"URChannel_7"}
}


// --------------------------------------------------
// FLASH 
// --------------------------------------------------


function tellFlash(dir) {
		var flashObject = document.getElementById("mc");
		if (flashObject != null) {
			if (dir == "right") {
				flashObject.goRight();
			} else {
				flashObject.goLeft();
			}
		} else {
			alert('flashobject is null')
		}
	}
	
function gotoTarget(val) {
	var id = "#"+(targetObjectArray[val].id)
	var title = $('.title', id).html();
	var subtitle = $('.itemSubtitle', id).html();
	var content = $('.itemContent', id).html();
	
	
	
	var titlecolor =  $('.title', id).css('color');
	var subtitlecolor =  $('.itemSubtitle', id).css('color');
	var contentColor =  $('.itemContent', id).css('color');
	
	
	/*
	$('.fl_item').fadeOut(100, function(){
		$(this).css({"display":"block", "opacity":0});
		$('.fl_item .title').html(title);
		$('.fl_item .itemSubtitle').html(subtitle);
		$('.fl_item .itemContent').html(content);
		Cufon.refresh()
		  $(this).animate({
			opacity: 1
		  }, 500, function() {
		  });
	})
	*/
	
	// DO NOT FADE AS ABOVE. DEFER TO THE PROCESSING THAT
	// FLASH NEEDS TO ANIMATE FLASH PIECE.
	$('.fl_item').css({"display":"block", "opacity":0});
	
	
		$('.fl_item .title').html(title).css('color', titlecolor);
		$('.fl_item .itemSubtitle').html(subtitle).css('color', subtitlecolor);
		$('.fl_item .itemContent').html(content).css('color', contentColor);
		
		
		if (window.noCufon != true) {
			Cufon.refresh();
		}
		
		
	$('.fl_item').css({"display":"block", "opacity":1});
		

	
	
	
	$('.title, .itemContent, .itemSubtitle', '.fl_item').unbind("click").click(function(){
		location.href = targetObjectArray[val].url;
	});
	
	return false
}











