	

function InitPagingScript(nPageNum){
	var hdnSearch = document.getElementById('hdnIsSearchClicked');
	if ( hdnSearch != null && hdnSearch != 'undefined' )
		hdnSearch.value='false';
	document.getElementById('hdnPageNum').value=nPageNum;
}

function CheckKey(){		
	if (window.event.keyCode == 13){
		var hdnIsSearchCl = document.getElementById('hdnIsSearchClicked')
		if ( hdnIsSearchCl != 'undefined' && hdnIsSearchCl != null )
			document.getElementById('hdnIsSearchClicked').value = 'true';

		if (document.forms.length > 0){
			var frm = document.forms[0];
			frm.submit();
		}
	}
}

function OpenVisualization(sURL) {
	popup(sURL, '', 816, 671, 50, 50, "yes", "yes", "yes");
}

function popup(url, wname, wid, hei, lft, tp, hasScroll, hasMenu, isResizable){
	param = "toolbar=no,menubar=" + hasMenu + ",scrollbars="+hasScroll+",resizable=" + isResizable + ",status=no,location=no";
	
	var newWindow;
	
	if ( document.layers ){
		if ( wid != '' && hei != '' )
			newWindow = window.open(url, wname, param + ',height='+hei+',width='+wid+',screenX='+lft+',screenY='+tp);
		else
			newWindow = window.open(url, wname, param + ',screenX='+lft+',screenY='+tp);
	}else{
		if ( wid != '' && hei != '' )
			newWindow = window.open(url, wname, param + ',height='+hei+',width='+wid+',left='+lft+',top='+tp);
		else
			newWindow = window.open(url, wname, param + ',left='+lft+',top='+tp);
	}
	
	newWindow.focus();
}

function GetContentHTML( divName, hdnName, oEditor )
{
	var oEditor = FCKeditorAPI.GetInstance(oEditor) ;
	
	document.getElementById(divName).innerHTML=oEditor.GetXHTML(false);
	document.getElementById(hdnName).value = GetInnerText(document.getElementById(divName)); //document.getElementById(divName).innerText;
	return true;
}

function GetContentHTMLAll(){
	GetContentHTML( 'divContentPlainTextEng', 'hdnContentPlainTextEng' , 'fckContentEng');
	GetContentHTML( 'divContentPlainTextSp', 'hdnContentPlainTextSp' , 'fckContentSp' );
	GetContentHTML( 'divContentPlainTextCat', 'hdnContentPlainTextCat' , 'fckContentCat' );
	
	return true;
}

function GetContentHTMLAllNews(){
	GetContentHTML( 'divLongDescPlainTextEng', 'hdnLongDescPlainTextEng' , 'fckLongDescEng');
	GetContentHTML( 'divLongDescPlainTextSp', 'hdnLongDescPlainTextSp' , 'fckLongDescSp' );
	GetContentHTML( 'divLongDescPlainTextCat', 'hdnLongDescPlainTextCat' , 'fckLongDescCat' );
	
	return true;
}

function GetInnerText(el) {
	var txt = '', i;
	for (i = el.firstChild; i; i = i.nextSibling) {
		if (i.nodeType == 3)
			txt += i.data;
		else if (i.nodeType == 1)
			txt += GetInnerText(i);
	}
	return txt;
}

function changeBack(sTd, isOver){

	var objMenuItem = document.getElementById(sTd);
	if ( objMenuItem != null && objMenuItem != 'undefined' ){
		if (isOver)
			if (sTd == 'ucHeader_tdHome')
				objMenuItem.className = 'tdHome_over';
			else if (sTd == 'ucHeader_tdOrchestra')
				objMenuItem.className = 'tdOrchestra_over';
			else
				objMenuItem.className = 'top_menu_over';
		else
			if (sTd == 'ucHeader_tdHome')
				objMenuItem.className = 'tdHome';
			else if (sTd == 'ucHeader_tdOrchestra')
				objMenuItem.className = 'tdOrchestra';
			else
				objMenuItem.className = '';
	}
}

