<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

var mailRegex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var dateRegex = /(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])/;

function showLogin()
{
	windowLogin = new jsWindow(PORTAL_URL + '/login', {
							   width: 410, 
							   height: 220, 
							   blockBackground: true,
							   identifier: 'loginFloater',
							   title: 'Grupo TVCABLE - Login',
							   positionX:'right',
							   positionY:'top',
							   onClose: function(){ activateFlash();}
							   });
	deactivateFlash();	
}

function closeLogin()
{
	parent.windowLogin.closeWindow();
}

function showTerminos()
{
	windowLogin = new jsWindow(PORTAL_URL + '/terminos', {
							   width: 510, 
							   height: 610, 
							   blockBackground: true,
							   identifier: 'thermsFloater',
							   title: 'Grupo TVCABLE - T&eacute;rminos de uso',
							   positionX:'center',
							   positionY:'middle',
							   onClose: function(){ activateFlash();}
							   });
	deactivateFlash();	
}


function deactivateFlash()
{
	try{Element.show('img_main');}catch(e){};
	try{Element.hide('fla_main');}catch(e){};
}

function activateFlash()
{
	try{Element.hide('img_main');}catch(e){};
	try{Element.show('fla_main');}catch(e){};
}

function setCalendar( inputField, trigger)
{
	Calendar.setup(
	{
		inputField : inputField,
		ifFormat : "%Y-%m-%d",
		button : trigger
	}
	);
}

function redirectUrl(portalName)
{
	location.href = FULL_BASE_URL + '/' + portalName;
}

function TVC_SWF_DoFSCommand(command, args) 
{  
	var myFlashObj = InternetExplorer ? TVC_SWF : document.TVC_SWF;
	if (command == "redirect") 
	{ 
		redirectUrl(args);
	}
}

function blindUpDown(element, buttonId)
{
	var button = $('buttonId');
	Effect.toggle(element, 'blind');
	Element.toggleClassName(button,'close');
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&   navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');  
    document.write('on error resume next \n');  
    document.write('Sub TVC_SWF_FSCommand(ByVal command, ByVal args)\n');  
    document.write(' call TVC_SWF_DoFSCommand(command, args)\n');  
    document.write('end sub\n');  
    document.write('</SCRIPT\> \n');
}

function GTVC_FLASH_DoFSCommand(command, args)
{
	//var myFlashObj = InternetExplorer ? GTVC_FLASH : document.GTVC_FLASH;
	if (command == "close_ad_tvc") 
	{ 
		Element.hide('div_gtvc_flash');	
	}
}

function validate_emails(forma)
{	
	var forma = $(forma);
	var fields = forma.getElementsByClassName('email_field');
	var response = true;
	fields = $A(fields);
	
	fields.each(function(field)
	{
		var value = field.value;
		
		if( !value.blank() )
		{
			if( !value.match(mailRegex))
			{
				response = false;
			}
		}
	});
	
	return response;
}

function validate_dates(forma)
{	
	var forma = $(forma);
	var fields = forma.getElementsByClassName('date_field');
	var response = true;
	fields = $A(fields);
	
	fields.each(function(field)
	{
		var value = field.value;
		
		if( !value.blank() )
		{
			if( value != '0000-00-00' )
			{
				if( !value.match(dateRegex))
				{
					response = false;
				}
			}
		}
	});
	
	return response;
}

-->
