

var fc_2 = false;
var fc_3 = false;
var fc_4 = false;
var fc_5 = false;
var fc_6 = false;
var fc_7 = false;
var fc_8 = false;

var fc_highestVersion = 0;

function detectFlash() {

	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

	if(isIE && isWin){
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('fc_2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
		document.write('fc_3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
		document.write('fc_4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
		document.write('fc_5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
		document.write('fc_6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
		document.write('fc_7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
		document.write('fc_8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
		document.write('</SCR' + 'IPT\> \n');
	}

	if (navigator.plugins) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			fc_2 = flashVersion == 2;
			fc_3 = flashVersion == 3;
			fc_4 = flashVersion == 4;
			fc_5 = flashVersion == 5;
			fc_6 = flashVersion == 6;
			fc_7 = flashVersion >= 7;
			fc_8 = flashVersion >= 8;
		}
	}

	for (var i = 2; i <= 8; i++) {
		if (eval("fc_" + i) == true)
			fc_highestVersion = i;
	}

}

detectFlash();


function embedFlash(i, f, w, h, c, fv) {
	var embedCode_flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"'
	+ 'width="'+w+'" height="'+h+'"'
	+ 'id="'+i+'">'
	+ '<param name="movie" value="'+f+'">'
	+ '<param name="quality" value="high">'
	+ '<param name="menu" value="false">'
	+ '<param name="bgcolor" value="'+c+'">'
	+ '<param name=flashvars value="'+fv+'">'
	+ '<param name="wmode" value="transparent">'
	+ '<embed src="'+f+'"'
	+ 'menu="false"'
	+ 'quality="high"'
	+ 'scale="exactfit" wmode="transparent"'
	+ 'bgcolor="'+c+'"'
	+ 'width="'+w+'" height="'+h+'"'
	+ 'name="'+i+'"'
	+ 'type="application/x-shockwave-flash"'
	+ 'flashvars="'+fv+'"'
	+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	+ '</embed>'
	+ '</object>';
	document.write(embedCode_flash);
}

function selectProductsListWithBrand(categoryId) {
	brandId = jQuery('#brand_id option:selected').val();
	return main_request('part=search;category=' + categoryId + ';brand=' + brandId);
}

function searchByBrand() {
	element = document.getElementById('brand_value_id');
	select = document.getElementById('brand_id');
	element.value = select.options[select.selectedIndex].value;
	//e.form.sumbit();
}



