var AboutPage = {
	formSuccess: function(){
		$('feedback_form').hide();
		$('form_success').show();
	},
	
	formShow: function(){
		$('form_success').hide();
		$('feedback_form').show();
	},
	
	hidePoster: function(){
		$('panel_cocktail').style.marginBottom = "0";
		$('poster').style.display = "none";
	},
	
	showPoster: function(){
		$('panel_cocktail').style.marginBottom = "142px";
		$('poster').style.display = "block";		
	},
	
	init: function ()
	{
		var main = $('menu')
		var tabs = cssQuery('.content')
		var buttons = cssQuery('#menu a')
		
		LocationHash.bind(location)
		var name = LocationHash.get()
		
		// var hrefs = ['view-about', 'view-cocktail-friend', 'view-stat']
		var hrefs = tabs.map(function (v) { return String(v.className).split(/\s+/)[0] })
		log(hrefs)
		
		var sw = Switcher.bind(main, buttons, tabs)
		var selected = hrefs.indexOf(name)
		sw.select(selected >= 0 ? selected : 0)
		// sw.onselect = function (num) { location.hash = hrefs[num] }
		
		LocationHash.onchange = function (now, last) { sw.select(hrefs.indexOf(now)); log(now) }
		
		var line = new SWFObject("stat/amcharts/amline.swf", "amline", "510", "390", "8", "#FFFFFF");
		line.addVariable("path", "stat/amcharts/");
		line.addParam("wmode", "opaque");
		line.addVariable("settings_file", escape("stat/visitors/settings.xml"));
		line.addVariable("data_file", escape("stat/visitors/data.xml"));
		line.write("stat_visits");

		var pie = new SWFObject("stat/amcharts/ampie.swf", "ampie", "510", "400", "8", "#FFFFFF");
		pie.addVariable("path", "stat/amcharts/");
		pie.addParam("wmode", "opaque");
		pie.addVariable("settings_file", escape("stat/cities/settings.xml"));
		pie.addVariable("data_file", escape("stat/cities/data.xml"));		
		pie.addVariable("preloader_color", "#999999");
		pie.write("stat_cities");
	}
};

$.onready(function(){
	AboutPage.init();
	new Programica.RollingImagesLite($('rolling_stats'), {animationType: 'directJump'});
})

if (!self.Programica)
	self.Programica = {}

Programica.Request = function (prms)
{
	for (var p in prms)
		if (this[p] === undefined)
			this[p] = prms[p]
	
	// this.transport saves real request object
	
	if (self.XMLHttpRequest) // Gecko, WebKit, Presto...
	{
		try
		{
			this.transport = new XMLHttpRequest()
			if (this.transport.overrideMimeType)
				this.transport.overrideMimeType('application/xml')
		}
		catch (ex) {}
	}
	else if (self.ActiveXObject) // Trident
	{
		// microsux
		try { this.transport = new ActiveXObject("Msxml2.XMLHTTP") }
		catch (ex)
		{
			try { this.transport = new ActiveXObject("Microsoft.XMLHTTP") }
			catch (ex2) 
			{ 
				log("Can`t create neither Msxml2.XMLHTTP nor Microsoft.XMLHTTP: " + ex.messageText  + ", " + ex2.messageText ) 
			}
		}
	}
	
	if (this.transport)
	{
		var t = this
		this.transport.onreadystatechange = function ()
		{
			t.onreadystatechange()
		}
	}
	else
		log('Can`t create an instatce of the XMLHttpRequest')
}

Programica.Request.paramDelimiter = "&"

Programica.Request.urlEncode = function (data)
{
	if (!data) return ''
	
	// let object deside how to convert itself
	if (data.toUrlEncode)
		return data.toUrlEncode()
	
	switch (data.constructor)
	{
		case Array:
			return data.join(Programica.Request.paramDelimiter)
		
		case Object:
			var arr = []
			for (var i in data)
				if (i != undefined && data[i] != undefined)
					switch (data[i].constructor)
					{
						case Array:
							for (var j = 0, jl = data[i].length; j < jl; j++)
								arr.push(encodeURIComponent(i) + "=" + encodeURIComponent(data[i][j]))
							break
						default:
							arr.push(encodeURIComponent(i) + "=" + encodeURIComponent(data[i]))
							break
					}
			
			return arr.join(Programica.Request.paramDelimiter)
		
		default:
			return encodeURIComponent(data)
	}
}

