// JavaScript Document
function GetElement(element)

	{

	return document.getElementById(element);

	}

	

function setValue(element,value)

	{

	if(GetElement(element) && value!=null && value!='undefined')

		GetElement(element).value = value;

	}

	

function __doOpenlinkwindow(site)

	{

	window.open(site)

	}

	

function __ContentOpenPreview(url,samplepath)

	{

	}

	

function __doErrorprocess(e)

	{

	alert(e.description);

	}

	

function __clearSearchForm(prefix)

	{

	setValue(prefix+'CurrentPage','');

	setValue(prefix+'SearchParam','');

	}

	

function __goPreview(content)

	{

	childWindow=window.open('content/previewsound.aspx'+

	'?'+content,'PreviesSound',

	'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=314,height=175' );

	childWindow.opener = self;

	}



function __goSmsmessage()

	{

	childWindow=window.open('content/popsms.aspx', 'SmsMessage', 

	'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=145,height=340' );

	childWindow.opener =self;

	}



function __goBanner(surl,bnewwindow)

	{

	if(bnewwindow)

		{

		childWindow = window.open('Administradores/showBanner.aspx?gourl='+surl,'IdeasBanner');

		childWindow.opener = self;

		}

	else

		{

		document.location.href = document.location.href + '?gourl=' + surl;

		}

	}



function ClearActions()

	{

	alert('');

	}

	

function __doOpenpopup1(sname, scontent, sheight, sstyle, saditionalparams)

	{

	if(sstyle==null || sstyle=='undefined')

		return;

	if(saditionalparams==null || saditionalparams=='undefined')

		saditionalparams ='';

		

	try	

		{

		window.open('showpopup1.aspx'+'?Content='+scontent +

		'&style='+sstyle + '&windowname='+sname +

		saditionalparams, 'Popupestilo1',

		'toolbar=0,scrollbars=2,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=400,height=' + sheight );	

		}

	catch(e)

		{

		__doErrorprocess(e);

		}

	}



function __doOpenpopupResizable(sname,scontent, sheight,swidth,sstyle,saditionalparams)

	{

	if(sstyle==null || sstyle=='undefined')

		return;

	if(saditionalparams==null || saditionalparams=='undefined')

		saditionalparams ='';

	try

		{

		window.open('showpopup1.aspx' + '?Content='+scontent +

		'&style='+sstyle + '&windowname='+sname +

		saditionalparams, 'Popupestilo1', 

		'toolbar=-1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=' + swidth + ',height=' + sheight );	

		}

	catch(e)

		{

		__doErrorprocess(e);

		}

	}



function __doOpenpopupResizableParameters(sname,scontent, sheight,swidth,sstyle,saditionalparams)

	{

	if(sstyle==null || sstyle=='undefined')

		return;

	if(saditionalparams==null || saditionalparams=='undefined')

		saditionalparams ='';

	try

		{

		window.open('showpopup1.aspx'+'?Content='+scontent +

		'&style='+sstyle +

		//'&phoneID='+ phoneID +

		//'&serviceID='+ serviceID +

		'&windowname='+sname + saditionalparams,

		'Popupestilo1', 'toolbar=-1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=' + swidth + ',height=' + sheight);	

		}

	catch(e)

		{

		__doErrorprocess(e);

		}

	}



function __goContentpopupequipo(sname,phoneid,ficha,funcion,sreferencia,location)

	{

	if(ficha=='undefined' || !ficha)

		ficha='';

	if(funcion=='undefined' || !funcion)

		funcion='';

	if(location=='undefined' || !location)

		location = 'content/popequipo.aspx';



	window.open(location + '?phoneid='+phoneid +

	'&ficha='+ficha + '&funcion='+funcion+

	'&referencia=' + sreferencia, 'PopupEquipo',

	'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=585,height=360' );	

	}



function __doOpenpopup(sname,scontent)

	{

	window.open('showpopup1.aspx' + '?Content='+scontent +

	'windowname=' + sname, 'Popupestilo1', 

	'toolbar=0,scrollbars=-1,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0');	

	}



function __doEvallink(slink)

	{

	var slocal = String(slink);

	slocal = slocal.toLowerCase();

	

	if(slocal.indexOf('java')!=-1)

		eval(slink);

	}



function SetValues(objName,value)

	{

	if(objName=='IdMenuNivel1')

		{

		setValue('IdMenuNivel2','');

		setValue('IdMenuNivel3','');

		setValue('IdMenuNivel4','');

		}

	else if(objName=='IdMenuNivel2')

		{

		setValue('IdMenuNivel4','');

		setValue('IdMenuNivel3','');

		}

	else if(objName=='IdMenuNivel3')

		{

		setValue('IdMenuNivel4','');

		}

	

	GetElement(objName).value = value;

	}

	

function goHome()

	{

	setValue('IdMenuNivel1','');

	setValue('IdMenuNivel2','');

	setValue('IdMenuNivel3','');

	setValue('IdMenuNivel4','');

	document.frmHome.submit();

	}



function goContent

	(

	nivel1Value,//1

	nivel2Value,//2

	nivel3Value,//3

	nivel4Value,//4

	phoneID,//5

	serviceID,

	serviceID2

	)

	{

	setValue('IdMenuNivel1', nivel1Value);

	setValue('IdMenuNivel2', nivel2Value);

	if(nivel3Value == null || nivel3Value == 'undefined')

		nivel3Value = '';

		

	setValue('IdMenuNivel3', nivel3Value);

	setValue('IdMenuNivel4', nivel4Value);

	setValue('phoneID', phoneID);

	setValue('serviceID', serviceID);

	setValue('serviceID2', serviceID2);

	document.frmHome.submit();

	}

	

function __goContentprintlist()

	{

	var oBusc = /telact/i;

	for(var i = 0;i < document.forms[0].elements.length;i++)

		{

		var oNomCon = new String();

		oNomCon = document.forms[0].elements[i].id;

		if(oNomCon.search(oBusc) != -1)

			{

			break;

			}

		}

		

	if(document.forms[0].elements['phoneID'].value=='' || document.forms[0].elements[oNomCon].value == 1)

		alert('Debes seleccionar un telefono primero');

	else

		{

		childWindow=window.open('content/queryresults.aspx'+ '?query=printlist&listname='+ 

		document.forms[0].elements['serviceID'].value  +'-'+ document.forms[0].elements['phoneID'].value + '-list',

		'Impresiondelistados', 'toolbar=0,scrollbars=2,location=0,statusbar=0,menubar=0,resizable=1,left=0,top=0,width=640,height=480');

		}

	}

	

function __PopupEmo(url)

	{

	window.open(url, 'Emotitext', 

	'toolbar=0,scrollbars=-1,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width=650,height=500');	

	}

function __goPopUp(surl,bnewwindow,swidth, sheight)

	{

	//alert('entro a goPopUp');

	if(bnewwindow)

		{

		childWindow = window.open('../Administradores/showBanner.aspx?gourl='+surl,'ComcelBanner', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=0,top=0,width='+swidth+',height='+sheight+'');

		childWindow.opener = self;

		}

	else

		{

		document.location.href = document.location.href + '?gourl=' + surl;

		}

	}