/*
FRONT OFFICE SCRIPTS PAGE
*/

// COMMON METHODS

// On load event
Event.observe(window, 'load', OnPageLoad);

// Preload process status
function OnPageLoad() {
	// None
}

// Resize content block
function contBlockHeight(_minHeight) {
	// Get layer
	var _cont = $("pgContent");
	if (_cont != null) {
		var _height = parseInt(_cont.offsetHeight);
		// Resize layer
		if (_height < _minHeight) { _cont.style.height = _minHeight + 'px'; }
	}
}

// Load HOME page flashes set
function loadFlashes(_items, _timeOut) {
	// Set load flashes timeOut
	setTimeout('loadShow(1,' + _items + ',' + _timeOut + ')', _timeOut);
}
// Load HOME page flash item
function loadShow(_item, _items, _timeOut) {
	// Get flash place layer
	var _layer = $('openShow' + _item);
	// Check if layer exist
	if (_layer != null) {
		// Plug-in update
		_layer.innerHTML = 'To view this content you must have the lastest <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;promoid=BIOW" target="_blank">FLASH PLUGIN</a> installed.';
		// Create flash object
		var _swf = new SWFObject('/Design/Flash/viewCasts.swf', 'openShow', '233', '233', '8', '#d6f0e5');
		// Create script file name
		var _srcFile = '/Design/Flash/vc_' + _layer.lang + '_' + _item + '.xml';
		// Add variable
		_swf.addVariable('xmlScript', _srcFile);
		// Set transparent mode
		_swf.addParam("wmode", "transparent");
		// Load flash
		_swf.write(_layer.id);
	}
	// Read next
	if (_item < _items) {
		// Forward flash counter
		_item++;
		// Set load flashes timeOut
		setTimeout('loadShow(' + _item + ',' + _items + ',' + _timeOut + ')', _timeOut);
	}
}

// On list item focus
function onPartFocus(_list, _id) {
	var _item = $(_list + '_' + _id);
	if (_item != null) {
		_item.style.borderColor = '#ad8408';
	}
}
// On list item blur
function onPartBlur(_list, _id) {
	var _item = $(_list + '_' + _id);
	if (_item != null) {
		_item.style.borderColor = '#aadbc5';
	}
}

// On list item focus
function onItemFocus(_list, _id) {
	var _item = $(_list + '_' + _id);
	if (_item != null) {
		_item.style.borderColor = '#ad8408';
	}
}
// On list item blur
function onItemBlur(_list, _id) {
	var _item = $(_list + '_' + _id);
	if (_item != null) {
		_item.style.borderColor = '#aadbc5';
	}
}


