//RadGridGetDataItems('ctl00_body_itemsGrid')
//RadGridGetElements('ctl00_body_itemsGrid', 'LinkButton1')
//$find('ctl00_body_itemsGrid').get_masterTableView().get_dataItems()[0].findElement('LinkButton1').innerHTML
function centerUpdatePanel(sender, eventArgs) {
	try {
		//if (IsIE(6)) {
			putInCenter('pnlLoading');
		//}
	}
	catch (e) { alert(e) }
}
function IsIE(version) {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
		var ieversion = new Number(RegExp.$1) // capture x.x portion and store as a number
		//if (ieversion >= version)
		if (ieversion == version) return true;
		//	if (ieversion>=7)
		//	document.write("You're using IE7.x")	
	}
	return false;
}
function putInCenter(id) {
    var myDiv = document.getElementById(id);
    var rootDiv = document.getElementById('root');
	    
	if (rootDiv == null) {
	    if (myDiv != null)
	        myDiv.style.left = Math.round(myDiv.clientWidth / 2) + 'px';
	    //return;
	}
	else {
	    if (rootDiv.clientWidth == 0) {
	        //alert(rootDiv.parentNode.clientWidth);
	        myDiv.style.left = '49%';
	    }
	    else
	        myDiv.style.left = Math.round(rootDiv.clientWidth / 2 - myDiv.clientWidth / 2) + 'px';
	}

	myDiv.parentNode.style.display = 'block';
	myDiv.style.top = 150 + 'px';
}
function getCompHeight(element) {
	if (element.currentStyle)
		var y = element.currentStyle['height'];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(element, null).getPropertyValue('height');
	return y;
}
function $el(id) 
{
	return document.getElementById(id);
}
function $val(id) {
	try {
		return $el(id).value;
	} catch (e) {
	alert("the element id='" + id + "' is null");
	}
}
function StartPlayerByDivID(id) {
	var index = id.indexOf('_');
	var fileId = id.substring(0, (index == -1 ? id.length : index - 1));
	var flashvars = {};
	var params = {};
	params.allowscriptaccess = "always";
	params.allowfullscreen = "true";
	params.wmode = "transparent";
	swfobject.embedSWF('/v/' + fileId + '.aspx', 'div_flvVideoDiv' + id, width, height, "9.0.0", "", flashvars, params);
}

function StartPlayer(divId, videoId, width, height) {

	if (width == null)
		width = 320;
	if (height == null)
		height = 260;

	var flashvars = {};
	var params = {};
	params.allowscriptaccess = "always";
	params.allowfullscreen = "true";
	params.wmode = "transparent";

	swfobject.embedSWF('/v/' + videoId + '.aspx', divId, width, height, "9.0.0", "", flashvars, params);
}


function SelectInputContent(input) {
	input.focus();
	input.select();
}