Programica.Request.prototype =
{
	onLoad: function ()	{},
	
	// default error handler
	onError: function ()
	{
		log(this.errorMessage())
		return true
	},
	
	// this methods may return false to prevent calling onLoad()
	onInformation: function () {},
	onSuccess: function () {},
	onRedirect: function () {},
	
	// and this for onError()
	onClientError: function () {},
	onServerError: function () {},
	
	errorMessage: function () { return "Error while request " + this.lastRequest().uri + ": " + this.status() + " " + this.statusText() },
	
	//——————————————————————————————————————————————————————————————————————————
	// XMLHttpRequest methods wrappers
	
	open: function (method, uri, async, user, password)
	{
		this.lastRequestObject = {method:method,uri:uri,async:async,user:user,password:password}
		return this.transport.open(method, uri, async, user, password)
	},
	
	// transport.send() is wrapped in timer couse of #97
	send: function (data)
	{
		var t = this
		if (this.lastRequestObject.async)
			setTimeout(function () { t.transport.send(data) }, 0)
		else
			t.transport.send(data)
	},
	
	lastRequest: function () { return this.lastRequestObject },
	setRequestHeader: function (header, value) { return this.transport.setRequestHeader(header, value) },
	abort: function () { return this.transport.abort() },
	getAllResponseHeaders: function () { return this.transport.getAllResponseHeaders() },
	getResponseHeader: function (header) { return this.transport.getResponseHeader(header) },
	status: function () { return this.transport.status || 0 }, // 0 for direct file loading from filesystem
	statusText: function () { return this.transport.statusText },
	
	
	//——————————————————————————————————————————————————————————————————————————
	// XMLHttpRequest properties wrappers
	
	readyState: function () { return this.transport.readyState },
	responseText: function () { return this.transport.responseText },
	responseXML: function ()
	{
		var result = this.transport.responseXML
		
		// MSIE
		if(!result.documentElement && this.transport.responseStream)
			result.load(this.transport.responseStream)
		return result
	},
	
	onreadystatechange: function ()
	{
		if (this.readyState() == 4)
		{
			switch (Math.floor(this.status() / 100))
			{
				case 1:
					this.onInformation()
					break
				
				case 0:
				case 2:
					(this.onLoad() !== false) && this.onSuccess()
					break
				
				case 3:
					this.onRedirect()
					break
				
				case 4:
					(this.onError() !== false) && this.onClientError()
					break
				
				case 5:
					(this.onError() !== false) && this.onServerError()
					break
				
				default:
					log("Strange response status: " + this.status())
			}
		}
		
		return false
	}
}


//——————————————————————————————————————————————————————————————————————————————
// shortcuts

self.aPost = function (url, params)
{
	var r = new Programica.Request()
	if (!r) return null
	
	var data = Programica.Request.urlEncode(params)
	
	r.open('POST', url, true)
	r.setRequestHeader("Content-type", "application/x-www-form-urlencoded") // ; charset=utf-8
	r.setRequestHeader("Content-length", data.length)
	r.send(data)
	
	return r
}

self.sPost = function (url, params)
{
	var r = new Programica.Request()
	if (!r) return null
	
	var data = Programica.Request.urlEncode(params)
	
	r.open('POST', url, false)
	r.setRequestHeader("Content-type", "application/x-www-form-urlencoded") // ; charset=utf-8
	r.setRequestHeader("Content-length", data.length)
	r.send(data)
	
	return r
}



self.aGet = function (url, params)
{
	var r = new Programica.Request()
	if (!r) return null
	
	var data = Programica.Request.urlEncode(params)
	var delim = data ? url.indexOf('?') < 0 ? '?' : Programica.Request.paramDelimiter : ''
	
	r.open('GET', url + delim + data, true)
	r.send(null)
	
	return r
}

