
function OpenWindow(url, name, options)
{
	window.open(url, name, options);
	return;
}

function OpenPage(url)
{
	window.open(url, "", "channelmode=no,directories=no,fullscreen=no,location=no,menubar=yes,resizable=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no");
}


function OpenNormalPage(url)
{
	window.open(url, "", "");
}


function openModalDialog (url, width, height)
{
    if (navigator.userAgent.toLowerCase().indexOf('msie') > -1)
        window.showModalDialog(url, window, 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;center:yes;help:no;scroll:no;status:no');
    else
        window.open(url, 'ModalDialog', 'width=' + (width - 6) + ',height=' + (height - 26));
}

function OpenPopUp(url, w, h)
{
	return OpenWindow(url, 'popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h);
}

function OpenPopUpWithScroll(url, w, h)
{
	return OpenWindow(url, 'popup', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h);
}

function OpenImagePopUp(url, w, h)
{
	url = HT_URL + '/FrontEnd/Pages/ShowImage.aspx?ImagePath=' + escape(url);
	
	return OpenWindow(url, 'popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h);
}


function OpenPopUpResizable(url, w, h)
{
	return OpenWindow(url, 'popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=' + w + ',height=' + h);	
}

function OpenPopUpParams(url, params)
{
	return OpenWindow(url, 'popup', params);	
}


function ActivateCombos()
{

	var combo1 = document.getElementById('ShowBannerDestaque1_AuthoringModeControlsContainer_cboBannerType');
	
	if(combo1!=null){
	
		document.getElementById('ShowBannerDestaque1_AuthoringModeControlsContainer_cboBannerType').disabled = !document.getElementById('ShowBannerDestaque1_AuthoringModeControlsContainer_chkActive').checked;													
		document.getElementById('ShowBannerDestaque1_AuthoringModeControlsContainer_cboTypeOption').disabled = !document.getElementById('ShowBannerDestaque1_AuthoringModeControlsContainer_chkActive').checked;	

		document.getElementById('ShowBannerDestaque2_AuthoringModeControlsContainer_cboBannerType').disabled = !document.getElementById('ShowBannerDestaque2_AuthoringModeControlsContainer_chkActive').checked;													
		document.getElementById('ShowBannerDestaque2_AuthoringModeControlsContainer_cboTypeOption').disabled = !document.getElementById('ShowBannerDestaque2_AuthoringModeControlsContainer_chkActive').checked;	
		
	}
}
function ActivateComboCategory()
{
	var combo = document.getElementById('CategoryFilter_AuthoringModeControlsContainer_cboCategory1');
	if(combo!=null){
	
		document.getElementById('CategoryFilter_AuthoringModeControlsContainer_cboCategory1').disabled = !document.getElementById('CategoryFilter_AuthoringModeControlsContainer_chkActive1').checked;
		
	}
}

function ActivateTextboxExternal()
{
	var textbox = document.getElementById('ShowExternalPaginate_AuthoringModeControlsContainer_checkBoxLink');
	if(textbox!=null){
		document.getElementById('ShowExternalPaginate_AuthoringModeControlsContainer_txtTextoLink').disabled = !document.getElementById('ShowExternalPaginate_AuthoringModeControlsContainer_checkBoxLink').checked;
		if(document.getElementById('ShowExternalPaginate_AuthoringModeControlsContainer_checkBoxLink').checked==false){
			document.getElementById('ShowExternalPaginate_AuthoringModeControlsContainer_txtTextoLink').value='';
		}
	}
}

function redirectMenu(url){
	window.location.href=url;
}

function OpenFlash(urlToOpen,wd,hg)
{
	var url = HT_URL + '/FrontEnd/Pages/OpenFlash.aspx?url=' + urlToOpen;
	window.open( url , "" , "width=" + wd + " , height=" + hg + ", channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no");
}

//--------------------------------------------------


function onKeyPressLength(text,maxlength) {
     if(text.value.length>=maxlength) {          
          return false;
     } else {
          return true;
     }    
}

function onChangeLength(text,maxlength) {
     if(text.value.length >= maxlength) {
		  text.value = text.value.substring(0,maxlength);
          return false;
     } else {
          return true;
     }    
}

function HideShowDiv(){

	//Get the div
	var div = document.getElementById("ShowLogin_AuthoringModeControlsContainer_divShowLogin");
	var chkShowLogin = document.getElementById("ShowLogin_AuthoringModeControlsContainer_chkShowLogin");

	if( (div!=null) && (chkShowLogin != null) ){
	
		if(!chkShowLogin.checked){
			div.disabled = true;
		}else{
			div.disabled = false;		
		}
		
	}

	
}


		
