/**
 * Funkce v JavaScriptu
 * By  Blondak
 * (c) Blondak
 * Posledni uprava: 30.07.2003
 *Upravena fce OpenWindow aby centrovala lepe
 */

/* Zmeni  text daneho elementu. Element se urcu je podle id.
* @param elementId Id elementu
* @param elementText Novy text elementu
*/

function changeElementText(elementId, elementText) {
	element = document.getElementById(elementId);
	if (typeof(element) != 'undefined') element.innerHTML = elementText;
}

/* Zmeni  hodnotu daneho elementu. Element se urcu je podle id.
* @param elementId Id elementu
* @param newValue Novy hodnota
*/

function changeElementValue(elementId, newValue) {
	var element = document.getElementById(elementId);
	if (typeof(element) != 'undefined') {
		element.value = newValue;
		return element;
	}
}

/* Nastavi element readOnly podle druheho parametru readOnly. Pozor lze pouze u text, textarea a password elementu
* @param aElementId Id elementu
* @param isReadOnly Novy hodnota
*/

function setReadOnly(aElementId, isReadOnly, aColor) {
	var element = window.document.getElementById(aElementId);
	if (typeof(element) != 'undefined') {
		element.readOnly = isReadOnly;
		if (aColor == undefined) if (isReadOnly) aColor = 'silver';
		else aColor = 'white';
	}
	element.style.backgroundColor = aColor;
}

//vymaze policko formulare

function clearField(fieldName) {
	var fld = document.getElementById(fieldName);
	if (typeof(fld) != 'undefined') fld.value = '';
}

//udela refresh (reload) rodicovskeho okna

function reloadOwner(strLocation) {
	if (typeof(window.opener) == 'object') {
		if (strLocation == undefined) strLocation = window.opener.location;
		window.opener.location = strLocation;
	}
}

//odstraneni nadframu

function removeFrames() {
	if (typeof(self.parent.frames) != 'undefined') if (self.parent.frames.length != 0) self.parent.location = document.location;
}

//fce na obnoveni leveho framu (menu)

function reloadMenu() {
	parent.frames[0].location = parent.frames[0].location;
}

//otevreni okna

function OpenWin(wndName, wndPage, wndWidth, wndHeight, wndLeft, wndTop, isParent, showScrollBars) {
	wnd = window.open(wndPage, wndName, 'scrollbars=no,dependent=' + isParent + ',width=' + wndWidth + ',height=' + wndHeight + ',top=300,left=200,resizable=yes')
	wnd.focus();
}

//otevreni okna, pokud neni zadano wndLeft resp. wndTop, nezadana hodnota se centruje podle obrazovky

function OpenWindow(wndName, wndPage, wndWidth, wndHeight, wndLeft, wndTop, showScrollBars, isParent, isFullScreen) {
	var scWidth = screen.width;
	var scHeight = screen.height;
	if (wndName == undefined) wndName = 'Noname';
	if (wndPage == undefined) {
		alert('Nelze zobrazit nedefinovanou strĂˇnku!');
		return false;
	}
	if (wndWidth == undefined) wndWidth = '300';
	if (wndHeight == undefined) wndHeight = '300';
	if (isParent == undefined) isParent = 'yes';
	if (isFullScreen == undefined) isFullScreen = 'no';
	if (showScrollBars == undefined) showScrollBars = 'no';

	if ((wndLeft == undefined) || (wndLeft == '')) {
		wndLeft = (scWidth - wndWidth) / 2;
	}

	if ((wndTop == undefined) || (wndTop == '')) {
		wndTop = (scHeight - wndHeight) / 2;
	}

	wnd = window.open(wndPage, wndName, 'scrollbars=' + showScrollBars + ',resizable=yes,dependent=' + isParent + ',width=' + wndWidth + ',height=' + wndHeight + ',top=' + wndTop + ',left=' + wndLeft + ',fullscreen=' + isFullScreen);
	wnd.focus();
}

//zobrazi chybovou stranku

function showError(msg) {
	var strana = 'errorDlg.php?msg=' + msg;
	OpenWindow('Chyba', strana, 220, 200);
}

//potvrzeni nejeke otzaky/ nebo odmitnuti akce

function confirmDialog(aText) {
	return confirm(aText);
}


//Potvrzeni smazani

function confirmDel() {
	return confirmDialog('Opravdu smazat?');
}

//***************** ZACATEK FCI k DropDownu (<SELECT>)  ******************

//pridani Option do selectu

function appendOption(aSelect, val, txt) {

	addOption(aSelect, val, txt, aSelect.length);

}

//vyhledani polozky v SELECTU vraci hodnotu indexu pri nalezeni
//pri nenalezeni vraci -1

function findByValue(aSelect, aValue) {
	for (i = 0; i < aSelect.length; i++) {
		if (aSelect.options[i].value == aValue) return i;
	}
	return -1;
}

//vybere jednu polozku a ostatni odvybere

function selectOneByValue(sel, aValue) {
	for (i = 0; i < sel.length; i++) {
		if (sel.options[i].value != aValue) {
			sel.options[i].selected = false;
		} else {
			sel.options[i].selected = true;
		}
	}
}

//pridani Option do selectu

function addOption(aSelect, aKey, aText, aIndex) {
	var tempIndex = 0;
	var tempKey = '';
	var tempText = '';
	var oldLen = aSelect.length;

	tempIndex = aIndex;

	for (tempIndex; tempIndex < oldLen; tempIndex++) {
		tempKey = aSelect.options[tempIndex].value;
		tempText = aSelect.options[tempIndex].text;

		aSelect.options[tempIndex].value = aKey;
		aSelect.options[tempIndex].text = aText;
		aKey = tempKey;
		aText = tempText;

	}

	var opt = new Option(aText, aKey);
	aSelect.options[oldLen] = opt;
}

//vrati hodnotu vybraneho selectu, jinak vrati false

function getValue(sel) {
	var Index = sel.selectedIndex;
	if (Index != -1) {
		return sel.options[Index].value;
	} else {
		return false;
	}
}

//vraci text vybraneho prvku v selectu, jinak vraci false

function getSelectedItemText(sel) {
	var Index = sel.selectedIndex;
	if (Index != -1) {
		return sel.options[Index].text;
	} else {
		return false;
	}
}

//funkce na vymaz polozky v SELECTu 1 polozka

function delOption(sel) {
	var Index = sel.selectedIndex;
	if (Index != -1) {
		sel.options[Index] = null;
		if (Index == 0) {
			if (sel.length > 0) {
				sel.options[Index].selected = true;
			}
		} else {
			sel.options[Index - 1].selected = true;
		}
	} else {
		alert('PoloĹľka nenĂ­ vybrĂˇna!');
	}
}



//funkce na vybrani vsech v <SELECT>

function moveUpInList(sel) {
	var tempKey = '';
	var tempText = '';
	var index = 0;
	if ((sel.selectedIndex != null) && (sel.selectedIndex > 0) && (sel.selectedIndex != -1)) {
		index = sel.selectedIndex;
		tempKey = sel.options[index].value;
		tempText = sel.options[index].text;
		delOption(sel);
		addOption(sel, tempKey, tempText, index - 1);
		selectOnlyOne(sel, index - 1);
	}
}

//funkce na vybrani vsech v <SELECT>

function moveDownInList(sel) {
	var tempKey = '';
	var tempText = '';
	var index = 0;
	if ((sel.selectedIndex != null) && (sel.selectedIndex < sel.length - 1) && (sel.selectedIndex != -1)) {
		index = sel.selectedIndex;
		tempKey = sel.options[index].value;
		tempText = sel.options[index].text;
		delOption(sel);
		addOption(sel, tempKey, tempText, index + 1);
		selectOnlyOne(sel, index + 1);
	}

}

//vybere jednu polozku a ostatni odvybere

function selectOnlyOne(sel, aIndex) {
	for (i = 0; i < sel.length; i++) {
		if (i != aIndex) {
			sel.options[i].selected = false;
		} else {
			sel.options[i].selected = true;
		}
	}
}

//funkce na vybrani vsech v <SELECT>

function selectAllInList(sel) {
	var i = 0;
	while (i < sel.length) {
		sel.options[i].selected = true;
		i++;
	}
}

//funkce na vyprazdneni SELECTu

function clearlist(sel) {
	do {
		sel.options[0] = null;
	}
	while (sel.length > 0);
}