self.sGet = function (url, params, tail)
{
	var r = new Programica.Request()
	if (!r) return null
	
	var data = tail ? Programica.Request.urlEncode(params) + Programica.Request.paramDelimiter + Programica.Request.urlEncode(tail) : Programica.Request.urlEncode(params)
	var delim = data ? url.indexOf('?') < 0 ? '?' : Programica.Request.paramDelimiter : ''
	
	r.open('GET', url + (data ? delim + data : ''), false)
	r.send(null)
	
	return r
}


self.sPut = function (url, params, tail, data)
{
	var r = new Programica.Request()
	if (!r) return null
	if (!data) return null
	
	var params = tail ? Programica.Request.urlEncode(params) + Programica.Request.paramDelimiter + Programica.Request.urlEncode(tail) : Programica.Request.urlEncode(params)
	var delim = params ? url.indexOf('?') < 0 ? '?' : Programica.Request.paramDelimiter : ''
	
	r.open('POST', url + (params ? delim + params : ''), false)
	r.setRequestHeader("Content-type", "application/x-www-form-urlencoded") // ; charset=utf-8
	r.setRequestHeader("Content-length", data.length)
	r.send(data)
	
	return r
}


self.aHead = function (url, params)
{
	var r = new Programica.Request()
	if (!r) return null
	
	var data = Programica.Request.urlEncode(params)
	var delim = data ? url.indexOf('?') < 0 ? '?' : Programica.Request.paramDelimiter : ''
	
	r.open('HEAD', url + delim + data, true)
	r.send(null)
	
	return r
}

self.sHead = function (url, params)
{
	var r = new Programica.Request()
	if (!r) return false
	
	var data = Programica.Request.urlEncode(params)
	var delim = data ? url.indexOf('?') < 0 ? '?' : Programica.Request.paramDelimiter : ''
	
	r.open('HEAD', url + delim + data, false)
	r.send(null)
	
	return r
}

Programica.Request.transformFragment = function (xml, xsl, node, doc)
{
	doc = doc || document
	
	if (!node || !node.nodeName)
		node = doc.createElement(node)
	
	if (typeof xml.transformNode != 'undefined')
	{
		var markup = xml.transformNode(xsl)
		node.innerHTML = markup
	}
	else if (self.XSLTProcessor)
	{
		var processor = new XSLTProcessor()
		processor.importStylesheet(xsl)
		var fragment = processor.transformToFragment(xml, document)
		node.appendChild(fragment)
	}
	else
		throw new Error('Can`t find way to do XSL transformation')
	
	return node
}
// example: $('form').toHash()
HTMLFormElement.prototype.toHash = function (forse_array) { return Programica.Form.form2hash(this, forse_array) }
HTMLFormElement.prototype.fromHash = function (hash) { return Programica.Form.hash2form(hash, this) }

Programica.Form = {}

// Преобразование данных формы в хеш
Programica.Form =
{
	form2hash: function (f, forse_array)
	{
		var node, val, nn, hash = {}
		
		for (var i = 0; i < f.length; i++)
		{
			node = f.elements[i]
			nn = node.name
			
			// skip nodes with exect empty names
			if (nn === '')
				continue
			
			val = null
			switch (node.type)
			{
				case 'checkbox':
					val = node.checked ? node.value : null
					break
				
				case 'radio':
					val = node.checked ? node.value : null
					break
				
				case 'select-one':
					val = node.options[node.selectedIndex].value
					break
				
				case 'submit':
					break
				
				default:
					val = node.value
			}
			
			if (val != null)
			{
				if	(hash[nn] == null)
					hash[nn] = forse_array ? [val] : val
				else if (hash[nn].constructor == Array)
					hash[nn].push(val)
				else
					hash[nn] = [hash[nn], val]
			}
			else if (forse_array && !hash[nn])
				hash[nn] = []
		}
		
		return hash;
	},
	
	forceArrayFormHash: function (h)
	{
		var res = {}
		for (var k in h)
		{
			var v = h[k]
			if (typeof v === 'undefined')
				throw new Error('Can`t proceed undefined value for key "' + k + '"')
			else if (typeof v == 'string')
				res[k] = [String(v)]
			else if (v instanceof Array)
				res[k] = v.slice()
			else
				throw new Error('Can`t proceed key of constructor "' + v.constructor + '"')
		}
		return res
	},
	
	hash2form: function (h, f, forse_array)
	{
		if (!forse_array)
			h = this.forceArrayFormHash(h)
		
		for (var i = 0; i < f.length; i++)
		{
			var node = f.elements[i]
			var v
			
			if (v = h[node.name])
				switch (node.type)
				{
					case 'checkbox':
					case 'radio':
						if (v[0] == node.value)
							v.shift(), node.checked = 'checked'
						break
					
					case 'select-one':
						for (var j = 0; j < node.options.length; j++)
							if (v[0] == node.options[j].value)
							{
								node.selectedIndex = j
								v.shift()
								break
							}
						break
					
					case 'text':
					case 'textarea':
						node.value = v.shift()
						break
				}
		}
	}
}

