﻿function DisplayVideo(vid){
	if (AC_FL_RunContent == 0) 
	{
		alert("This page requires AC_RunActiveContent.js.");
	}
	 else 
	 {	    	 
		var videoURL = "";
		var flashvars = "";
		var width = '540';
		var height = '500';
		if (vid>=1 && vid<=3)
		{
		    videoURL = '../Videos/raphael' + vid + '.flv';
		    flashvars = 'videoURL=' + videoURL;
		}
	    else if (vid==4)
	    {
		        videoURL = 'http://gannett.a.mms.mavenapps.net/mms/rt/1/site/gannett-wusa-3312-pub01-live/current/articleplayer/singleclip/client/embedded/embedded.swf';
		        flashvars = "playerId=articleplayer&referralObject=826380237&referralPlaylistId=playlist&adServerBasePath=http://gcirm.gannett-tv.gcion.com/RealMedia/ads/adstream_sx.ads&adPositionId=x25&adSiteId=video.wusatv9.com/news&gpaperCode=gntbcstwusa&marketName=Washington, DC&division=broadcast&pageContentCategory=articleplayer&pageContentSubcategory=articleplayer";
		}
		else if (vid==5)
		{
		        videoURL = 'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.17';
		        flashvars = "id=9157994&vid=3249879&lang=en-us&intl=us&thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/i/us/sch/cn/v/v9/w314/3249879_180_135.jpeg&embed=1";
		}
		else if (vid==6)
		{
		    videoURL = '../Videos/GalAlmog1.flv';
		    flashvars = 'videoURL=' + videoURL;
		}

        else if (vid==7)
		{
		    videoURL = '../Videos/RealmatchOverviewForEmployers.flv';
		    flashvars = 'videoURL=' + videoURL;
		}
		if (vid!=4 && vid!=5)
		    AC_FL_RunContent(
			    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
//			    'width', width,
//			    'height', height,		
                'class','SWFObjectVideo',		
			    'src', '../Videos/Player',						
			    'quality', 'high',
			    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			    'align', 'middle',
			    'play', 'true',
			    'loop', 'true',
			    'scale', 'showall',
			    'wmode', 'window',
			    'devicefont', 'false',
			    'id', 'Player',
			    'bgcolor', '#ffffff',
			    'name', 'Player',
			    'menu', 'true',
			    'allowFullScreen', 'false',
			    'allowScriptAccess', 'always',
			    'movie', '../Videos/Player',
			    'flashvars',flashvars,
			    'salign', ''
			    ); //end AC code
        else
        {
                if(DivID==null || DivID=="")
		            return;
                var so = new SWFObject(videoURL, "csSWF", width, height, "9.0.28", "#1a1a1a");
			    so.addParam( "quality", "best" );
			    so.addParam( "allowFullScreen", "true" );
			    so.addParam( "scale", "noborder" );
			    so.addParam( "allowScriptAccess", "always" );
			    so.addParam( "salign", "LT" );
			    so.addParam( "bgcolor", "#000000" );
			    so.addParam( "wmode", "window" );
			    so.addParam( "FlashVars", "window" );
			    so.addParam( "allowScriptAccess", "always" );
			    so.addParam( "FlashVars",flashvars );
			    so.write(DivID);
        }
	}
}


function ShowVideoInElm(srcVideo, width, height, elementId, flashvars, alowUpObject)
{
	if (srcVideo == null || srcVideo == "")
		return;
		
	if (width == null)
		width = '540';
	if (height == null)
		height = '500';

	var so = new SWFObject(srcVideo, "csSWF", width, height, "9.0.28", "#1a1a1a");
	so.addParam("quality", "high");
	so.addParam("align", "middle");
	so.addParam("play", "true");
	so.addParam("loop", "true");
	so.addParam("scale", "showall");
	if(alowUpObject && alowUpObject == true)
	    so.addParam("wmode", 'Opaque');
	else    
	    so.addParam("wmode", "window");
	so.addParam("devicefont", "false");
	so.addParam("id", "MovieClipController");
	so.addParam("bgcolor", "#ffffff");
	so.addParam("name", "MovieClipController");
	so.addParam("menu", "true");
	so.addParam("allowFullScreen", "false");
	so.addParam("allowScriptAccess", "always");
	so.addParam("salign", "");
	so.addParam("base", '../Videos');
	
	if (flashvars != null && flashvars!="")
		so.addParam("flashvars", flashvars);
	so.write(elementId);
}


function OpenVideoWindow(width, height, ContId)
{
	var doc = WindowPopup("", "", (width + 20), (height + 20));

	var content_vlue = ""
	if (ContId == 1)
		content_vlue = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width=" + width + " height=" + height + " id='embeddedplayer'><param name='movie' value='http://gannett.a.mms.mavenapps.net/mms/rt/1/site/gannett-wxia-3321-pub01-live/current/immersiveplayer/immersive/client/embedded/embedded.swf'/><param name='allowFullScreen' value='true'/><param name='allowScriptAccess' value='always'/><param name='scale' value='noscale'/><param name='salign' value='LT'/><param name='bgcolor' value='#000000'/><param name='wmode' value='window'/><param name='FlashVars' value='playerId=immersiveplayer3&referralObject=1196997470&referralPlaylistId=playlist&adServerBasePath=http://gannett.gcion.com/adrawdata/.0/5111.1/281378/0/0/header=yes;cc=2;cookie=info;alias=&adPositionId=video_prestream&adSiteId=video.11alive.com/&gpaperCode=gntbcstwxia&marketName=Atlanta, GA&division=broadcast&pageContentCategory=video&pageContentSubcategory=immersiveplayer3'/><embed type='application/x-shockwave-flash' src='http://gannett.a.mms.mavenapps.net/mms/rt/1/site/gannett-wxia-3321-pub01-live/current/immersiveplayer/immersive/client/embedded/embedded.swf' id='embeddedplayer' pluginspage='http://www.macromedia.com/go/getflashplayer' menu='false' quality='high' play='false' name='immersiveplayer3' height=" + height + " width=" + width + " allowFullScreen='true'  allowScriptAccess='always'  scale='noscale'  salign='LT'  bgcolor='#000000'  wmode='window'  flashvars='playerId=immersiveplayer3&referralObject=1196997470&referralPlaylistId=playlist&adServerBasePath=http://gannett.gcion.com/adrawdata/.0/5111.1/281378/0/0/header=yes;cc=2;cookie=info;alias=&adPositionId=video_prestream&adSiteId=video.11alive.com/&gpaperCode=gntbcstwxia&marketName=Atlanta, GA&division=broadcast&pageContentCategory=video&pageContentSubcategory=immersiveplayer3'/></object>";

	doc.document.open();
	doc.document.write('<html><head><title>Video</title>');
	doc.document.write('</head>');
	doc.document.write(content_vlue);
	doc.document.write('</body></html>');
	doc.document.close();
	doc.focus();
}

function WindowPopup(url, name, windowWidth, windowHeight)
{
	myleft = (screen.width) ? (screen.width - windowWidth) / 2 : 100;
	mytop = (screen.height) ? (screen.height - windowHeight) / 2 : 100;
	properties = "width=" + windowWidth + ",height=" + windowHeight + ",toolbar=no,location=no,directories=yes,menubar=no, top=" + mytop + ",left=" + myleft;
	return window.open(url, name, properties);
}