//funkce na vyprazdneni, naplneni selectu

function populate(ParentSelect, ChildSelect, FromArray) {
	var x = 0;
	clearlist(ChildSelect);

	for (i = 0; i < FromArray.length; i++) {
		if (FromArray[i][0] == ParentSelect.options[ParentSelect.selectedIndex].value) {
			eval('var option' + x + ' = new Option(FromArray[i][2],FromArray[i][1])');
			x = x + 1;
		}
	}
	for (var i = 0; i < x; i++)
	eval('ChildSelect.options[i]=option' + i);
}


//********************* KONEC Fci k <SELECT> ***************************************************


//funkce na naplneni 2x pole Nx3

function PullToArray(arr, a, b, c) {
	var tempArray = new Array(a, b, c);
	arr[arr.length] = tempArray;
}

// zjisteni zda pole neni prazdny

function isblank(s) {
	for (var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
	}
	return true;
}

//validace formulare *************

function verify(f) {
	var msg;
	var empty_fields = "";
	var errors = "";


	for (var i = 0; i < f.length; i++) {
		var e = f.elements[i];

		if ((e.type == "select-one") && (!e.optional) && (f.validateSelect == 1)) {
			if (e.selectedIndex < 1) {
				empty_fields += "\n          " + e.name;
			}
		}

		if (((e.type == "text") || (e.type == "textarea")) && !e.optional) {
			// first check if the field is empty
			if ((e.value == null) || (e.value == "") || isblank(e.value)) {
				empty_fields += "\n          " + e.name;
				continue;
			}

			// Now check for fields that are supposed to be numeric.
			if (e.numeric || (e.min != null) || (e.max != null)) {
				var v = parseFloat(e.value);
				if (isNaN(v) || ((e.min != null) && (v < e.min)) || ((e.max != null) && (v > e.max))) {
					errors += "- The field " + e.name + " must be a number";
					if (e.min != null) errors += " that is greater than " + e.min;
					if (e.max != null && e.min != null) errors += " and less than " + e.max;
					else if (e.max != null) errors += " that is less than " + e.max;
					errors += ".\n";

				}
			}

		}
	}



	if (!empty_fields && !errors) return true;

	if (f.jazyk == 'CZ') {
		msg = "______________________________________________________\n\n"
		msg += "FormulĂˇĹ™ nebyl odeslĂˇn dĂ­ky nĂˇsledujĂ­cĂ­m chybĂˇm.\n";
		msg += "ProsĂ­m opravte tyto chyby a odeĹˇlete formulĂˇĹ™ znovu.\n";
		msg += "______________________________________________________\n\n"
	} else {
		msg = "______________________________________________________\n\n"
		msg += "The form was not submitted because of the following error(s).\n";
		msg += "Please correct these error(s) and re-submit.\n";
		msg += "______________________________________________________\n\n"
	}

	if (empty_fields) {
		if (f.jazyk == 'CZ') {
			msg += "- NĂˇsledujĂ­cĂ­ povinnĂ© poloĹľky jsou prĂˇzdnĂ©:" + empty_fields + "\n";
		} else {
			msg += "- The following required field(s) are empty:" + empty_fields + "\n";
		}
		if (errors) msg += "\n";
	}
	msg += errors;
	alert(msg);
	return false;
}

//validace prihl formulare

function Validator(theForm) {

	if (theForm.logname.value == "") {
		alert("UĹľivatelskĂ© jmĂ©no je nutnĂ© zadat");
		theForm.logname.focus();
		return (false);
	}

	if (theForm.logname.value.length > 12) {
		alert("JmĂ©no nad 12 pĂ­smen");
		theForm.logname.focus();
		return (false);
	}

	if (theForm.pwd.value == "") {
		alert("Heslo je nutnĂ© zadat");
		theForm.pwd.focus();
		return (false);
	}

	if (theForm.pwd.value.length > 12) {
		alert("Heslo nad 12 pĂ­smen");
		theForm.pwd.focus();
		return (false);
	}
	return (true);
}


function changeIFrame(striFrameName, strPage, strIdVar, strIdValue, pageName) {
	var frameSrc = strPage + '?' + strIdVar + '=' + strIdValue + '&showMenu=false&pageName=' + pageName;
	parent.frames[striFrameName].document.location.replace(frameSrc); //myiFrame.window.location.replace(frameSrc);
}

function paintRow(theRow, bgColor, colNumber) {

	if (typeof(document.getElementsByTagName) != 'undefined') {
		theCells = theRow.getElementsByTagName('td');
	} else {
		if (typeof(theRow.cells) != 'undefined') theCells = theRow.cells;
		else
		return false;
	}
	//	alert(colNumber);
	for (c = 0; c < theCells.length; c++) {
		if ((colNumber == 'undefined') || (colNumber != c)) theCells[c].style.backgroundColor = bgColor;
		//else alert("ok");
	}
	return true;
}

var selectedRow = null;

function rowAction(rowHandle, rowId) {
	// var myiFram = window.parent.document.getElementById('vypis');
	// myiFram.src = 'najemci_vypis.php' + '?id_hrob='+rowId;


}
//fce obarvuje radky a muze pustit nejakou dalsi fci 

function getRow(rowHandle, rowId, action, actionColor, secColor, defColor, colNumber) {
	var theCells = null;

	if (typeof(rowHandle.style) == 'undefined') //pokud nejde urcit radek tak exit
	return false;

	if (action == 'click') {
		if ((selectedRow == null) || (selectedRow != rowHandle)) {
			paintRow(rowHandle, actionColor, colNumber);

			if (selectedRow != null) paintRow(selectedRow, defColor, colNumber);
			selectedRow = rowHandle;
		} else {
			paintRow(rowHandle, secColor, colNumber);
			if (selectedRow != null) selectedRow = null;
		}
	}
	if ((action != 'click') && ((selectedRow == null) || (selectedRow != rowHandle))) paintRow(rowHandle, actionColor, colNumber);

	if ((action == 'click') && (selectedRow == rowHandle)) rowAction(rowHandle, rowId);
	if ((action == 'click') && (selectedRow == null)) rowAction(rowHandle, 0);

}

//FCE - commaToDot; autor - Blondak; 18.12.2002
// Prevadi carky na tecky v nejakem prvku formulare 
//vstupni parametr je retezec k prevodu

function commaToDot(aString) {
	return aString.replace(/,/gi, ".");
}

//FCE - isEmailAlias
//vraci true pokud retezec muze byt email  
//jinak vraci false
//vstupni parametr je retezec, ktery by mel byt emailem

function isEmailAlias(email, required) {
	if (required == undefined) { // if not specified, assume it's required
		required = false;
	}
	if (email == null) {
		if (required) {
			return false;
		}
		return true;
	}
	if (email.length == 0) {
		if (required) {
			return false;
		}
		return true;
	}
	if (!allValidChars(email)) { // check to make sure all characters are valid
		return false;
	}
	if (email.indexOf("@") < 1) { //  must contain @, and it must not be the first character
		return false;
	} else if (email.lastIndexOf(".") <= email.indexOf("@")) { // last dot must be after the @
		return false;
	} else if (email.indexOf("@") == email.length) { // @ must not be the last character
		return false;
	} else if (email.indexOf("..") >= 0) { // two periods in a row is not valid
		return false;
	} else if (email.indexOf(".") == email.length) { // . must not be the last character
		return false;
	}
	return true;
}

// pomocna funkce, ktera overuje zda jsou v mailu pouze povolene znaky

function allValidChars(email) {
	var parsed = true;
	var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
	for (var i = 0; i < email.length; i++) {
		var letter = email.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) != -1) continue;
		parsed = false;
		break;
	}
	return parsed;
}

//pozor neni dodelano

function isDate(aDatum, aTyp) {
	if (aTyp == undefined) aTyp = 'DATE_CZ';
	reg = new RegExp("[^A-Za-z0-9._-]");
	return (!reg.test(aAlias)) && (aAlias.length > 0);

}

/* Nastaveni focusu na dany element, dobry pro formulare
* Pozor Pro Mozzilu a Netsacape nutne Id
*/

function focusElement(aElementId) {
	elem = document.getElementById(aElementId);
	if (typeof(elem) != "undefined") {
		elem.focus();
		return elem;
	}
	return null;
}