// beta :)
var LocationHash =
{
	onchange: function () {  },
	bind: function (loc)
	{
		this.location = loc
		this.lastHash = this.location.hash
		
		var me = this
		function check ()
		{
			if (me.location.hash != me.lastHash)
			{
				me.lastHash = me.location.hash
				me.onchange(me.get(), me.last)
			}
		}
		
		setInterval(check, 500)
		document.addEventListener('click', function () { setTimeout(check, 50) }, true)
	},
	
	set: function (val)
	{
		this.location.hash = this.last = String(val)
		this.lastHash = this.location.hash
	},
	
	get: function ()
	{
		return this.location.hash.replace(/^#/, '')
	}
}



self.addEventListener('load', function () { Programica.Widget.onLoader() }, false)

Programica.Widget = function () {}
Object.extend (Programica.Widget,
{
	registered: [],
	
	register: function (wgt)
	{
		this.registered.push(wgt)
	},
	
	sortby:
	{
		pri: function (a,b) { return a.pri - b.pri }
	},
	
	// search for widget nodes, sort it and call bind for each
	onLoader: function ()
	{
		if (this.thinkLoaded) return
		this.thinkLoaded = true
		
		// search notes into stack
		var stack = [];
		for (var wi in this.registered)
		{
			var w = this.registered[wi]
			
			var nodes = []
			if (w.mainNodeClassName)
				nodes = document.getElementsByClassName(w.mainNodeClassName)
			if (w.mainNodeTagName)
				nodes = document.getElementsByTagName(w.mainNodeTagName)
			
			for (var ni = 0; ni < nodes.length; ni++)
				stack.push
				(
					{
						w:w,
						node:nodes[ni],
						pri: (nodes[ni].getAttribute('pmc-widget-priority') || 0)
					}
				)
		}
		
		
		// sorting
		this.sorted = stack.sort(this.sortby.pri)
		
		for (var ni = 0; ni < this.sorted.length; ni++)
		{
			var n = this.sorted[ni]
			n.w.bind(n.node)
		}
	},
	
	// play in threads
	initJob: function ()
	{
		// bind
		for (var ni = 0; ni < this.sorted.length; ni++)
		{
			var n = this.sorted[ni]
			if (n.bint || n.error) continue
			
			try
			{
				n.w.bind(n.node)
			}
			catch (ex)
			{
				n.bint = false
				n.error = true
				
				throw ex
			}
			
			n.bint = true
			return
		}
		clearInterval(this.initInterval)
	}
})


// widgets base class
Programica.Widget.prototype =
{
	klass: 'Programica.Widget',
	bind: function (node) { (new this.Handler(node)).init() },
	toString: function () { return '[object ' + this.klass + ']' }
}

{(function () {
var P = Programica
var FormPoster = P.FormPoster = function () {}
var prototype = FormPoster.prototype = new P.Widget()

prototype.mainNodeTagName = 'form'
prototype.klass = 'Programica.FormPoster'
prototype.Handler = function (node)
{
	this.mainNode = node
	
	// where form.action is a node
	if (node.action && typeof node.action != 'string')
		throw new Error('Form element with name "action" masks form own attribute.')
	
	if (node.enctype && typeof node.enctype != 'string')
		throw new Error('Form element with name "enctype" masks form own attribute.')
	
	// for files upload
	if (/^multipart\/form\-data$/i.test(node.getAttribute('enctype')))
	{
		// check if this form needs to be proceeded
		if (!/^ajax$/i.test(node.target))
			return
		
		var frameName = 'id-' + Math.longRandom()
		
		var iframe = $E('iframe', {name: frameName, id: frameName})
		iframe.style.display = 'none'
		document.body.appendChild(iframe)
		iframe.src = 'about:blank'
		node.target = frameName
		
		FormPoster.bakeEvents(node)
		
		function firstOnLoad ()
		{
			this.removeEventListener('load', firstOnLoad, false)
			var me = this
			setTimeout(function () { me.addEventListener('load', function () { node.onsuccess({request:iframe}) }, false) }, 10)
		}
		
		iframe.addEventListener('load', firstOnLoad, false)
	}
	else
	{
		function sendListener (e)
		{
			// check if this form needs to be proceeded
			if (!/^ajax$/i.test(this.target))
				return
			
			e.preventDefault()
			
			// play in events
			var ev = {hash: this.toHash(), form: this}
			FormPoster.bakeEvents(node)
			if (this.oncheck(ev) === false)
				return
			
			this.addClassName('sending')
			this.onsend(ev)
			// acync sending data
			var met = /^post$/i.test(this.method) ? aPost : aGet,
				me = this,
				request
			with (request = met(this.action, ev.hash))
			{
				ev.request = request
				onLoad		= function () { me.remClassName('sending'); me.onload(ev) }
				onSuccess	= function () { me.onsuccess(ev) }
				onError		= function () { me.onerror(ev) }
			}
		}
		
		node.addEventListener('submit', sendListener,  false)
	}
}


prototype.Handler.prototype = { init: function () {} }


FormPoster.defaultEvents = ['onload', 'onsuccess', 'onerror', 'oncheck', 'onsend']
FormPoster.bakeEvents = function (node, events)
{
	events = events || this.defaultEvents
	for (var i = 0; i < events.length; i++)
		if (!node[events[i]] || node[events[i]].constructor == String)
			node[events[i]] = eval("[function (event) { " + node.getAttribute(events[i]) + " }]")[0]
}


P.Widget.register(new FormPoster())
})()}

Programica.RollingImagesLite = function (node, conf)
{
	this.conf = {duration: 1, animationType: 'easeOutBack'}
	Object.extend(this.conf, conf)
	this.current = null
	this.mainNode = node
	this.mainNode.RollingImagesLite = this
	
	
	var t = this
	function mouseup (e)
	{
		e.preventDefault()
		clearInterval(t.svInt)
		document.removeEventListener('mouseup', mouseup, false)
	}
	
	this.prevmousedown = function (e)
	{
		e.preventDefault()
		clearInterval(t.svInt)
		t.goPrev()
		t.svInt = setInterval(function () { t.goPrev() }, t.conf.duration * 1000 * 0.5 + 150)
		document.addEventListener('mouseup', mouseup, false)
	}
	
	this.nextmousedown = function (e)
	{
		e.preventDefault()
		clearInterval(t.svInt)
		t.goNext()
		t.svInt = setInterval(function () { t.goNext() }, t.conf.duration * 1000 * 0.5 + 150)
		document.addEventListener('mouseup', mouseup, false)
	}
	
	this.sync()
	if (this.conf.goInit !== false)
		this.goInit()
}

Programica.RollingImagesLite.prototype =
{
	sync: function ()
	{
		this.viewport = this.my('viewport')[0]
		if (!this.viewport)
			throw new Error('Can`t find viewport for ' + this.mainNode)
		if (!this.viewport.animate)
			throw new Error('Viewport can`t be animated!')
		
		this.points = this.my('point')
		this.buttons = this.my('button')
		this.aPrev = this.my('prev')[0]
		this.aNext = this.my('next')[0]
		
		// if syncing when pushed
		clearInterval(this.svInt)
		
		var t = this
		if (this.aPrev)
			this.aPrev.addEventListener('mousedown', this.prevmousedown, false)
		
		if (this.aNext)
			this.aNext.addEventListener('mousedown', this.nextmousedown, false)
		
		for (var i = 0, il = this.buttons.length; i < il; i++)
			this.buttons[i].onmousedown = function (fi) { return function () { t.goToFrame(fi) } } (i)
		
		this.updateNavigation()
	},
	
	goPrev: function () { if (this.current > 0) this.goToFrame(this.current - 1) },
	goNext: function () { if (this.current < this.points.length - 1) this.goToFrame(this.current + 1) },
	my: function (cn) { return this.mainNode.getElementsByClassName(cn) },
	
	goInit: function ()
	{
		return this.goToFrame(0, 'directJump')
	},
	
	goToFrame: function (n, anim, dur) { return this.points ? this.goToNode(this.points[n || 0], anim, dur) : null },
	
	goToNode: function (node, anim, dur)
	{
		if (!node)
			return null
		
		if (this.mainNode.onjump)
			if (this.mainNode.onjump(node) === false)
				return null
		
		// change number of current node
		for (var i = 0, il = this.points.length; i < il; i++)
			if (this.points[i] == node)
				this.setCurrent(i)
		
		return this.animateTo(node.offsetLeft, node.offsetTop, anim, dur)
	},
	
	animateTo: function (left, top, anim, dur) { return this.viewport.animate(anim || this.conf.animationType, {scrollLeft: left, scrollTop: top}, dur || this.conf.duration) },
	
	jumpTo: function (left, top) { this.viewport.scrollLeft = left; this.viewport.scrollTop = top },
	jumpToFrame: function (n)
	{
		var node = this.points[n]
		if (node)
		{
			this.setCurrent(n)
			this.jumpTo(node.offsetLeft, node.offsetTop)
		}
	},
	
	updateNavigation: function ()
	{
		for (var i = 0, il = this.buttons.length; i < il; i++)
			this.buttons[i].remClassName('selected-button')
		
		var button = this.buttons[this.current]
		if (button)
			button.addClassName('selected-button')
		
		if (this.aPrev)
			this.current > 0 ? this.aPrev.enable() : this.aPrev.disable()
		
		if (this.aNext)
			this.current < this.points.length - 1 ? this.aNext.enable() : this.aNext.disable()
	},
	
	setCurrent: function (num)
	{
    // if (num == this.current)
		//	return
		
		this.current = num
		this.updateNavigation()
		
		var cp = this.points[this.current]
		if (this.onselect)
			this.onselect(cp, this.current)
		
		if (cp && cp.onselect)
			cp.onselect()
	}
}

Switcher =
{
	bind: function (main, buttons, tabs, names)
	{
		if (!main || !buttons || !tabs)
			throw new Error('main, buttons or tabs are not defined: ' + [!!main, !!buttons, !!tabs].join(', '))
		main.nodes = {buttons: Array.copy(buttons), tabs: Array.copy(tabs)}
		main.names = names || []
		
		main.onselect = function () {}
		main.setTabs = function (tabs) { this.nodes.tabs = tabs }
		main.setNames = function (names) { this.names = names }
		main.select = function (num)
		{
			if (typeof num != 'number')
				num = this.names.indexOf(num)
			
			if (num < 0 || this.onselect(num) === false)
				return
			
			this.drawSelected(num)
		}
		main.drawSelected = function (num)
		{
			if (typeof num != 'number')
				num = this.names.indexOf(num)
			
			if (num < 0)
				return
			
			var buttons = this.nodes.buttons
			for (var i = 0; i < buttons.length; i++)
				if (buttons[i])
					num == i ? buttons[i].addClassName('selected') : buttons[i].remClassName('selected')
			
			var tabs = this.nodes.tabs
			if (tabs && tabs[num])
				for (var i = 0; i < tabs.length; i++)
					if (tabs[i])
						num == i ? tabs[i].show() : tabs[i].hide()
		}
		
		function isParent (node, parent, root)
		{
			do
			{
				// log(node)
				if (node == parent)
					return true
				if (node == root)
					return false
			}
			while (node = node.parentNode)
			
			return false
		}
		
		function mouseSelect (e)
		{
			var buttons = this.nodes.buttons
			var num = -1
			for (var i = 0; i < buttons.length; i++)
				if (isParent(e.target, buttons[i], this))
					num = i
			
			return this.select(num)
		}
		main.addEventListener('mousedown', mouseSelect, false)
		
		return main
	}
}


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


