/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();

var SvpBrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	getParam: function(param) {
		switch(param) {
			case 'browser' :{
				return this.browser;
			}
			case 'version' :{
				return this.version;
			}
			case 'OS' :{
				return this.OS;
			}
		}
		return "unknown parameter";
	},
	searchString: function (data) {
		for(var i = 0; i < data.length; i++) {
			var dataString = data[i].string;
			var dataProp = data[i].prop;

			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if(typeof dataString != "undefined" && dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if(typeof dataProp != "undefined" && dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{string: navigator.userAgent, subString: "Chrome", identity: "Chrome"},
		{string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb"},
		{string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version"},
		{prop: window.opera, identity: "Opera"},
		{string: navigator.vendor, subString: "iCab", identity: "iCab"},
		{string: navigator.vendor, subString: "KDE", identity: "Konqueror"},
		{string: navigator.userAgent, subString: "Firefox", identity: "Firefox"},
		{string: navigator.vendor, subString: "Camino", identity: "Camino"},
		{string: navigator.userAgent, subString: "Netscape", identity: "Netscape"}, //for newer Netscapes (6+)
		{string: navigator.userAgent, subString: "MSIE", identity: "Explorer",versionSearch: "MSIE"},
		{string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv"},
		{string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla"} //for older Netscapes (4-)
	],
	dataOS : [
		{string: navigator.platform, subString: "Win", identity: "Windows"},
		{string: navigator.platform, subString: "Mac", identity: "Mac"},
		{string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod"},
		{string: navigator.platform, subString: "Linux", identity: "Linux"}
	]

};

var SvpPlayerInstances = {
	instances: {},
	counter: 0,
	registerInstance: function(id, instance) {
		this.instances[id] = instance;
	},
	getInstance: function(id) {
		return this.instances[id];
	},
	removeInstance: function(id) {
		delete this.instances[id];
	}
};

function SVPDynamicPlayer(id, url, width, height, internal_params, vars, params) {
	//Player variables
	this.player_object_id = id;
	this.player_url = url;
	this.player_width = width;
	this.player_height = height;
	this.min_player_width = 320;
	this.min_player_height = 240;
	this.def_player_width = 400;
	this.def_player_height = 341;
	this.def_big_player_width = 800;
	this.def_big_player_height = 450;
	this.def_player_skin = 0;
	this.def_player_controls_height = 19;
	this.player_align = 'NONE'; //Available values: TL, TC, TR, ML, MC, MR, BL, BC, BR, NONE
	this.player_offset_x = 0;
	this.player_offset_y = 0;
	this.player_offset_left = undefined;
	this.player_offset_top = undefined;
	this.site_root = "http://play.webvideocore.net/";
	
	this.player_instance = null;
	this.player_in_fs_mode = false;
	this.player_fullscreen_mode = 'DOUBLE'; //Available values: DOUBLE, FILL, FIXED, NATIVE, NONE
	this.player_fs_width = 0;
	this.player_fs_height = 0;
	this.player_background_color = '';
	this.player_background_transparency = 0; //in percents
	this.player_keep_state_on_scroll = false;
	this.player_keep_state_on_resize = false;
	
	this.vars = typeof vars != "undefined" ? vars : {};
	this.params = typeof params != "undefined" ? params : {};
	this.internal_params = typeof internal_params != "undefined" ? internal_params : {};
	
	//Internal variables
	SvpBrowserDetect.init();
	this._d = document;
	this._w = window;
	this.browser = SvpBrowserDetect.browser;
	this.version = SvpBrowserDetect.version;
	this.OS = SvpBrowserDetect.OS;
	this.player_id = null;
	
	this.flash_version = '9.0.0';
	this.express_install = 'expressInstall.swf';
	this.player_content_html = '<h1>Get Adobe Flash player</h1><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>';
	
	this.transformInputParameters = function(params) {
		var out_params = new Array();
		for(x in params) {
			out_params[x] = eval('(typeof(' + params[x] + ') != "undefined");') ? eval(params[x]) : undefined;
		}
		return out_params;
	};
	this.getWindowSize = function() {
		var windowWidth = 0, windowHeight = 0;
		if(typeof(this._w.innerWidth) == 'number') {
			//Non-IE
			windowWidth = this._w.innerWidth;
			windowHeight = this._w.innerHeight;
		}
		else if(this._d.documentElement && (this._d.documentElement.clientWidth || this._d.documentElement.clientHeight)) {
			//IE 6+ in 'standards compliant mode'
			windowWidth = this._d.documentElement.clientWidth;
			windowHeight = this._d.documentElement.clientHeight;
		}
		else if(this._d.body && (this._d.body.clientWidth || this._d.body.clientHeight)) {
			//IE 4 compatible
			windowWidth = this._d.body.clientWidth;
			windowHeight = this._d.body.clientHeight;
		}
		return [windowWidth, windowHeight];
	};
	this.getDocumentSize = function() {
		var documentWidth = Math.max(
			Math.max(this._d.body.scrollWidth, this._d.documentElement.scrollWidth),
			Math.max(this._d.body.offsetWidth, this._d.documentElement.offsetWidth),
			Math.max(this._d.body.clientWidth, this._d.documentElement.clientWidth)
		);
		var documentHeight = Math.max(
			Math.max(this._d.body.scrollHeight, this._d.documentElement.scrollHeight),
			Math.max(this._d.body.offsetHeight, this._d.documentElement.offsetHeight),
			Math.max(this._d.body.clientHeight, this._d.documentElement.clientHeight)
		);
		return [documentWidth, documentHeight];
	};
	this.getWindowScrollXY = function() {
		var windowScrollX = 0, windowScrollY = 0;
		if(typeof(window.pageYOffset) == 'number') {
			//Netscape compliant
			windowScrollY = window.pageYOffset;
			windowScrollX = window.pageXOffset;
		}
		else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
			//DOM compliant
			windowScrollY = document.body.scrollTop;
			windowScrollX = document.body.scrollLeft;
		}
		else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
			//IE6 standards compliant mode
			windowScrollY = document.documentElement.scrollTop;
			windowScrollX = document.documentElement.scrollLeft;
		}
		return [windowScrollX, windowScrollY];
	},
	this.getObject = function(id) {
		var object = null;
		if(this._d.getElementById) {
			object = this._d.getElementById(id);
		}
		else if(this._d.layers) {
			object = this._d.layers[id];
		}
		else if(this._d.all) {
			object = this._d.all[id];
		}
		return object;
	},
	this.createElement = function(nodeName, name, id, style) {
		var node;
		try {
			node = this._d.createElement('<' + nodeName + ' name="' + name + '" id="' + id + '" style="' + style + '">');
		} catch (e) {
			node = this._d.createElement(nodeName);
			node.setAttribute('name', name);
			node.setAttribute('id', id);
			node.setAttribute('style', style);
		}
		return node;
	},
	this.getElementPosition = function(element) {
		var x = y = 0;
		if(element.offsetParent) {
			while(1) {
				x += element.offsetLeft;
				y += element.offsetTop;
				if(!element.offsetParent) break;
				element = element.offsetParent;
			}
		}
		else if(element.x || element.y) {
			x += element.x;
			y += element.y;
		}
		return [x, y];
	},
	this.parseVars = function(vars) {
		this.checkParsedVars(this.transformInputParameters(vars));
	},
	this.checkParsedVars = function(vars) {
		//Required variables
		this.vars.clip_id = (typeof vars.clip_id == "undefined") ? 0 : vars.clip_id;
		
		//Optional variables
		this.vars.color = (typeof vars.player_color == "undefined") ? "#9C9EA4" : vars.player_color;
		this.vars.color1 = (typeof vars.player_color1 == "undefined") ? "#FCF6FC" : vars.player_color1;
		this.vars.color_ratio = (typeof vars.player_color_ratio == "undefined") ? "0.6" : vars.player_color_ratio;
		
		var alpha = (typeof vars.alpha == "undefined") ? false : vars.alpha;
		var stretch_video = (typeof vars.stretch_video == "undefined") ? 0 : vars.stretch_video;
		var pause = (typeof vars.pause == "undefined" || vars.pause == '0') ? false : vars.pause;
		var repeat = (typeof vars.repeat == "undefined" || vars.repeat == '0') ? false : vars.repeat;
		
		this.vars.autoHide = (typeof vars.auto_hide == "undefined" || vars.auto_hide == '') ? '0' : vars.auto_hide;
		this.vars.brandNW = (typeof vars.brand_new_window == "undefined" || vars.brand_new_window == '') ? '1' : vars.brand_new_window;
		
		var start_img = (typeof vars.start_img == "undefined") ? 0 : vars.start_img;
		if(start_img) this.vars.start_img = start_img;
		
		var start_volume = (typeof vars.start_volume == "undefined") ? '' : vars.start_volume;
		if(start_volume) this.vars.start_volume = start_volume;
		
		transparent = (typeof vars.transparent == "undefined") ? true : vars.transparent;
		if(transparent == "false") transparent = false;
		
		no_fullscreen = (typeof vars.no_fullscreen == "undefined" || vars.no_fullscreen == '0') ? false : vars.no_fullscreen;
		no_controls = (typeof vars.no_controls == "undefined") ? 0 : vars.no_controls;
		true_fullscreen = (typeof vars.fs_mode == "undefined") ? false : vars.fs_mode == '1';
		native_fullscreen = (typeof vars.fs_mode == "undefined") ? false : vars.fs_mode == '2';
		
		this.only_fs = (typeof vars.only_fs == "undefined") ? false : vars.only_fs;
		if(no_controls) {
			no_fullscreen = true;
			this.only_fs = false;
		}
		
		if(no_fullscreen) this.player_fullscreen_mode = 'NONE';
		this.player_keep_state_on_resize = true;
		
		if(!this.only_fs) {
			this.params.quality = "high";
			
			if(transparent) {
				this.params.wmode = "transparent";
			}
			else if(native_fullscreen) {
				this.params.wmode = "window";
				this.params.allowFullScreen = "true";
				this.vars.native_fs = "1";
			}
			else {
				this.params.wmode = "opaque";
			}
			
			if(alpha) this.vars.alphaPlayer = "1";
			if(pause) this.vars.autoStart = "0";
			if(repeat) this.vars.repeatVideo = "1";
			if(stretch_video) this.vars.stretch_video = "1";
			if(no_fullscreen) this.vars.no_fs = "1";
			
			if(!no_fullscreen) {
				if(typeof vars.fs_mode == "undefined") {
					this.player_fullscreen_mode = 'NONE';
				}
				else if(!vars.fs_mode) {
					this.player_fullscreen_mode = 'FIXED';
					this.player_fs_height = this.def_big_player_height;
					this.player_fs_width = this.def_big_player_width;
				}
				else if(vars.fs_mode == "1") {
					this.player_fullscreen_mode = 'FILL';
					this.params.wmode = 'transparent';
				}
				else {
					this.player_fullscreen_mode = 'NATIVE';
				}
			}
			if(no_controls) {
				this.vars.noControls = no_controls;
			}
		}
		else {
			this.vars.fullscreen = "1";
			if(typeof vars.fs_mode == "undefined" || !vars.fs_mode) {
				this.player_fullscreen_mode = 'FIXED';
				this.player_fs_height = this.def_big_player_height;
				this.player_fs_width = this.def_big_player_width;
			}
			else {
				this.player_fullscreen_mode = 'FILL';
				this.params.wmode = 'transparent';
			}
		}
		
		if(typeof vars.bg_color != "undefined") this.player_background_color = vars.bg_color;
		
		this.vars.page = encodeURIComponent(location.href);
		if(typeof vars.player_align != "undefined" && vars.player_align != "" && vars.player_align != "NONE") {
			this.player_align = vars.player_align;
			this.player_keep_state_on_scroll = true;
		}
		if(typeof vars.offset_x != "undefined" && vars.offset_x != "") this.player_offset_x = vars.offset_x;
		if(typeof vars.offset_y != "undefined" && vars.offset_y != "") this.player_offset_y = vars.offset_y;
		if(typeof vars.bg_transp != "undefined" && vars.bg_transp != "") this.player_background_transparency = vars.bg_transp;
		if(typeof vars.prebuffer != "undefined" && vars.prebuffer != "") this.vars.preLoad = vars.prebuffer;
		if(typeof vars.rid != "undefined") this.vars.rid = vars.rid;
		if(typeof vars.ext != "undefined") this.vars.ext = vars.ext;
		if(typeof vars.referer != "undefined") this.vars.referer = encodeURIComponent(vars.referer);
		if(typeof vars.preview != "undefined") this.vars.is_preview = vars.preview;
		if(typeof vars.start_volume != "undefined" && vars.start_volume != "") this.vars.start_volume = vars.start_volume;
		if(typeof vars.close_button != "undefined" && vars.close_button != "") this.vars.close_button = vars.close_button;
		this.params.allowScriptAccess = "always";
		this.params.LOOP = "false";
		this.params.swLiveConnect = "true";
		this.params.bgcolor = (typeof vars.bg_color == "undefined") ? '#a0a0a0' : vars.bg_color;
	};
	this.parseInternalParams = function(internal_params) {
		this.checkParsedInternalParams(this.transformInputParameters(internal_params));
	},
	this.checkParsedInternalParams = function(internal_params) {
		if(typeof this.player_height == "undefined" || !this.player_height)
			this.player_height = (typeof internal_params.player_height == "undefined") ? this.def_player_height : internal_params.player_height;
		if(typeof this.player_width == "undefined" || !this.player_width)
			this.player_width = (typeof internal_params.player_width == "undefined") ? this.def_player_width : internal_params.player_width;
		
		var skin = (typeof internal_params.skin == "undefined") ? this.def_player_skin : internal_params.skin;
		if(typeof this.player_object_id == "undefined" || !this.player_object_id)
			this.player_object_id = (typeof internal_params.use_div == "undefined") ? '' : internal_params.use_div;
		
		this.player_url = this.site_root + 'player' + skin + '.swf';
		this.player_controls_height = (typeof internal_params.player_controls_height == "undefined") ? this.def_player_controls_height : internal_params.player_controls_height;
	};
	this.init = function(e, thisObject) {
		thisObject.use_existing_div = true;
		if(typeof thisObject.player_object_id == "undefined" || !thisObject.player_object_id) {
			thisObject.use_existing_div = false;
			thisObject.player_id = 'svp_' + (typeof thisObject.vars.clip_id == "undefined" ? Math.floor(Math.random() * 100000000001) : thisObject.vars.clip_id);
		}
		else if(thisObject.need_new_layer) {
			thisObject.player_id = thisObject.player_align != 'NONE' ? thisObject.player_object_id : 'svp_' + thisObject.player_object_id;
		}
		else {
			thisObject.player_id = 'svp_' + thisObject.player_object_id;
			var player_content = thisObject.createElement('div', thisObject.player_id, thisObject.player_id, 'width:' + thisObject.player_width + 'px' + ';' + 'height:' + thisObject.player_height + 'px' + ';');
			var object = thisObject.getObject(thisObject.player_object_id);
			player_content.innerHTML = object.innerHTML;
			object.innerHTML = '';
			object.appendChild(player_content);
		}
		if(typeof thisObject.vars.rid == "undefined") thisObject.vars.rid = new Date().getTime();
		
		thisObject.attributes = {
			id: thisObject.player_id,
			name: thisObject.player_id
		};
		//create player div layer
		if(!thisObject.only_fs && thisObject.need_new_layer) {
			if(thisObject.player_align != 'NONE') {
				var player_content = thisObject.getObject(thisObject.player_object_id);
			}
			else {
				var player_content = thisObject.createElement('div', thisObject.player_id, thisObject.player_id);
			}
			if(thisObject.player_keep_state_on_scroll) {
				thisObject.static_div = thisObject.createElement('div', 'static_' + thisObject.player_id, 'static_' + thisObject.player_id, 'width:' + thisObject.player_width + 'px' + ';' + 'height:' + thisObject.player_height + 'px' + ';');
				thisObject.static_div.style.position = 'fixed';
				thisObject.static_div.style.zIndex = ++SvpPlayerInstances.counter + 10000;;
				
				thisObject.static_div.appendChild(player_content);
				thisObject._d.body.insertBefore(thisObject.static_div, thisObject._d.body.childNodes[0]);
			}
			else {
				thisObject._d.body.appendChild(player_content);
			}
		}
		if(thisObject.use_existing_div && thisObject.need_new_layer && thisObject.player_align == 'NONE') {
			var params = thisObject.getElementPosition(thisObject.getObject(thisObject.player_object_id));
			thisObject.player_offset_left = params[0];
			thisObject.player_offset_top = params[1];
		}
		
		if(thisObject.player_keep_state_on_resize && thisObject.need_new_layer) {
			thisObject.addListener(thisObject._w, 'resize', function(e) {
				thisObject.resize(e, thisObject);
			});
		}
		SvpPlayerInstances.registerInstance(thisObject.vars.rid, thisObject);
		if(!thisObject.only_fs) thisObject.embedPlayer();
	};
	this.addListener = function(elem, evt, func) {
		if(elem.addEventListener) { //W3C DOM
			elem.addEventListener(evt, func, false);
			return true;
		}
		else if(elem.attachEvent) { //IE DOM
			var r = elem.attachEvent("on" + evt, func);
			return r;
		}
		return false;
	};
	this.createCSS = function(css) {
		this.style = this._d.createElement('style');
		this.style.setAttribute("type", "text/css");
		this.style.setAttribute("media", "screen");
		this.style.setAttribute("id", 'svp_style_sheet_' + this.player_id);
		var valid = true;
		if(this.style.styleSheet) { //IE
			try {
				this.style.styleSheet.cssText = css;
			}
			catch(e) {
				valid = false;
			}
		} 
		else { //the world
			var styleText = this._d.createTextNode(css);
			try {
				this.style.appendChild(styleText);
			}
			catch(e) {
				valid = false;
			}
		}
		if(valid) {
			this.head = this._d.getElementsByTagName('head')[0];
			this.head.appendChild(this.style);
		}
	};
	this.removeCSS = function() {
		if(this.head != null) {
			this.head.removeChild(this.style);
		}
	}
	this.openFullscreen = function() {
		//cache current values
		this.player_in_fs_mode = true;
		this.cached_width = this.player_width;
		this.cached_height = this.player_height;
		this.cached_align = this.player_align;
		this.cached_offset_left = this.player_offset_left;
		this.cached_offset_top = this.player_offset_top;
		this.cached_overflow = this._d.body.style.overflow;
		
		var windowScrolling = this.getWindowScrollXY();
		this.cached_scroll_x = windowScrolling[0];
		this.cached_scroll_y = windowScrolling[1];
		this._d.body.style.overflow = "hidden";
		
		if((this.player_fullscreen_mode == 'FIXED' || this.player_fullscreen_mode == 'FILL') && (this.browser == 'Explorer' || this.browser == 'Opera')) {
			this.createCSS("html {overflow:hidden;}");
		}
		
		if(this.player_background_color != '' && this.player_fullscreen_mode != 'FILL') {
			this.background_id = 'player_background_' + this.player_id;
			
			var windowSizes = this.getWindowSize();
			var documentSizes = this.getDocumentSize();
			windowWidth = Math.max(documentSizes[0], windowSizes[0]);
			windowHeight = Math.max(documentSizes[1], windowSizes[1]);
			var transparency = this.player_background_transparency;
			if(transparency > 100) transparency = 100;
			if(transparency < 0) transparency = 0;
			transparency = 100 - transparency;
			if(this.browser == 'Explorer') transparency_string = "filter:alpha(opacity=" + transparency + ");opacity:"+transparency / 100;
			else transparency_string = "opacity:" + transparency / 100;
			var z = ++SvpPlayerInstances.counter + 10000;
			this.background_content = this.createElement('div', this.background_id, this.background_id, "margin:0;width:" + windowWidth + "px;height:" + windowHeight + "px;top:0;left:0;z-index:" + z + ";overflow:hidden;position:absolute;background-color:" + this.player_background_color + ";" + transparency_string + ";");
			this._d.body.appendChild(this.background_content);
		}
		
		if(this.player_fullscreen_mode == 'DOUBLE') {
			this.player_width *= 2;
			this.player_height *= 2;
			this.player_align = 'MC';
			this.player_offset_left = undefined;
			this.player_offset_top = undefined;
		}
		else if(this.player_fullscreen_mode == 'FIXED') {
			this.player_width = this.player_fs_width;
			this.player_height = this.player_fs_height;
			this.player_align = 'MC';
			this.player_offset_left = undefined;
			this.player_offset_top = undefined;
		}
		else if(this.player_fullscreen_mode == 'FILL') {
			this.player_align = 'NONE';
			this.player_offset_left = undefined;
			this.player_offset_top = undefined;
			
			var windowSizes = this.getWindowSize();
			windowWidth = windowSizes[0];
			windowHeight = windowSizes[1];
			this.player_width = windowWidth;
			this.player_height = windowHeight;
			this._w.scrollTo(0, 0);
		}
		this.positionPlayer();
	};
	this.closeFullscreen = function() {
		this.player_in_fs_mode = false;
		if(this.player_background_color != '' && this.player_fullscreen_mode != 'FILL') {
			this._d.body.removeChild(this.background_content);
		}
		if((this.player_fullscreen_mode == 'FILL' || this.player_fullscreen_mode == 'FIXED') && (this.browser == 'Explorer' || this.browser == 'Opera')) this.removeCSS();
		if(this.player_fullscreen_mode == 'FILL') this._w.scrollTo(this.cached_scroll_x, this.cached_scroll_y);
		
		this._d.body.style.overflow = this.cached_overflow;
		this.player_width = this.cached_width;
		this.player_height = this.cached_height;
		this.player_align = this.cached_align;
		this.player_offset_left = this.cached_offset_left;
		this.player_offset_top = this.cached_offset_top;
		
		this.positionPlayer();
	};
	this.execute = function() {
		this.need_new_layer = this.player_align != 'NONE' || (this.player_fullscreen_mode != 'NONE' && this.player_fullscreen_mode != 'NATIVE');
		if(!this.need_new_layer) {
			this.init(null, this);
		}
		else {
			var thisObject = this;
			this.addListener(thisObject._w, 'load', function(e) {
				thisObject.init(e, thisObject);
			});
		}
	};
	this.resize = function(e, thisObject) {
		if(thisObject.player_instance != null) {
			if(thisObject.player_in_fs_mode == true) {
				if(thisObject.player_fullscreen_mode == 'FILL') {
					var windowSizes = thisObject.getWindowSize();
					windowWidth = windowSizes[0];
					windowHeight = windowSizes[1];
					thisObject.player_width = windowWidth;
					thisObject.player_height = windowHeight;
				}
				else if(thisObject.player_fullscreen_mode == 'FIXED') {
					var windowSizes = thisObject.getWindowSize();
					windowWidth = windowSizes[0];
					windowHeight = windowSizes[1];
					if(thisObject.player_fs_width > windowWidth) thisObject.player_width = windowWidth;
					else thisObject.player_width = thisObject.player_fs_width;
					if(thisObject.player_fs_height > windowHeight) thisObject.player_height = windowHeight;
					else thisObject.player_height = thisObject.player_fs_height;
				}
				thisObject.positionPlayer();
			}
			else {
				if(thisObject.player_align == 'NONE') {
					var pos = thisObject.getElementPosition(thisObject.getObject(thisObject.player_object_id));
					thisObject.player_offset_left = pos[0];
					thisObject.player_offset_top = pos[1];
				}
				thisObject.positionPlayer();
			}
		}
	};
	this.positionPlayer = function() {
		var offsetLeft = offsetTop = 0;
		
		if(typeof this.player_offset_left != "undefined" && typeof this.player_offset_top != "undefined") {
			offsetLeft = this.player_offset_left;
			offsetTop = this.player_offset_top;
		}
		else if(this.player_align != 'NONE') {
			var windowSizes = this.getWindowSize();
			var documentSizes = this.getDocumentSize();
			var windowWidth = Math.min(documentSizes[0], windowSizes[0]);
			var windowHeight = Math.min(documentSizes[1], windowSizes[1]);
			
			if(this.player_align == 'TL' || this.player_align == 'ML' || this.player_align == 'BL') {
				offsetLeft = 0 + Math.floor(this.player_offset_x);
			}
			else if(this.player_align == 'TC' || this.player_align == 'MC' || this.player_align == 'BC') {
				offsetLeft = Math.floor(( Math.floor(windowWidth) - Math.floor(this.player_width)) / 2) + Math.floor(this.player_offset_x);
			}
			else {
				offsetLeft =  Math.floor(windowWidth) - Math.floor(this.player_width) - Math.floor(this.player_offset_x);
			}
			
			if(this.player_align == 'TL' || this.player_align == 'TC' || this.player_align == 'TR') {
				offsetTop = 0 +  Math.floor(this.player_offset_y);
			}
			else if(this.player_align == 'ML' || this.player_align == 'MC' || this.player_align == 'MR') {
				offsetTop = (Math.floor(windowHeight) -  Math.floor(this.player_height)) / 2 + Math.floor(this.player_offset_y);
			}
			else {
				offsetTop =  Math.floor(windowHeight) - Math.floor(this.player_height) - Math.floor(this.player_offset_y);
			}
			
			if(this.player_fullscreen_mode == 'FIXED' && this.player_align != 'NONE') {
				var windowScrolling = this.getWindowScrollXY();
				offsetLeft += windowScrolling[0];
				offsetTop += windowScrolling[1];
			}
		}
		
		if(this.player_keep_state_on_scroll) {
			if(this.browser == 'Explorer' && this.version <= 6) {
				var style = " {position:absolute;top:expression(0+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px');left: expression(0+((e=document.documentElement.scrollLeft)?e:document.body.scrollLeft)+'px');}";
				this.createCSS("#" + this.player_instance.id + style);
				this.createCSS("#" + this.static_div.id + style);

				this.static_div.style.top = offsetTop + 'px';
				this.static_div.style.left = offsetLeft + 'px';
				this.static_div.style.position = 'absolute';
			}
			else {
				this.static_div.style.top = offsetTop + 'px';
				this.static_div.style.left = offsetLeft + 'px';
			}
		}
		else {
			this.player_instance.style.position = 'absolute';
			this.player_instance.style.zIndex = ++SvpPlayerInstances.counter + 10000;
			this.player_instance.style.left = offsetLeft + 'px';
			this.player_instance.style.top = offsetTop + 'px';
			
			this.player_instance.style.width = this.player_width + 'px';
			this.player_instance.style.height = this.player_height + 'px';
		}
	};
	this.embedPlayer = function() {
		var thisObject = this;
		var runSuccessEmbed = function(e) {
			thisObject.successEmbed(e, thisObject);
		}
		
		if(this.only_fs) {
			var player_content = this.createElement('div', this.player_id, this.player_id, 'width:' + this.player_width + 'px' + ';' + 'height:' + this.player_height + 'px' + ';');
			player_content.innerHTML = this.player_content_html;
			this._d.body.appendChild(player_content);
		}
		swfobject.embedSWF(this.player_url, this.player_id, this.player_width, this.player_height, this.flash_version, this.express_install, this.vars, this.params, this.attributes, runSuccessEmbed);
	};
	this.successEmbed = function(e, thisObject) {
		if(e.success == true && e.ref != null) {
			thisObject.player_instance = e.ref;

			if(thisObject.use_existing_div && thisObject.need_new_layer && thisObject.player_align == 'NONE') {
				thisObject.getObject(thisObject.player_object_id).innerHTML = '';
			}
			
			if(thisObject.browser != 'Explorer' && thisObject.browser != 'Opera' && thisObject.need_new_layer && !thisObject.player_keep_state_on_scroll) {
				thisObject._d.documentElement.appendChild(thisObject.player_instance);
			}
			if(thisObject.only_fs) {
				thisObject.openFullscreen();
			}
			else if(thisObject.need_new_layer) {
				thisObject.positionPlayer();
			}
		}
	};
	this.destroy = function() {
		swfobject.removeSWF(this.player_id);
		if(this.static_div) this._d.body.removeChild(this.static_div);
	}
	if(typeof vars != "undefined") this.checkParsedVars(this.vars);
	if(typeof internal_params != "undefined") this.checkParsedInternalParams(this.internal_params);
}

function OpenFullScreen(id) {
	var instance = SvpPlayerInstances.getInstance(id);
	if(instance) {
		if(instance.only_fs) {
			instance.embedPlayer();
		}
		else {
			instance.openFullscreen();
		}
	}
	else {
		SvpPlayerInstances.registerInstance(id, svp_player);
		svp_player.vars.rid = id;
		svp_player.embedPlayer();
	}
}

function ClosePlayer(id) {
	var instance = SvpPlayerInstances.getInstance(id);
	if(instance.only_fs) {
		instance.closeFullscreen();
		instance.destroy();
	}
	else if((typeof instance.vars.close_button != "undefined" && instance.vars.close_button == 1)) {
		instance.destroy();
	}
	else instance.closeFullscreen();
}