/*  Odstrani zakrtnuti u radiobuttonu nebo checkboxu
  * @access public
  * @param aBoxId Id checkboxu nebo radiobuttonu k odskrtnuti
  * @return void
  */

function uncheckBox(aBoxId) {
	var box = document.getElementById(aBoxId);
	if (box != null) {
		box.checked = false;
	}
}


/*  Zobrazi napovedu pro danou akci - jeji popis (pouziti v changePermisions.tpl v Admin)
* @access public
* @param sel - objekt SELECT z ktereho jsou vybirany akce.
* @param aElementId - ID prvku do ktereho se bude vypisovat, default='napoveda'
* @return void
*/

function setSelectedHelp(sel, aElementId) {
	if ((sel.selectedIndex != null) && (sel.selectedIndex > -1)) {
		index = sel.selectedIndex;

		tempText = sel.options[index].text;
		title = sel.options[index].title;
		if (aElementId.length == 0) {
			aElementId = 'napoveda';
		}
		changeElementText(aElementId, title);
	}
}

/*==========================================================================#
# * Function for adding a Filter to an Input Field                          #
# * @param  : [filterType  ] Type of filter 0=>Alpha, 1=>Num, 2=>AlphaNum   #
# * @param  : [evt         ] The Event Object                               #
# * @param  : [allowDecimal] To allow Decimal Point set this to true        #
# * @param  : [allowCustom ] Custom Characters that are to be allowed       #
#==========================================================================*/

function filterInput(filterType, evt, allowDecimal, allowCustom) {
	var keyCode, Char, inputField, filter = '';
	var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var num = '0123456789';
	// Get the Key Code of the Key pressed if possible else - allow
	if (window.event) {
		keyCode = window.event.keyCode;
		evt = window.event;
	} else if (evt) {
		keyCode = evt.which;
	} else {
		return true;
	}
	// Setup the allowed Character Set
	if (filterType == 0) filter = alpha;
	else if (filterType == 1) filter = num;
	else if (filterType == 2) filter = alpha + num;
	if (allowCustom) filter += allowCustom;
	if (filter == '') return true;
	// Get the Element that triggered the Event
	inputField = evt.srcElement ? evt.srcElement : evt.target || evt.currentTarget;
	// If the Key Pressed is a CTRL key like Esc, Enter etc - allow
	if ((keyCode == null) || (keyCode == 0) || (keyCode == 8) || (keyCode == 9) || (keyCode == 13) || (keyCode == 27)) return true;
	// Get the Pressed Character
	Char = String.fromCharCode(keyCode);

	// If the Character is a number - allow
	if ((filter.indexOf(Char) > -1)) return true;
	// Else if Decimal Point is allowed and the Character is '.' - allow
	else if (filterType == 1 && allowDecimal && (Char == '.') && inputField.value.indexOf('.') == -1) return true;
	else
	return false;
}

/*  aparat pro tvorbu dvojice zavislych selectu (napr. okres/mesto)
 *	Priklad uziti:
 *	
 *	//vytvoreni objektu
 *	var f1 = new MeFilter( "f1", "Region", "filteredField" )
 *	
 *	//vlozeni kategorii
 *	f1.AddFlag( 'ovoce' , '1' )
 *	f1.AddFlag( 'zelenina' , '2' )
 *	f1.AddFlag( 'ryby', '3' )
 *	
 *	//vlozeni itemu
 *	f1.Add( 100, 'Jablko' , '1' )
 *	f1.Add( 101, 'HruĹˇka' , '1' )
 *	f1.Add( 105, 'KvÄ›tĂˇk' , '2' )
 *	f1.Add( 106, 'Kapr' , '3' )
 *	
 *	//polozky s jakym ID maji byt selected
 *	f1.iSelMain = 2
 *	f1.iSelFiltered = 0
 *		
 *	//vykresleni obou selectu
 *	f1.WriteTable()
 *				     	
 *	//aby doslo k filtrovani hned pri nacteni stranky
 *	elementA = document.getElementsByName('Region')
 *	elementB = document.getElementsByName('filteredField')
 *	f1.FilterIt(elementA[0], elementB[0])   
*/

function MeFilter(iName, mainSelectName, secondarySelectName) {

	this.instanceName = iName
	this.firstName = mainSelectName
	this.secondName = secondarySelectName

	this.iLength = 0
	this.arrIDs = new Array()
	this.arrNames = new Array()
	this.arrFlags = new Array()

	this.iLengthF = 0
	this.arrIDsF = new Array()
	this.arrNamesF = new Array()

	this.iSelMain = 0
	this.iSelFiltered = 0

	this.Add = function (ID, name, flags) {
		this.iLength++;
		this.arrNames[this.iLength] = name
		this.arrIDs[this.iLength] = ID
		this.arrFlags[this.iLength] = flags
	}

	this.AddFlag = function (flagName, flagID) {
		this.iLengthF++;
		this.arrNamesF[this.iLengthF] = flagName
		this.arrIDsF[this.iLengthF] = flagID
	}

	this.WriteTable = function () {
		document.write('<select name="' + this.firstName + '" onChange="' + this.instanceName + '.FilterIt(this,this.form.' + this.secondName + ')">')
		for (var i = 1; i <= this.iLengthF; i++) {
			select = ""
			if (this.arrIDsF[i] == this.iSelMain) {
				select = "selected"
			}
			document.write('<option value="' + this.arrIDsF[i] + '" ' + select + '>' + this.arrNamesF[i] + '</option>')
		}
		document.write('</select>')
		document.write('<select name="' + this.secondName + '">')
		document.write('</select>')
	}

	this.FilterIt = function (sField, fField) {
		filterStr = sField.options[sField.selectedIndex].value
		this.DeleteSelect(fField)
		for (var i = 1; i <= this.iLength; i++) {
			if ((this.arrFlags[i] == filterStr) || this.arrFlags[i] == "" || (filterStr == "")) {
				fField.options[fField.options.length] = new Option(this.arrNames[i]);
				fField.options[fField.options.length - 1].value = this.arrIDs[i]
				if (this.arrIDs[i] == this.iSelFiltered) {
					fField.options[fField.options.length - 1].selected = true
				}
			}
		}
	}

	this.DeleteSelect = function (selectfield) {
		while (selectfield.length > 0) {
			selectfield.options[0] = null;
		}
	}
}

/**
 * funkce s kterou pracuje smarty netdogs_mailto slouzici k ochrane 
 * e-mailovych adres zobrazovanych na webu
 */

function MailTo(id, title, style, styleClass, js, box, domain, text) {

	if (typeof(id) != "undefined") {
		id = ' id="' + id + '"';
	} else id = '';

	if (typeof(title) != "undefined") {
		title = ' title="' + title + '"';
	} else title = '';

	if (typeof(style) != "undefined") {
		style = ' ' + style;
	} else style = '';

	if (typeof(styleClass) != "undefined") {
		styleClass = ' ' + styleClass;
	} else styleClass = '';

	if (typeof(js) != "undefined") {
		js = ' ' + js;
	} else js = '';

	mail = GenMail(box, domain);

	if (typeof(text) == "undefined") {
		text = mail;
	}

	document.write('<a' + id + ' href="mailto:' + mail + '" ' + title + '' + style + '' + styleClass + '' + js + '>' + text + '</a>');
}

function GenMail(box, domain) {
	if (typeof(domain) == "undefined") {
		domain = mainDomain;
	}
	mail = box + String.fromCharCode(64) + domain;
	return mail;
}

/**
 * funkce zajistujici kompatibilni pridani stranky do oblibenych
 */

function AddFavorite(linkObj, addUrl, addTitle, alert) {
	if (document.all && !window.opera) {
		window.external.AddFavorite(addUrl, addTitle);
		return false;
	} else if (window.opera && window.print) {
		linkObj.title = addTitle;
		return true;
	} else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) {
		window.sidebar.addPanel(addTitle, addUrl, '');
		return false;
	}
	if (alert != null) {
		window.alert(alert);
	}
	return false;
}

/**
 * ajax refresh na HTML blok s urcitym id
 * zavolana zadanou URL a HTML blok, ktery dostane vlozi do bloku s parametrem id
 */

