	/** show minority sport menu
	 */
	function menumin_show()
	{
		document.getElementById('menumin').style.display = 'block';
	}

	/** hide minority sport menu
	 */
	function menumin_hide()
	{
		menumin_fix_param = false;
		setTimeout('menumin_try_to_hide()', 200);
	}

	/** set minority menu fix
	 */
	function menumin_fix()
	{
		menumin_fix_param = true;
	}

	var menumin_fix_param = false;

	/** try to hide minority menu
	 */
	function menumin_try_to_hide()
	{
		if(!menumin_fix_param)
		{
			document.getElementById('menumin').style.display = 'none';
		}
	}

	/** Display timezone popup menu
	 */
	function display_tz(element_id)
	{
		if(element = document.getElementById(element_id))
		{
			if(element.style.display == 'block')
			{
				element.style.display = 'none';
				tz_flash_banner_show();
			}
			else
			{
				var as = element.getElementsByTagName('a');
				var actual = document.getElementById('tzactual').innerHTML;
				actual = actual.replace('+', '[+]');

				var tz_date = new Date();
				tz_date = tz_date.getTimezoneOffset() / -60;
				tz_date = new Number(tz_date);
				tz_date = tz_date.toFixed(0);

				var tz_default_local = (tz_date >= 0 ? 'GMT[+]' + tz_date : 'GMT' + tz_date) + '$';

				for(var i = 0; i < as.length; i++)
				{
					var css = '';

					if(as[i].innerHTML.match(actual) != null)
						css += ' active';

					if(as[i].innerHTML.match(tz_default_local) != null)
						css += ' tzdefault';

					if(css == '')
						rem_attr(as[i], 'class');
					else
						set_attr(as[i], 'class', css);
				}

				tz_flash_banner_hide();
				element.style.display = 'block';
			}
		}
	}

	function tz_flash_banner_hide()
	{
		var banner_iframe_list = new Array('lsadvert-left_menu_1', 'lsadvert-left_menu_2', 'lsadvert-left_menu_3');
		var banner_iframe_sport_list = 'soccer|hockey|basketball';
		var banner_iframe;

		for(var i in banner_iframe_list)
		{
			if(banner_iframe_sport_list.match(sport) && banner_iframe_list[i] != 'lsadvert-left_menu_1')
				break;

			if(banner_iframe = document.getElementById(banner_iframe_list[i]))
				banner_iframe.style.visibility = 'hidden';
		}
	}

	function tz_flash_banner_show()
	{
		var banner_iframe_list = new Array('lsadvert-left_menu_1', 'lsadvert-left_menu_2', 'lsadvert-left_menu_3');
		var banner_iframe_sport_list = 'soccer|hockey|basketball';
		var banner_iframe;

		for(var i in banner_iframe_list)
		{
			if(banner_iframe_sport_list.match(sport) && banner_iframe_list[i] != 'lsadvert-left_menu_1')
				break;

			if(banner_iframe = document.getElementById(banner_iframe_list[i]))
				banner_iframe.style.visibility = 'visible';
		}
	}

	function set_tz(tz, element_id)
	{
		var iframe = document.getElementById('livescoreContent');

		if(iframe && iframe.contentWindow)
		{
			iframe.contentWindow.change_tz(tz);
		}

		cookie_set('fs_tza', tz, 360, 'self', '/');
		set_actual_tz('tzactual', tz);

		if(element = document.getElementById(element_id))
		{
			element.style.display = 'none';
			tz_flash_banner_show();
		}

				
		return true;
	}

	function set_actual_tz(element_id, tz)
	{
		var cookie_tz = cookie_get('fs_tza');

		if(cookie_tz != null && cookie_tz <= 13 && cookie_tz >= -11)
			tz = cookie_tz

		var offset = tz * 3600 * (-1);

		element = document.getElementById(element_id);

		if(element)
		{
			var time_only = (typeof tz_actual_short == 'undefined' ? false : (tz_actual_short ? true : false));
			element.innerHTML = utime2time(gmdate, offset, time_only, true, true) + ', GMT' + (tz >= 0 ? '+' : '') + tz;
		}
	}

	function create_tzcontent(element_id)
	{
		var element = document.getElementById(element_id);
		var ul = document.createElement('ul');

		set_attr(ul, 'id', 'tzcontent');

		for(var i in tz_list)
		{
			if(typeof tz_list[i] != 'number')
				continue;

			var li = document.createElement('li');

			if(i % 2)
				set_attr(li, 'class', 'even');

			li.innerHTML = '<a href="#" onclick="return !set_tz(' + tz_list[i] + ', \'tzcontent\')"></a>';

			ul.appendChild(li);
		}

		element.appendChild(ul);

		rebuild_tzcontent(element_id);
	}

	function rebuild_tzcontent(element_id)
	{
		var element = document.getElementById(element_id);
		var as = element.getElementsByTagName('a');

		var time_only = (typeof tz_list_short == 'undefined' ? false : (tz_list_short ? true : false));

		for(var i in tz_list)
		{
			if(typeof tz_list[i] != 'number')
				continue;

			var offset = tz_list[i] * 3600 * (-1);
			var new_content = utime2time(gmdate, offset, time_only, true, true) + ', GMT' + (tz_list[i] >= 0 ? '+' : '') + tz_list[i];

			if(as[i].innerHTML != new_content)
			{
				as[i].innerHTML = utime2time(gmdate, offset, time_only, true, true) + ', GMT' + (tz_list[i] >= 0 ? '+' : '') + tz_list[i];
			}
		}
	}

	function gmdate_recount()
	{
		gmdate += 2;

		set_actual_tz('tzactual', tz_default);
		rebuild_tzcontent('tzcontentenv');
	}

	/** Display/Hide element (TV gonet)
	*/
	function display_hide_gonet(id)
	{
		var element = document.getElementById(id);

		if(element.style.display == 'block')
			element.style.display = 'none';
		else
			element.style.display = 'block';
	};

	
	/** Utimate Ajax Object
	 * http://www.hunlock.com/blogs/The_Ultimate_Ajax_Object
	 */
	function ajaxObject(url, callbackFunction, actionTrigger)
	{
		var that = this;
		this.updating = false;
		this.aborting = false;
		this.ajax_async = true;
		this.container = null;

		this.abort = function()
		{
			if(that.updating)
			{
				that.updating = false;
				that.aborting = true;
				that.AJAX.abort();
				that.AJAX = null;
			}
		};

		this.async = function(val)
		{
			that.ajax_async = val ? true : false;
		};

		this.update = function(passData, postMethod)
		{
			if(that.updating)
				return false;

			that.AJAX = null;

			if(window.XMLHttpRequest)
				that.AJAX = new XMLHttpRequest();
			else
				that.AJAX = new ActiveXObject("Microsoft.XMLHTTP");

			if (that.AJAX == null)
				return false;
			else
			{
				that.AJAX.onreadystatechange = function()
				{
					try
					{
						if (that.AJAX.readyState == 4)
						{
							that.updating = false;
							if(!that.aborting)
								if(that.AJAX.status == 200 || that.AJAX.status == 304 || that.AJAX.status == 204 || that.AJAX.status == 1223 || that.AJAX.status == 0)
									that.callback(that.AJAX.status, that.AJAX.getAllResponseHeaders(), that.AJAX.responseText, actionTrigger);
							that.AJAX = null;
						}
					}

					catch(e) {}
				};

				if(typeof passData == 'undefined')
					passData = '';
				that.updating = new Date();

				if (/post/i.test(postMethod))
				{
					var uri = urlCall;
					that.AJAX.open("POST", uri, that.ajax_async);
					if(typeof callbackFunction != 'undefined' && !webkit)
						that.AJAX.setRequestHeader('User-Agent', 'core' + (ie6 ? '/ie6' : ''));
					that.AJAX.setRequestHeader('Accept-Language', '*');
					that.AJAX.setRequestHeader('Accept', '*/*');
					that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					that.AJAX.setRequestHeader("Content-Length", passData.length);
					that.AJAX.send(passData);
				}
				else
				{
					var uri = urlCall + (passData == '' ? '' : ('?' + passData));
					that.AJAX.open("GET", uri, that.ajax_async);
					if(typeof callbackFunction != 'undefined' && !webkit)
						that.AJAX.setRequestHeader('User-Agent', 'core' + (ie6 ? '/ie6' : ''));
					that.AJAX.setRequestHeader('Accept-Language', '*');
					that.AJAX.setRequestHeader('Accept', '*/*');
					that.AJAX.send(null);
				}

				if(!that.ajax_async && that.AJAX != null)
				{
					if(that.AJAX.status == 200 || that.AJAX.status == 304 || that.AJAX.status == 204 || that.AJAX.status == 1223 || that.AJAX.status == 0)
					{
						that.callback(that.AJAX.status, that.AJAX.getAllResponseHeaders(), that.AJAX.responseText, actionTrigger);
						that.AJAX = null;
					}
				}

				return true;
			}
		};

		var urlCall = url;
		this.callback = callbackFunction || function () {};
	};

	/** Set a cookie
	* @param	string	c_name			cookie neme
	* @param	string	value			cookie value
	* @param	integer	expiredays		cookie expires after given days
	* @param	string	[origin = 'self']	document origin, can be ('self'|'parent')
	* @param	string	[path = null]	set document path, default (if null) set current page
	*/
	function cookie_set(c_name, value, expiredays, origin, path, domain)
	{
		if(typeof iframe_external != 'undefined' && iframe_external)
		{
			var url = 'http://www.flashscores.co.uk/x/cookie/write';

			// msie cache/gzip bug
			if(ie)
			{
				var pom = page_utime + '';
				url += '~' + pom.substr(6, 4);
			}

			var ae_cookie = new ajaxObject(url);
			ae_cookie.async(false);
			ae_cookie.update('write=1&' + c_name + '=' + value, 'POST');
		}

		else
		{
			if(typeof origin != 'undefined' && origin == 'parent' && parent)
				var mydoc = parent.document;
			else
				var mydoc = document;

			var exdate = new Date();

			if(value === '')
				expiredays = -365;

			exdate.setDate(exdate.getDate() + expiredays);
			var cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString());

			if(typeof path != 'undefined' && path != null)
				cookie += ';path=' + path;

			if(typeof domain != 'undefined' && domain != null)
				cookie += ';domain=' + domain;

			mydoc.cookie = cookie;
		}
	};

	/** Get a cookie
	* @param	string	c_name			cookie name
	* @param	string	[origin = self]	document origin, can be (self|parent)
	* @return	string					cookie value or null if cookie has not been found
	*/
	function cookie_get(c_name, origin)
	{
		if(typeof iframe_external != 'undefined' && iframe_external)
		{
			if(c_name == 'fs_tza')
				return null;

			var url = 'http://www.flashscores.co.uk/x/cookie/read';

			// msie cache/gzip bug
			if(ie)
			{
				var pom = page_utime + '';
				url += '~' + pom.substr(6, 4);
			}

			var ae_cookie = new ajaxObject(url, cookie_get_remote_response, c_name);
			ae_cookie.async(false);
			ae_cookie.update('read=1&' + c_name + '=1', 'POST');

			if(ae_cookie.container == '-' || ae_cookie.container == '')
				return null;
			else
				return ae_cookie.container;
		}

		else
		{
			if(typeof origin != 'undefined' && origin == 'parent' && parent)
				var mydoc = parent.document;
			else
				var mydoc = document;

			if (mydoc.cookie.length > 0)
			{
				c_start = mydoc.cookie.indexOf(c_name + "=");

				if (c_start != -1)
				{
					c_start = c_start + c_name.length+1;
					c_end = mydoc.cookie.indexOf(";", c_start);

					if (c_end == -1)
						c_end = mydoc.cookie.length;

					return unescape(mydoc.cookie.substring(c_start, c_end));
				}
			}

			return null;
		}
	};

	/** Get remote cookie response
	*/
	function cookie_get_remote_response(r_status, r_headers, r_content, r_trigger)
	{
		if (r_content.length > 0)
			this.container = r_content;
		else
			this.container = '';

	};

	/** Get an attribute of an element
	 * @param	element	an element to set an atribute for
	 * @param	name	the attribute name
	 */
	function get_attr(element, name)
	{
		var attr = '';

		if(element)
		{
			if(ie)
			{
				switch(name)
				{
					default:
						break;

					case 'class':
						attr = element.className;
						break;

					case 'id':
						attr = element.id;
						break;

					case 'rowspan':
						attr = element.rowSpan;
						break;

					case 'colspan':
						attr = element.colSpan;
						break;
				}
			}
			else
				attr = element.getAttribute(name);
		}

		if(!attr)
			attr = '';

		return attr.toString();
	};

	/** Set an attribute of an element
	 * @param	element	an element to set an atribute for
	 * @param	name	the attribute name
	 * @param	content	content of the attribute
	 */
	function set_attr(element, name, content)
	{
		if(ie)
		{
			switch(name)
			{
				default:
					break;

				case 'class':
					element.className = content;
					break;

				case 'rowspan':
					element.rowSpan = content;
					break;

				case 'colspan':
					element.colSpan = content;
					break;
				case 'id':
					element.id = content;
					break;
				
				case 'title':
					element.title = content;
					break;

				case 'type':
					element.type = content;
					break;

				case 'name':
					element.name = content;
					break;
			}
		}
		else
			element.setAttribute(name, content);
	};

	/** Remove attribute on element
	 * @param	object	element	an object element e.g. TD, TR, ...
	 * @param	string	attr	attribute to be removed
	 */
	function rem_attr(element, attr)
	{
		if(ie)
			set_attr(element, attr, '');
		else
			element.removeAttribute(attr);
	};

	function text_append(text, append, unique, last)
	{
		var unique = (typeof unique == 'undefined' || unique == true) ? true : false;
		var last = (typeof last == 'undefined' || last == true) ? true : false;

		var tmp_text = text.toLowerCase();
		var tmp_append = append.toLowerCase();

		if(!tmp_text.match(tmp_append) && tmp_append.indexOf(' ') == 0)
			tmp_append = tmp_append.substr(1);

		if(text.length == 0)
		{
			return append;
		}
		else if(!unique || (unique && tmp_text.match(tmp_append) == null))
		{
			if(last)
				return text + append;
			else
				return append + text;
		}

		return text;
	};

	/** String prototype: Append text (case insensitive)
	* @param	string	append	an append part
	* @param	bool 	[unique = true] append only if append part is not allready included in text
	* @param	bool	[last = true]	if true append last, false append before
	* @return	string	string after to be appended
	*/
	String.prototype.append = function(append, unique, last)
	{
		var unique = (typeof unique == 'undefined' || unique == true) ? true : false;
		var last = (typeof last == 'undefined' || last == true) ? true : false;

		var tmp_text = this.toLowerCase();
		var tmp_append = append.toLowerCase();

		if(!tmp_text.match(tmp_append) && tmp_append.indexOf(' ') == 0)
			tmp_append = tmp_append.substr(1);

		if(this.length == 0)
		{
			return append;
		}
		else if(!unique || (unique && tmp_text.match(tmp_append) == null))
		{
			if(last)
				return this + append;
			else
				return append + this;
		}
	};

	/* Remove text (case insensitive)
	* @param	string	text	a text to be removed from
	* @param	string	remove	a part to be removed
	* @return	string	text	after to be removed
	*/
	function text_remove(text, remove)
	{
		var tmp_text = text.toLowerCase();
		var tmp_remove = remove.toLowerCase();

		// try to remove leading gap
		if(tmp_text.match(tmp_remove) == null && tmp_remove.indexOf(' ') == 0)
			tmp_remove = tmp_remove.substr(1);

		if(tmp_text.match(tmp_remove))
		{
			var index_start = tmp_text.indexOf(tmp_remove);
			var index_stop = tmp_remove.length;

			tmp_remove = text.substr(index_start, index_stop);

			if(tmp_remove.length > 0)
				text = text.replace(tmp_remove, '');
		}

		return text;
	};

	/** fill begining zero if number is less then 10
	* @param	integer	num	number to be corrected
	*/
	function fill_zero(num)
	{
		if(num < 10)
			return '0' + num;
		else
			return num;
	};

	/** Test if element is in array checked by its key
	* @param	array	sa		source array
	* @param	var		key		key to be checked
	* @return	bool	true if element is in array, false otherwise
	*/
	function test_array_key(sa, key)
	{
		if(typeof sa == 'undefined' || typeof sa[key] == 'undefined')
			return false;

		return true;
	};

	/** Test if value exist in array
	 * @param	array	sa		source array
	 * @param	string	val		value to be checked
	 * @return	bool	true if value is in array, false otherwise
	 */
	function test_array_val(sa, val)
	{
		for(var i in sa)
		{
			if(sa[i] == val)
				return true;
		}

		return false;
	};

	/** Try to find value and return its key
	 * @param	array 	sa		source array
	 * @param	string	val		value to be checked
	 * @return	var		key if value is found, false otherwise
	 */
	function get_array_key(sa, val)
	{
		for(var i in sa)
		{
			if(sa[i] == val)
				return i.to_number();
		}

		return false;
	};

	/** Try to find value and return its string key
	 * @param	array 	sa		source array
	 * @param	string	val		value to be checked
	 * @return	var		key if value is found, false otherwise
	 */
	function get_array_string_key(sa, val)
	{
		for(var i in sa)
		{
			if(sa[i] == val)
				return i;
		}

		return false;
	};

	/** Remove an element from array by its key
	* @param	array	sa		source array
	* @param	var		key		remove array key
	* @return	array	affected array
	*/
	function remove_array_key(sa, key)
	{
		var tmp_sa = new Array();
		for(var i in sa)
			if(i != key)
				tmp_sa[i] = sa[i];

		return tmp_sa;
	};

	/** Window prototype: Open help window
	* @url		string	url		url of window
	*/
	window.open_help = function(url)
	{
		var id = Math.floor(Math.random() * 1000);
		return this.open( url, id, 'hotkeys=no, resizable=no, toolbar=no, status=no, dependent=yes, scrollbars=1, width=520, height=500' );
	};

	/** Number prototype: Convert string to number
	* @return	number
	*/
	Number.prototype.to_number = function()
	{
		return this;
	};

	/** String prototype: Convert string to number
	* @return	number
	*/
	String.prototype.to_number = function()
	{
		var pom = this - 0;

		if(isNaN(pom))
			return this;
		else
			return pom;
	};

	/** Convert utime to dbdate
	* @param	integer	utime	unix timestamp
	* @return	string	date in db format (YYYY-MM-DD)
	*/
	function utime2dbdate(utime)
	{
		var tmp = new Date();
		tmp.setTime(utime * 1000);

		return tmp.getFullYear() + '-' + fill_zero((tmp.getMonth() + 1)) + '-' + fill_zero(tmp.getDate());
	};

	/** Convert utime to GMT dbdate
	* @param	integer	utime	unix timestamp
	* @return	string	GMT date in db format (YYYY-MM-DD)
	*/
	function utime2gmt_dbdate(utime)
	{
		var tmp = new Date();
		tmp.setTime(utime * 1000);

		return tmp.getUTCFullYear() + '-' + fill_zero((tmp.getUTCMonth() + 1)) + '-' + fill_zero(tmp.getUTCDate());
	};

	/** Convert dbdate to utime
	* @param	string	date in db format (YYYY-MM-DD)
	* @return	integer	utime
	*/
	function dbdate2utime(dbdate)
	{
		var tmp = new Date();
		dbdate = dbdate.split('-');

		if(dbdate.length == 3)
		{
			tmp.setFullYear(dbdate[0]);
			tmp.setMonth((dbdate[1] - 1));
			tmp.setDate(dbdate[2]);
			tmp.setHours(0);
			tmp.setMinutes(0);
			tmp.setSeconds(0);
			tmp.setMilliseconds(0);

			return tmp.getTime() / 1000;
		}

		return 0;
	};

	/** Convert utime to human time
	* @param	integer utime				unix timestamp
	* @param	integer	offset				gmt offset
	* @param	bool	[time_only = true]	display only time
	* @param	bool	[full_date = false]	display full date DD.MM.YYYY
	* @param	bool	[no_year = false]	do not display year if full date is set
	*
	* @return	string	formated date/time
	*/
	function utime2time(utime, offset, time_only, full_date, no_year)
	{
		var service_time	= new Date(); // for service use

		time_only = (typeof time_only == 'undefined' || time_only) ? true : false;
		full_date = (typeof full_date == 'undefined' || !full_date) ? false : true;
		no_year = (typeof no_year == 'undefined' || !no_year) ? false : true;

		var time = '';

		utime = utime.to_number();
		offset = offset.to_number();

		service_time.setTime((utime + (service_time.getTimezoneOffset() * 60) - offset) * 1000);

		if(!time_only)
			time += fill_zero(service_time.getDate()) + '.' + fill_zero(service_time.getMonth().to_number() + 1) + '.' + (no_year ? '' : (full_date ? service_time.getFullYear() : '')) + ' ';

		time += fill_zero(service_time.getHours()) + ':' + fill_zero(service_time.getMinutes());

		return time;
	};

	/** Odds format
	* @param	float	odds number
	*
	* @return	return formated odds number
	*/
	function odds_format(odds)
	{
		if(odds < 10)
			return odds.toPrecision(3);
		else if(odds < 100)
			return odds.toPrecision(4);
		else
			return odds.toPrecision(5);
	};

	/** Replace parenthesis for Hebrew version
	*
	* @param	string	str string to be converted
	*
	* @return	string	converted string
	*/
	function fix_entities(str)
	{
		return str.replace(/\(/g, "&rlm;(");
	};

	/** Detect client browser
	 * @param	string	browser schortcat (ie|ff)
	 * @return	bool	true|false true if browser match the shortcut
	 */
	function browser_detect(type)
	{
		if(type == 'ie' && navigator.userAgent.match(/MSIE/))
			return true;
		else if(type == 'ie6' && navigator.userAgent.match(/MSIE 6/))
			return true;
		else if(type == 'ie7' && navigator.userAgent.match(/MSIE 7/))
			return true;
		else if(type == 'ff' && navigator.userAgent.match(/Gecko/))
			return true;
		else if(type == 'webkit' && navigator.userAgent.match(/WebKit/))
			return true;

		return false;
	};

	var ie = browser_detect('ie');
	var ie6 = browser_detect('ie6');
	var ie7 = browser_detect('ie7');
	var ff = browser_detect('ff');
	var webkit = browser_detect('webkit');

	var bench_result_start = null;
	var bench_result_stop = null;

	function bench_start(pom)
	{
		return; 
		var tmp_date = new Date();
		typeof pom == 'undefined' ? pom = 'debug' : '';

		if($('body div#bdebug').length == 0)
		{
			$('body').append('<div id="bdebug" style="position: absolute; right: 5px; top: 5px"></div>');
		}

		$('body div#bdebug').append('<div style="debug" id="debug-' + pom + '"></div>');

		bench_result_start = tmp_date.getTime();
	};

	function bench_stop(pom)
	{
		return; 
		var tmp_date = new Date();
		typeof pom == 'undefined' ? pom = 'debug' : '';

		bench_result_stop = tmp_date.getTime();

		$('body div#bdebug div#debug-' + pom).html(pom + ' - time: ' + (bench_result_stop - bench_result_start) + ' [ms]');
	};

	function log(text)
	{
		return;
		if($('body div#bdebug').length == 0)
		{
			$('body').append('<div id="bdebug" style="position: absolute; right: 5px; top: 5px"></div>');
		}

		$('body div#bdebug').append('<div style="debug">' + text + '</div>');
	};
	
	function replace_query_string( url, param, value ) 
	{
		var re = new RegExp("([?|&])" + param + "=.*?(&|$)","i");
		if (url.match(re))
	  		return url.replace(re,'$1' + param + "=" + value + '$2');
		else if (url.indexOf("?") == -1)
	  	return url + '?' + param + "=" + value;
		else
	  	return url + '&' + param + "=" + value;
	};

	function close_lang_box()
	{
		var elm = document.getElementById('lang-box');
		if(elm)
		{
			elm.style.display = 'none';	
			setTimeout('cookie_set( \'lang_box\', 0, 7, \'self\', \'/\' )', 100);
		}
	};

	function close_caption_box()
	{
		var elm = document.getElementById('caption-box');
		if(elm)
		{
			elm.style.display = 'none';	
//			cookie_set( 'caption_box', 0, 6, 'self', '/' );
			setTimeout( 'cookie_set( \'caption_box\', 0, 6, \'self\', \'/\' )', 100);
		}
	};
	
	/** Display/Hide element (calendar)
	*/
	function display_hide(id)
	{
		var element = document.getElementById(id);

		if(element)
			$(element).remove();
		else
			$("#ifmenu-calendar span").append(date_calendar());
	};
	/** resize parent iframe to the content's size
	*/
	function if_resize()
	{ 
		bench_start('resize');

		var if_rame;
		var if_height = $("body#top").height();

		
		// inScore dynamic resize
		if(typeof body_height != 'undefined' && body_height == 'auto')
		{
			try
			{
				if(document.referrer != '')
					parent.location = document.referrer + "#inscore_ifheight_xdc_" + (if_height < 500 ? 500 : if_height);
			}

			catch(e) {}
		}

		if(if_height < 580)
			if_height = 580;

		try
		{
			if(if_rame = parent.document.getElementById('livescoreContent'))
				if_rame.style.height = if_height + 'px';
		}

		catch(e) {}

		try
		{
			var fsi = document.getElementById('fsi');
			var fsi_height = fsi.scrollHeight;

			var top_advert_height = 0;
			var top_advert = document.getElementById('topadvert');
			if(top_advert)
				top_advert_height = top_advert.scrollHeight;

			var lsopat = document.getElementById('lsopat');
			if(lsopat)
				lsopat.style.height = (if_height - fsi_height - top_advert_height + 5) + 'px';
		}

		catch(e) {}

		bench_stop('resize');
	};