function ajaxChangeHtmlBlock(id, url) {
	// pridani unikatniho hashe kvuli cacheovani v IE
	var hash = new Date();
	hash = hash.getTime();
	//$("#"+id).hide();
	$("#" + id).html('<img class="regionLoading" src="admin/resources/images/loading/lightbox.gif">');
	$.get(url + "&outputMethod=fetch&hash=" + hash, function (data) {
		$("#" + id).html(data);
		// $("#"+id).show();
	});
}

function hideSeo() {
	$(".topSeo").hide();
} /* end func */

function addAuthor() {
	var sel = document.getElementById('selAuthors');
	var klic = sel.options[sel.selectedIndex].value;
	var hodnota = sel.options[sel.selectedIndex].text;
	var upperSel = window.opener.document.getElementById('selAuthors[]');

	if (window.opener.findByValue(upperSel, klic) == -1) {
		window.opener.appendOption(upperSel, klic, hodnota)
	}

	window.opener.selectOneByValue(upperSel, klic)
}

function addAlternateValue() {
	var translatable = document.getElementById('selTranslatable');
	var translate = translatable.options[translatable.selectedIndex].value;
	var nazev = document.getElementById('txtName').value;

	window.opener.prepareFormAlternateValue(nazev, translate);
	window.close()
}

function prepareFormAlternateValue(nazev, kPrekladu) {
	var sel = document.getElementById('selAlternateValues[]');
	var newValues = document.getElementById('newAlternateValues');
	var count = document.getElementById('newValuesCount');

	count.value = parseInt(count.value) + 1;

	var newId = 'x' + count.value;
	appendOption(sel, newId, nazev);

	newValues.value += newId + '|' + nazev + '|' + kPrekladu + ';;';
	selectOneByValue(sel, newId)
}

function editAlternateValue() {
	var nazev = document.getElementById('txtName').value;
	var id = document.getElementById('hidIdAlternateValue').value;

	window.opener.upateFormAlternateValue(id, nazev);
	window.close()
}

function upateFormAlternateValue(id, nazev) {
	var sel = document.getElementById('selAlternateValues[]');

	for (i = 0; i < sel.options.length; i++) {
		if (sel.options[i].value == id) {
			sel.options[i].text = nazev
		}
	}

	var editedValues = document.getElementById('editedAlternateValues');

	editedValues.value += id + '|' + nazev + ';;'
}

function zmenOznaceniVariant(aSelect, aSize) {
	selectedValue = aSelect.options[aSelect.selectedIndex].value;

	if (selectedValue == 'ciselne') {
		start = 49;
	}

	if (selectedValue == 'velkaPismena') {
		start = 65;
	}

	if (selectedValue == 'malaPismena') {
		start = 97;
		var str = "";
	}

	var oznaceni = 0;

	for (var i = 0; i < aSize; i++) {
		var elem = document.getElementById('oznaceni[' + i + ']');

		if (elem != null) {
			elem.value = String.fromCharCode(oznaceni + start);
			oznaceni++
		} else {
			aSize++
		}
	}
}

function runMethod(aMethodName, aParametr) {
	element = changeElementValue('method', aMethodName);

	if (aParametr != null) {
		changeElementValue('methodParametr', aParametr);
	}

	if (element != null) {
		element.form.submit();
	}
}

function runMethodDelete(aMethodName, aParametr, aText) {
	if (confirmDialog(aText)) {
		runMethod(aMethodName, aParametr);
	}
}

function popupLinks() {
	$("a.popupLink").each(function (i) {
		this.onclick = function () {
			return !window.open(this.href)
		}
	});

	return true
}
window.onload = popupLinks; /* end local.func */

(function ($) {
	$.fn.jcarousel = function (o) {
		if (typeof o == 'string') {
			var instance = $(this).data('jcarousel'),
				args = Array.prototype.slice.call(arguments, 1);

			return instance[o].apply(instance, args);
		} else {
			return this.each(function () {
				$(this).data('jcarousel', new $jc(this, o));
			});
		}
	};

	var defaults = {
		vertical: false,
		start: 1,
		offset: 1,
		size: null,
		scroll: 3,
		visible: null,
		animation: 'normal',
		easing: 'swing',
		auto: 0,
		wrap: null,
		initCallback: null,
		reloadCallback: null,
		itemLoadCallback: null,
		itemFirstInCallback: null,
		itemFirstOutCallback: null,
		itemLastInCallback: null,
		itemLastOutCallback: null,
		itemVisibleInCallback: null,
		itemVisibleOutCallback: null,
		buttonNextHTML: '<div></div>',
		buttonPrevHTML: '<div></div>',
		buttonNextEvent: 'click',
		buttonPrevEvent: 'click',
		buttonNextCallback: null,
		buttonPrevCallback: null
	};

	$.jcarousel = function (e, o) {
		this.options = $.extend({}, defaults, o || {});
		this.locked = false;
		this.container = null;
		this.clip = null;
		this.list = null;
		this.buttonNext = null;
		this.buttonPrev = null;
		this.wh = !this.options.vertical ? 'width' : 'height';
		this.lt = !this.options.vertical ? 'left' : 'top';

		var skin = '',
			split = e.className.split(' ');

		for (var i = 0; i < split.length; i++) {
			if (split[i].indexOf('jcarousel-skin') != -1) {
				$(e).removeClass(split[i]);
				skin = split[i];
				break;
			}
		}

		if (e.nodeName == 'UL' || e.nodeName == 'OL') {
			this.list = $(e);
			this.container = this.list.parent();

			if (this.container.hasClass('jcarousel-clip')) {
				if (!this.container.parent().hasClass('jcarousel-container')) {
					this.container = this.container.wrap('<div></div>');
				}

				this.container = this.container.parent();
			} else if (!this.container.hasClass('jcarousel-container')) {
				this.container = this.list.wrap('<div></div>').parent();
			}
		} else {
			this.container = $(e);
			this.list = this.container.find('ul,ol').eq(0);
		}

		if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1) {
			this.container.wrap('<div class=" ' + skin + '"></div>');
		}

		this.clip = this.list.parent();

		if (!this.clip.length || !this.clip.hasClass('jcarousel-clip')) {
			this.clip = this.list.wrap('<div></div>').parent();
		}

		this.buttonNext = $('.jcarousel-next', this.container);

		if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null) {
			this.buttonNext = this.clip.after(this.options.buttonNextHTML).next();
		}

		this.buttonNext.addClass(this.className('jcarousel-next'));
		this.buttonPrev = $('.jcarousel-prev', this.container);

		if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null) {
			this.buttonPrev = this.clip.after(this.options.buttonPrevHTML).next();
		}

		this.buttonPrev.addClass(this.className('jcarousel-prev'));
		this.clip.addClass(this.className('jcarousel-clip')).css({
			overflow: 'hidden',
			position: 'relative'
		});

		this.list.addClass(this.className('jcarousel-list')).css({
			overflow: 'hidden',
			position: 'relative',
			top: 0,
			left: 0,
			margin: 0,
			padding: 0
		});

		this.container.addClass(this.className('jcarousel-container')).css({
			position: 'relative'
		});

		var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
		var li = this.list.children('li');
		var self = this;

		if (li.size() > 0) {
			var wh = 0,
				i = this.options.offset;

			li.each(function () {
				self.format(this, i++);
				wh += self.dimension(this, di);
			});

			this.list.css(this.wh, wh + 'px');

			if (!o || o.size === undefined) {
				this.options.size = li.size();
			}
		}

		this.container.css('display', 'block');
		this.buttonNext.css('display', 'block');
		this.buttonPrev.css('display', 'block');
		this.funcNext = function () {
			self.next();
		};

		this.funcPrev = function () {
			self.prev();
		};

		this.funcResize = function () {
			self.reload();
		};

		if (this.options.initCallback != null) {
			this.options.initCallback(this, 'init');
		}

		if ($.browser.safari) {
			this.buttons(false, false);
			$(window).bind('load.jcarousel', function () {
				self.setup();
			});
		} else {
			this.setup();
		}
	};

	var $jc = $.jcarousel;

	$jc.fn = $jc.prototype = {
		jcarousel: '0.2.4'
	};

	$jc.fn.extend = $jc.extend = $.extend;

	$jc.fn.extend({
		setup: function () {
			this.first = null;
			this.last = null;
			this.prevFirst = null;
			this.prevLast = null;
			this.animating = false;
			this.timer = null;
			this.tail = null;
			this.inTail = false;

			if (this.locked) {
				return;
			}

			this.list.css(this.lt, this.pos(this.options.offset) + 'px');

			var p = this.pos(this.options.start);

			this.prevFirst = this.prevLast = null;
			this.animate(p, false);
			$(window).unbind('resize.jcarousel', this.funcResize).bind('resize.jcarousel', this.funcResize);
		},
		reset: function () {
			this.list.empty();
			this.list.css(this.lt, '0px');
			this.list.css(this.wh, '10px');

			if (this.options.initCallback != null) {
				this.options.initCallback(this, 'reset');
			}

			this.setup();
		},
		reload: function () {
			if (this.tail != null && this.inTail) {
				this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);
			}

			this.tail = null;
			this.inTail = false;

			if (this.options.reloadCallback != null) {
				this.options.reloadCallback(this);
			}

			if (this.options.visible != null) {
				var self = this;
				var di = Math.ceil(this.clipping() / this.options.visible),
					wh = 0,
					lt = 0;

				$('li', this.list).each(function (i) {
					wh += self.dimension(this, di);

					if (i + 1 < self.first) {
						lt = wh;
					}
				});

				this.list.css(this.wh, wh + 'px');
				this.list.css(this.lt, -lt + 'px');
			}

			this.scroll(this.first, false);
		},
		lock: function () {
			this.locked = true;
			this.buttons();
		},
		unlock: function () {
			this.locked = false;
			this.buttons();
		},
		size: function (s) {
			if (s != undefined) {
				this.options.size = s;
				if (!this.locked) this.buttons();
			}
			return this.options.size;
		},
		has: function (i, i2) {
			if (i2 == undefined || !i2) i2 = i;
			if (this.options.size !== null && i2 > this.options.size) i2 = this.options.size;
			for (var j = i; j <= i2; j++) {
				var e = this.get(j);
				if (!e.length || e.hasClass('jcarousel-item-placeholder')) return false;
			}
			return true;
		},
		get: function (i) {
			return $('.jcarousel-item-' + i, this.list);
		},
		add: function (i, s) {
			var e = this.get(i),
				old = 0,
				add = 0;
			if (e.length == 0) {
				var c, e = this.create(i),
					j = $jc.intval(i);
				while (c = this.get(--j)) {
					if (j <= 0 || c.length) {
						j <= 0 ? this.list.prepend(e) : c.after(e);
						break;
					}
				}
			} else old = this.dimension(e);
			e.removeClass(this.className('jcarousel-item-placeholder'));
			typeof s == 'string' ? e.html(s) : e.empty().append(s);
			var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
			var wh = this.dimension(e, di) - old;
			if (i > 0 && i < this.first) this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');
			this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');
			return e;
		},
		remove: function (i) {
			var e = this.get(i);
			if (!e.length || (i >= this.first && i <= this.last)) return;
			var d = this.dimension(e);
			if (i < this.first) this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');
			e.remove();
			this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');
		},
		next: function () {
			this.stopAuto();
			if (this.tail != null && !this.inTail) this.scrollTail(false);
			else this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
		},
		prev: function () {
			this.stopAuto();
			if (this.tail != null && this.inTail) this.scrollTail(true);
			else this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
		},
		scrollTail: function (b) {
			if (this.locked || this.animating || !this.tail) return;
			var pos = $jc.intval(this.list.css(this.lt));
			!b ? pos -= this.tail : pos += this.tail;
			this.inTail = !b;
			this.prevFirst = this.first;
			this.prevLast = this.last;
			this.animate(pos);
		},
		scroll: function (i, a) {
			if (this.locked || this.animating) return;
			this.animate(this.pos(i), a);
		},
		pos: function (i) {
			var pos = $jc.intval(this.list.css(this.lt));
			if (this.locked || this.animating) return pos;
			if (this.options.wrap != 'circular') i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);
			var back = this.first > i;
			var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;
			var c = back ? this.get(f) : this.get(this.last);
			var j = back ? f : f - 1;
			var e = null,
				l = 0,
				p = false,
				d = 0,
				g;
			while (back ? --j >= i : ++j < i) {
				e = this.get(j);
				p = !e.length;
				if (e.length == 0) {
					e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
					c[back ? 'before' : 'after'](e);
					if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
						g = this.get(this.index(j));
						if (g.length) this.add(j, g.children().clone(true));
					}
				}
				c = e;
				d = this.dimension(e);
				if (p) l += d;
				if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size)))) pos = back ? pos + d : pos - d;
			}
			var clipping = this.clipping();
			var cache = [];
			var visible = 0,
				j = i,
				v = 0;
			var c = this.get(i - 1);
			while (++visible) {
				e = this.get(j);
				p = !e.length;
				if (e.length == 0) {
					e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
					c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after'](e);
					if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
						g = this.get(this.index(j));
						if (g.length) this.add(j, g.find('>*').clone(true));
					}
				}
				c = e;
				var d = this.dimension(e);
				if (d == 0) {
					alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
					return 0;
				}
				if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size) cache.push(e);
				else if (p) l += d;
				v += d;
				if (v >= clipping) break;
				j++;
			}
			for (var x = 0; x < cache.length; x++) cache[x].remove();
			if (l > 0) {
				this.list.css(this.wh, this.dimension(this.list) + l + 'px');
				if (back) {
					pos -= l;
					this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');
				}
			}
			var last = i + visible - 1;
			if (this.options.wrap != 'circular' && this.options.size && last > this.options.size) last = this.options.size;
			if (j > last) {
				visible = 0, j = last, v = 0;
				while (++visible) {
					var e = this.get(j--);
					if (!e.length) break;
					v += this.dimension(e);
					if (v >= clipping) break;
				}
			}
			var first = last - visible + 1;
			if (this.options.wrap != 'circular' && first < 1) first = 1;
			if (this.inTail && back) {
				pos += this.tail;
				this.inTail = false;
			}
			this.tail = null;
			if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {
				var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');
				if ((v - m) > clipping) this.tail = v - clipping - m;
			}
			while (i-- > first) pos += this.dimension(this.get(i));
			this.prevFirst = this.first;
			this.prevLast = this.last;
			this.first = first;
			this.last = last;
			return pos;
		},
		animate: function (p, a) {
			if (this.locked || this.animating) return;
			this.animating = true;
			var self = this;
			var scrolled = function () {
				self.animating = false;
				if (p == 0) self.list.css(self.lt, 0);
				if (self.options.wrap == 'circular' || self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size) self.startAuto();
				self.buttons();
				self.notify('onAfterAnimation');
			};
			this.notify('onBeforeAnimation');
			if (!this.options.animation || a == false) {
				this.list.css(this.lt, p + 'px');
				scrolled();
			} else {
				var o = !this.options.vertical ? {
					'left': p
				} : {
					'top': p
				};
				this.list.animate(o, this.options.animation, this.options.easing, scrolled);
			}
		},
		startAuto: function (s) {
			if (s != undefined) this.options.auto = s;
			if (this.options.auto == 0) return this.stopAuto();
			if (this.timer != null) return;
			var self = this;
			this.timer = setTimeout(function () {
				self.next();
			}, this.options.auto * 1000);
		},
		stopAuto: function () {
			if (this.timer == null) return;
			clearTimeout(this.timer);
			this.timer = null;
		},
		buttons: function (n, p) {
			if (n == undefined || n == null) {
				var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);
				if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size) n = this.tail != null && !this.inTail;
			}
			if (p == undefined || p == null) {
				var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);
				if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1) p = this.tail != null && this.inTail;
			}
			var self = this;
			this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent + '.jcarousel', this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);
			this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent + '.jcarousel', this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);
			if (this.buttonNext.length > 0 && (this.buttonNext[0].jcarouselstate == undefined || this.buttonNext[0].jcarouselstate != n) && this.options.buttonNextCallback != null) {
				this.buttonNext.each(function () {
					self.options.buttonNextCallback(self, this, n);
				});
				this.buttonNext[0].jcarouselstate = n;
			}
			if (this.buttonPrev.length > 0 && (this.buttonPrev[0].jcarouselstate == undefined || this.buttonPrev[0].jcarouselstate != p) && this.options.buttonPrevCallback != null) {
				this.buttonPrev.each(function () {
					self.options.buttonPrevCallback(self, this, p);
				});
				this.buttonPrev[0].jcarouselstate = p;
			}
		},
		notify: function (evt) {
			var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');
			this.callback('itemLoadCallback', evt, state);
			if (this.prevFirst !== this.first) {
				this.callback('itemFirstInCallback', evt, state, this.first);
				this.callback('itemFirstOutCallback', evt, state, this.prevFirst);
			}
			if (this.prevLast !== this.last) {
				this.callback('itemLastInCallback', evt, state, this.last);
				this.callback('itemLastOutCallback', evt, state, this.prevLast);
			}
			this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);
			this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);
		},
		callback: function (cb, evt, state, i1, i2, i3, i4) {
			if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation')) return;
			var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];
			if (!$.isFunction(callback)) return;
			var self = this;
			if (i1 === undefined) callback(self, state, evt);
			else if (i2 === undefined) this.get(i1).each(function () {
				callback(self, this, i1, state, evt);
			});
			else {
				for (var i = i1; i <= i2; i++) if (i !== null && !(i >= i3 && i <= i4)) this.get(i).each(function () {
					callback(self, this, i, state, evt);
				});
			}
		},
		create: function (i) {
			return this.format('<li></li>', i);
		},
		format: function (e, i) {
			var $e = $(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i)).css({
				'float': 'left',
				'list-style': 'none'
			});
			$e.attr('jcarouselindex', i);
			return $e;
		},
		className: function (c) {
			return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');
		},
		dimension: function (e, d) {
			var el = e.jquery != undefined ? e[0] : e;
			var old = !this.options.vertical ? el.offsetWidth + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') : el.offsetHeight + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');
			if (d == undefined || old == d) return old;
			var w = !this.options.vertical ? d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') : d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');
			$(el).css(this.wh, w + 'px');
			return this.dimension(el);
		},
		clipping: function () {
			return !this.options.vertical ? this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) : this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));
		},
		index: function (i, s) {
			if (s == undefined) s = this.options.size;
			return Math.round((((i - 1) / s) - Math.floor((i - 1) / s)) * s) + 1;
		}
	});

	$jc.extend({
		defaults: function (d) {
			return $.extend(defaults, d || {});
		},
		margin: function (e, p) {
			if (!e) return 0;
			var el = e.jquery != undefined ? e[0] : e;
			if (p == 'marginRight' && $.browser.safari) {
				var old = {
					'display': 'block',
					'float': 'none',
					'width': 'auto'
				},
					oWidth, oWidth2;
				$.swap(el, old, function () {
					oWidth = el.offsetWidth;
				});
				old['marginRight'] = 0;
				$.swap(el, old, function () {
					oWidth2 = el.offsetWidth;
				});
				return oWidth2 - oWidth;
			}
			return $jc.intval($.css(el, p));
		},
		intval: function (v) {
			v = parseInt(v);
			return isNaN(v) ? 0 : v;
		}
	});
})(jQuery); /* end jcarousel */
(function ($, flash, Plugin) {
	var OBJECT = 'object',
		ENCODE = true;

	function _compareArrayIntegers(a, b) {
		var x = (a[0] || 0) - (b[0] || 0);
		return x > 0 || (!x && a.length > 0 && _compareArrayIntegers(a.slice(1), b.slice(1)))
	}
	function _objectToArguments(obj) {
		if (typeof obj != OBJECT) {
			return obj
		}
		var arr = [],
			str = '';
		for (var i in obj) {
			if (typeof obj[i] == OBJECT) {
				str = _objectToArguments(obj[i])
			} else {
				str = [i, (ENCODE) ? encodeURI(obj[i]) : obj[i]].join('=')
			}
			arr.push(str)
		}
		return arr.join('&')
	}
	function _objectFromObject(obj) {
		var arr = [];
		for (var i in obj) {
			if (obj[i]) {
				arr.push([i, '="', obj[i], '"'].join(''))
			}
		}
		return arr.join(' ')
	}
	function _paramsFromObject(obj) {
		var arr = [];
		for (var i in obj) {
			arr.push(['<param name="', i, '" value="', _objectToArguments(obj[i]), '" />'].join(''))
		}
		return arr.join('')
	}
	try {
		var flashVersion = Plugin.description || (function () {
			return (new Plugin('ShockwaveFlash.ShockwaveFlash')).GetVariable('$version')
		}())
	} catch (e) {
		flashVersion = 'Unavailable'
	}
	var flashVersionMatchVersionNumbers = flashVersion.match(/\d+/g) || [0];
	$[flash] = {
		available: flashVersionMatchVersionNumbers[0] > 0,
		activeX: Plugin && !Plugin.name,
		version: {
			original: flashVersion,
			array: flashVersionMatchVersionNumbers,
			string: flashVersionMatchVersionNumbers.join('.'),
			major: parseInt(flashVersionMatchVersionNumbers[0], 10) || 0,
			minor: parseInt(flashVersionMatchVersionNumbers[1], 10) || 0,
			release: parseInt(flashVersionMatchVersionNumbers[2], 10) || 0
		},
		hasVersion: function (version) {
			var versionArray = (/string|number/.test(typeof version)) ? version.toString().split('.') : (/object/.test(typeof version)) ? [version.major, version.minor] : version || [0, 0];
			return _compareArrayIntegers(flashVersionMatchVersionNumbers, versionArray)
		},
		encodeParams: true,
		expressInstall: 'expressInstall.swf',
		expressInstallIsActive: false,
		create: function (obj) {
			var instance = this;
			if (!obj.swf || instance.expressInstallIsActive || (!instance.available && !obj.hasVersionFail)) {
				return false
			}
			if (!instance.hasVersion(obj.hasVersion || 1)) {
				instance.expressInstallIsActive = true;
				if (typeof obj.hasVersionFail == 'function') {
					if (!obj.hasVersionFail.apply(obj)) {
						return false
					}
				}
				obj = {
					swf: obj.expressInstall || instance.expressInstall,
					height: 137,
					width: 214,
					flashvars: {
						MMredirectURL: location.href,
						MMplayerType: (instance.activeX) ? 'ActiveX' : 'PlugIn',
						MMdoctitle: document.title.slice(0, 47) + ' - Flash Player Installation'
					}
				}
			}
			attrs = {
				data: obj.swf,
				type: 'application/x-shockwave-flash',
				id: obj.id || 'flash_' + Math.floor(Math.random() * 999999999),
				width: obj.width || 320,
				height: obj.height || 180,
				style: obj.style || ''
			};
			ENCODE = typeof obj.useEncode !== 'undefined' ? obj.useEncode : instance.encodeParams;
			obj.movie = obj.swf;
			obj.wmode = obj.wmode || 'opaque';
			delete obj.fallback;
			delete obj.hasVersion;
			delete obj.hasVersionFail;
			delete obj.height;
			delete obj.id;
			delete obj.swf;
			delete obj.useEncode;
			delete obj.width;
			var flashContainer = document.createElement('div');
			flashContainer.innerHTML = ['<object ', _objectFromObject(attrs), '>', _paramsFromObject(obj), '</object>'].join('');
			return flashContainer.firstChild
		}
	};
	$.fn[flash] = function (options) {
		var $this = this.find(OBJECT).andSelf().filter(OBJECT);
		if (/string|object/.test(typeof options)) {
			this.each(function () {
				var $this = $(this),
					flashObject;
				options = (typeof options == OBJECT) ? options : {
					swf: options
				};
				options.fallback = this;
				flashObject = $[flash].create(options);
				if (flashObject) {
					$this.children().remove();
					$this.html(flashObject)
				}
			})
		}
		if (typeof options == 'function') {
			$this.each(function () {
				var instance = this,
					jsInteractionTimeoutMs = 'jsInteractionTimeoutMs';
				instance[jsInteractionTimeoutMs] = instance[jsInteractionTimeoutMs] || 0;
				if (instance[jsInteractionTimeoutMs] < 660) {
					if (instance.clientWidth || instance.clientHeight) {
						options.call(instance)
					} else {
						setTimeout(function () {
							$(instance)[flash](options)
						}, instance[jsInteractionTimeoutMs] + 66)
					}
				}
			})
		}
		return $this
	}
}(jQuery, 'flash', navigator.plugins['Shockwave Flash'] || window.ActiveXObject));
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
			}
		}
	}
}(); /* end swfobject */
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, _b) {
	if (!document.createElement || !document.getElementById) {
		return
	}
	this.DETECT_KEY = _b ? _b : "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(this.getAttribute("version"), _7);
	if (c) {
		this.addParam("bgcolor", c)
	}
	var q = _8 ? _8 : "high";
	this.addParam("quality", q);
	this.setAttribute("useExpressInstall", _7);
	this.setAttribute("doExpressInstall", false);
	var _d = (_9) ? _9 : window.location;
	this.setAttribute("xiRedirectUrl", _d);
	this.setAttribute("redirectUrl", "");
	if (_a) {
		this.setAttribute("redirectUrl", _a)
	}
};
deconcept.SWFObject.prototype = {
	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.push(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")
			}
			_19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\"";
			_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")
			}
			_19 = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\">";
			_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();
			return true
		} else {
			if (this.getAttribute("redirectUrl") != "") {
				document.location.replace(this.getAttribute("redirectUrl"))
			}
		}
		return false
	}
};
deconcept.SWFObjectUtil.getPlayerVersion = function (_23, _24) {
	var _25 = new deconcept.PlayerVersion([0, 0, 0]);
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if (x && x.description) {
			_25 = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."))
		}
	} else {
		try {
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i = 3; axo != null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				_25 = new deconcept.PlayerVersion([i, 0, 0])
			}
		} catch (e) {}
		if (_23 && _25.major > _23.major) {
			return _25
		}
		if (!_23 || ((_23.minor != 0 || _23.rev != 0) && _25.major == _23.major) || _25.major != 6 || _24) {
			try {
				_25 = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))
			} catch (e) {}
		}
	}
	return _25
};
deconcept.PlayerVersion = function (_29) {
	this.major = parseInt(_29[0]) != null ? parseInt(_29[0]) : 0;
	this.minor = parseInt(_29[1]) || 0;
	this.rev = 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 (q) {
			var _2d = q.indexOf(_2b + "=");
			var _2e = (q.indexOf("&", _2d) > -1) ? q.indexOf("&", _2d) : q.length;
			if (q.length > 1 && _2d > -1) {
				return q.substring(q.indexOf("=", _2d) + 1, _2e)
			}
		}
		return ""
	}
};
deconcept.SWFObjectUtil.cleanupSWFs = function () {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = 0; i < objects.length; i++) {
		for (var x in objects[i]) {
			if (typeof objects[i][x] == "function") {
				objects[i][x] = null
			}
		}
	}
};
if (typeof window.onunload == "function") {
	var oldunload = window.onunload;
	window.onunload = function () {
		deconcept.SWFObjectUtil.cleanupSWFs();
		oldunload()
	}
} else {
	window.onunload = deconcept.SWFObjectUtil.cleanupSWFs
}
if (Array.prototype.push == null) {
	Array.prototype.push = function (_32) {
		this[this.length] = _32;
		return this.length
	}
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject; /* end swfobject 2*/
$(document).ready(function () {
	$("a[rel='colorbox']").colorbox();
	$(".iframeFrontLogin").colorbox({
		iframe: true,
		width: "350px",
		height: "300px",
		overflow: "hidden",
		scrolling: false,
		onClosed: function () {
			function getUrlVars(url) {
				var vars = [],
					hash;
				var hashes = url.slice(window.location.href.indexOf('?') + 1).split('&');
				for (var i = 0; i < hashes.length; i++) {
					hash = hashes[i].split('=');
					vars.push(hash[0]);
					vars[hash[0]] = hash[1]
				}
				return vars
			}
			var url = $(this).attr('href');
			var params = getUrlVars(url);
			if (params['id_cn']) {
				var newUrl = '/' + params['lang'] + '/c' + params['id_cn'];
				window.location.href = newUrl
			} else {
				location.reload(true)
			}
		}
	});
	$(".iframeFrontRegister").colorbox({
		iframe: true,
		width: "595px",
		height: "305px",
		scrolling: false,
		overflow: "hidden",
		onClosed: function () {
			location.reload(true)
		}
	});
	$("a[class='thickbox']").colorbox()
}); /* colorbox*/


/*
 * Pixastic - JavaScript Image Processing Library
 * Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/
 * MIT License [http://www.pixastic.com/lib/license.txt]
 */


var Pixastic = (function () {
	function addEvent(el, event, handler) {
		if (el.addEventListener) el.addEventListener(event, handler, false);
		else if (el.attachEvent) el.attachEvent("on" + event, handler);
	}

	function onready(handler) {
		var handlerDone = false;
		var execHandler = function () {
			if (!handlerDone) {
				handlerDone = true;
				handler();
			}
		}
		document.write("<" + "script defer src=\"//:\" id=\"__onload_ie_pixastic__\"></" + "script>");
		var script = document.getElementById("__onload_ie_pixastic__");
		script.onreadystatechange = function () {
			if (script.readyState == "complete") {
				script.parentNode.removeChild(script);
				execHandler();
			}
		}
		if (document.addEventListener) document.addEventListener("DOMContentLoaded", execHandler, false);
		addEvent(window, "load", execHandler);
	}

	function init() {
		var imgEls = getElementsByClass("pixastic", null, "img");
		var canvasEls = getElementsByClass("pixastic", null, "canvas");
		var elements = imgEls.concat(canvasEls);
		for (var i = 0; i < elements.length; i++) {
			(function () {
				var el = elements[i];
				var actions = [];
				var classes = el.className.split(" ");
				for (var c = 0; c < classes.length; c++) {
					var cls = classes[c];
					if (cls.substring(0, 9) == "pixastic-") {
						var actionName = cls.substring(9);
						if (actionName != "") actions.push(actionName);
					}
				}
				if (actions.length) {
					if (el.tagName.toLowerCase() == "img") {
						var dataImg = new Image();
						dataImg.src = el.src;
						if (dataImg.complete) {
							for (var a = 0; a < actions.length; a++) {
								var res = Pixastic.applyAction(el, el, actions[a], null);
								if (res) el = res;
							}
						} else {
							dataImg.onload = function () {
								for (var a = 0; a < actions.length; a++) {
									var res = Pixastic.applyAction(el, el, actions[a], null)
									if (res) el = res;
								}
							}
						}
					} else {
						setTimeout(function () {
							for (var a = 0; a < actions.length; a++) {
								var res = Pixastic.applyAction(el, el, actions[a], null);
								if (res) el = res;
							}
						}, 1);
					}
				}
			})();
		}
	}
	if (typeof pixastic_parseonload != "undefined" && pixastic_parseonload) onready(init);

	function getElementsByClass(searchClass, node, tag) {
		var classElements = new Array();
		if (node == null) node = document;
		if (tag == null) tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
		for (i = 0, j = 0; i < elsLen; i++) {
			if (pattern.test(els[i].className)) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}
	var debugElement;

	function writeDebug(text, level) {
		if (!Pixastic.debug) return;
		try {
			switch (level) {
			case "warn":
				console.warn("Pixastic:", text);
				break;
			case "error":
				console.error("Pixastic:", text);
				break;
			default:
				console.log("Pixastic:", text);
			}
		} catch (e) {}
		if (!debugElement) {}
	}
	var hasCanvas = (function () {
		var c = document.createElement("canvas");
		var val = false;
		try {
			val = !! ((typeof c.getContext == "function") && c.getContext("2d"));
		} catch (e) {}
		return function () {
			return val;
		}
	})();
	var hasCanvasImageData = (function () {
		var c = document.createElement("canvas");
		var val = false;
		var ctx;
		try {
			if (typeof c.getContext == "function" && (ctx = c.getContext("2d"))) {
				val = (typeof ctx.getImageData == "function");
			}
		} catch (e) {}
		return function () {
			return val;
		}
	})();
	var hasGlobalAlpha = (function () {
		var hasAlpha = false;
		var red = document.createElement("canvas");
		if (hasCanvas() && hasCanvasImageData()) {
			red.width = red.height = 1;
			var redctx = red.getContext("2d");
			redctx.fillStyle = "rgb(255,0,0)";
			redctx.fillRect(0, 0, 1, 1);
			var blue = document.createElement("canvas");
			blue.width = blue.height = 1;
			var bluectx = blue.getContext("2d");
			bluectx.fillStyle = "rgb(0,0,255)";
			bluectx.fillRect(0, 0, 1, 1);
			redctx.globalAlpha = 0.5;
			redctx.drawImage(blue, 0, 0);
			var reddata = redctx.getImageData(0, 0, 1, 1).data;
			hasAlpha = (reddata[2] != 255);
		}
		return function () {
			return hasAlpha;
		}
	})();
	return {
		parseOnLoad: false,
		debug: false,
		applyAction: function (img, dataImg, actionName, options) {
			options = options || {};
			var imageIsCanvas = (img.tagName.toLowerCase() == "canvas");
			if (imageIsCanvas && Pixastic.Client.isIE()) {
				if (Pixastic.debug) writeDebug("Tried to process a canvas element but browser is IE.");
				return false;
			}
			var canvas, ctx;
			var hasOutputCanvas = false;
			if (Pixastic.Client.hasCanvas()) {
				hasOutputCanvas = !! options.resultCanvas;
				canvas = options.resultCanvas || document.createElement("canvas");
				ctx = canvas.getContext("2d");
			}
			var w = img.offsetWidth;
			var h = img.offsetHeight;
			if (imageIsCanvas) {
				w = img.width;
				h = img.height;
			}
			if (w == 0 || h == 0) {
				if (img.parentNode == null) {
					var oldpos = img.style.position;
					var oldleft = img.style.left;
					img.style.position = "absolute";
					img.style.left = "-9999px";
					document.body.appendChild(img);
					w = img.offsetWidth;
					h = img.offsetHeight;
					document.body.removeChild(img);
					img.style.position = oldpos;
					img.style.left = oldleft;
				} else {
					if (Pixastic.debug) writeDebug("Image has 0 width and/or height.");
					return;
				}
			}
			if (actionName.indexOf("(") > -1) {
				var tmp = actionName;
				actionName = tmp.substr(0, tmp.indexOf("("));
				var arg = tmp.match(/\((.*?)\)/);
				if (arg[1]) {
					arg = arg[1].split(";");
					for (var a = 0; a < arg.length; a++) {
						thisArg = arg[a].split("=");
						if (thisArg.length == 2) {
							if (thisArg[0] == "rect") {
								var rectVal = thisArg[1].split(",");
								options[thisArg[0]] = {
									left: parseInt(rectVal[0], 10) || 0,
									top: parseInt(rectVal[1], 10) || 0,
									width: parseInt(rectVal[2], 10) || 0,
									height: parseInt(rectVal[3], 10) || 0
								}
							} else {
								options[thisArg[0]] = thisArg[1];
							}
						}
					}
				}
			}
			if (!options.rect) {
				options.rect = {
					left: 0,
					top: 0,
					width: w,
					height: h
				};
			} else {
				options.rect.left = Math.round(options.rect.left);
				options.rect.top = Math.round(options.rect.top);
				options.rect.width = Math.round(options.rect.width);
				options.rect.height = Math.round(options.rect.height);
			}
			var validAction = false;
			if (Pixastic.Actions[actionName] && typeof Pixastic.Actions[actionName].process == "function") {
				validAction = true;
			}
			if (!validAction) {
				if (Pixastic.debug) writeDebug("Invalid action \"" + actionName + "\". Maybe file not included?");
				return false;
			}
			if (!Pixastic.Actions[actionName].checkSupport()) {
				if (Pixastic.debug) writeDebug("Action \"" + actionName + "\" not supported by this browser.");
				return false;
			}
			if (Pixastic.Client.hasCanvas()) {
				if (canvas !== img) {
					canvas.width = w;
					canvas.height = h;
				}
				if (!hasOutputCanvas) {
					canvas.style.width = w + "px";
					canvas.style.height = h + "px";
				}
				ctx.drawImage(dataImg, 0, 0, w, h);
				if (!img.__pixastic_org_image) {
					canvas.__pixastic_org_image = img;
					canvas.__pixastic_org_width = w;
					canvas.__pixastic_org_height = h;
				} else {
					canvas.__pixastic_org_image = img.__pixastic_org_image;
					canvas.__pixastic_org_width = img.__pixastic_org_width;
					canvas.__pixastic_org_height = img.__pixastic_org_height;
				}
			} else if (Pixastic.Client.isIE() && typeof img.__pixastic_org_style == "undefined") {
				img.__pixastic_org_style = img.style.cssText;
			}
			var params = {
				image: img,
				canvas: canvas,
				width: w,
				height: h,
				useData: true,
				options: options
			}
			var res = Pixastic.Actions[actionName].process(params);
			if (!res) {
				return false;
			}
			if (Pixastic.Client.hasCanvas()) {
				if (params.useData) {
					if (Pixastic.Client.hasCanvasImageData()) {
						canvas.getContext("2d").putImageData(params.canvasData, options.rect.left, options.rect.top);
						canvas.getContext("2d").fillRect(0, 0, 0, 0);
					}
				}
				if (!options.leaveDOM) {
					canvas.title = img.title;
					canvas.imgsrc = img.imgsrc;
					if (!imageIsCanvas) canvas.alt = img.alt;
					if (!imageIsCanvas) canvas.imgsrc = img.src;
					canvas.className = img.className;
					canvas.style.cssText = img.style.cssText;
					canvas.name = img.name;
					canvas.tabIndex = img.tabIndex;
					canvas.id = img.id;
					if (img.parentNode && img.parentNode.replaceChild) {
						img.parentNode.replaceChild(canvas, img);
					}
				}
				options.resultCanvas = canvas;
				return canvas;
			}
			return img;
		},
		prepareData: function (params, getCopy) {
			var ctx = params.canvas.getContext("2d");
			var rect = params.options.rect;
			var dataDesc = ctx.getImageData(rect.left, rect.top, rect.width, rect.height);
			var data = dataDesc.data;
			if (!getCopy) params.canvasData = dataDesc;
			return data;
		},
		process: function (img, actionName, options, callback) {
			if (img.tagName.toLowerCase() == "img") {
				var dataImg = new Image();
				dataImg.src = img.src;
				if (dataImg.complete) {
					var res = Pixastic.applyAction(img, dataImg, actionName, options);
					if (callback) callback(res);
					return res;
				} else {
					dataImg.onload = function () {
						var res = Pixastic.applyAction(img, dataImg, actionName, options)
						if (callback) callback(res);
					}
				}
			}
			if (img.tagName.toLowerCase() == "canvas") {
				var res = Pixastic.applyAction(img, img, actionName, options);
				if (callback) callback(res);
				return res;
			}
		},
		revert: function (img) {
			if (Pixastic.Client.hasCanvas()) {
				if (img.tagName.toLowerCase() == "canvas" && img.__pixastic_org_image) {
					img.width = img.__pixastic_org_width;
					img.height = img.__pixastic_org_height;
					img.getContext("2d").drawImage(img.__pixastic_org_image, 0, 0);
					if (img.parentNode && img.parentNode.replaceChild) {
						img.parentNode.replaceChild(img.__pixastic_org_image, img);
					}
					return img;
				}
			} else if (Pixastic.Client.isIE()) {
				if (typeof img.__pixastic_org_style != "undefined") img.style.cssText = img.__pixastic_org_style;
			}
		},
		Client: {
			hasCanvas: hasCanvas,
			hasCanvasImageData: hasCanvasImageData,
			hasGlobalAlpha: hasGlobalAlpha,
			isIE: function () {
				return !!document.all && !! window.attachEvent && !window.opera;
			}
		},
		Actions: {}
	}
})();
Pixastic.Actions.desaturate = {
	process: function (params) {
		var useAverage = !! (params.options.average && params.options.average != "false");
		if (Pixastic.Client.hasCanvasImageData()) {
			var data = Pixastic.prepareData(params);
			var rect = params.options.rect;
			var w = rect.width;
			var h = rect.height;
			var p = w * h;
			var pix = p * 4,
				pix1, pix2;
			if (useAverage) {
				while (p--)
				data[pix -= 4] = data[pix1 = pix + 1] = data[pix2 = pix + 2] = (data[pix] + data[pix1] + data[pix2]) / 3
			} else {
				while (p--)
				data[pix -= 4] = data[pix1 = pix + 1] = data[pix2 = pix + 2] = (data[pix] * 0.3 + data[pix1] * 0.59 + data[pix2] * 0.11);
			}
			return true;
		} else if (Pixastic.Client.isIE()) {
			params.image.style.filter += " gray";
			return true;
		}
	},
	checkSupport: function () {
		return (Pixastic.Client.hasCanvasImageData() || Pixastic.Client.isIE());
	}
}
