
var MModal={parent:"body",windowId:null,classmodal_Window:null,classmodal_Overlay:null,classCloseModal:null,ancho:null,alto:null,content:null,close:function()
{$('.'+this.classmodal_Window).remove();$('.'+this.classmodal_Overlay).remove();},open:function()
{var modal='<div class="'+this.classmodal_Overlay+'"></div>';modal+='<div id="'+this.windowId+'" class="'+this.classmodal_Window+'" style="width:'+this.ancho+'px;height:'+this.alto+'px;margin-top:-'+(this.alto/2)+'px;margin-left:-'+(this.ancho/2)+'px;">';modal+=this.content;modal+='</div>';$(this.parent).append(modal);$('.'+this.classCloseModal).click(function(){MModal.close();});$('.'+this.classmodal_Overlay).click(function(){MModal.close();});}}
function MostrarModal(windowId,classmodal_Window,classmodal_Overlay,classCloseModal,ancho,alto,content)
{MModal.windowId=windowId;MModal.classmodal_Window=classmodal_Window;MModal.classmodal_Overlay=classmodal_Overlay;MModal.classCloseModal=classCloseModal;MModal.alto=alto;MModal.ancho=ancho;MModal.content=content;MModal.open();}
function MMSignIn(txtEml,txtPsd,txtRmb,txtOk,txtCnl,txtFgt,inpUsr,inpPsd)
{var signInContent='<iframe src="/Profiles/frmSignIn.aspx" frameborder="0" border="0" allowtransparency="true" cellspacing="0" scrolling="no" width="100%" height="160px" marginwidth="0" marginheight="0"></iframe>'
MostrarModal('mSignIn','modal_Window_Small','modal_Overlay','modal_Close',275,150,signInContent);$('#txtUserNameSignIn').focus();}
function MMMsg(msg,txtBtn)
{var modalMsgContent='<div>'+'<div style="width:198px;height:35px;font-size:11px;text-align:center;">'+'<table style="width:198px;height:40px;"><tr><td>'+msg+'</td></tr></table>'+'</div>'+'<div style="width:198px;height:30px;text-align:center;">'+'<input type="button" class="btn_Black_60" id="btnAccept" value="'+txtBtn+'" onclick="MModal.close();" />'+'</div>'+'</div>';MostrarModal('mMsg','modal_Window_Small','modal_Overlay','modal_Close',198,70,modalMsgContent);}
function MLightBox(idImg,titulo)
{var ancho=600;var alto=600;var lightboxContent='<div>'+'<div>'+'<img src= "/RenderImage.ashx?id='+idImg+'&class=N&original=false&crop=false&height='+ancho+'&width='+alto+'"/>'+'</div>'+'<div>'+'<span>'+titulo+'</span>'+'</div>'+'<div class="modal_Close">'+'<span>CERRAR</span>'+'</div>'+'</div>';MostrarModal('mLB','modal_Window','modal_Overlay_Black','modal_Close',ancho,alto,lightboxContent);}
var actImgHeader=0;function moveImgGalleryHeader(divCnt,isNext,topImg)
{$('#'+divCnt).prev().find('input').attr('disabled','true');$('#'+divCnt+' > div').eq(actImgHeader).animate({opacity:'0'},1000);setTimeout('$(\'#'+divCnt+' > div\').eq('+actImgHeader+').css(\'display\', \'none\')',1000);if(isNext)
if(actImgHeader<topImg)actImgHeader=actImgHeader+1;else actImgHeader=0;else
if(actImgHeader>0)actImgHeader=actImgHeader-1;else actImgHeader=topImg;setTimeout('$(\'#'+divCnt+' > div\').eq('+actImgHeader+').css(\'display\', \'block\')',1000);setTimeout('$(\'#'+divCnt+' > div\').eq('+actImgHeader+').animate ({opacity:\'1\'}, 1000)',1000);setTimeout('$(\'#'+divCnt+'\').prev().find(\'input\').removeAttr(\'disabled\')',1000);;}
var actImg=0;function moveImgGallery(divCnt,isNext,topImg)
{$('#'+divCnt).prev().find('input').attr('disabled','true');$('#'+divCnt+' > div').eq(actImg).animate({opacity:'0'},1000);setTimeout('$(\'#'+divCnt+' > div\').eq('+actImg+').css(\'display\', \'none\')',1000);if(isNext)
if(actImg<topImg)actImg=actImg+1;else actImg=0;else
if(actImg>0)actImg=actImg-1;else actImg=topImg;setTimeout('$(\'#'+divCnt+' > div\').eq('+actImg+').css(\'display\', \'block\')',1000);setTimeout('$(\'#'+divCnt+' > div\').eq('+actImg+').animate ({opacity:\'1\'}, 1000)',1000);setTimeout('$(\'#'+divCnt+'\').prev().find(\'input\').removeAttr(\'disabled\')',1000);;}
function FKeyPressed(object,e,idAscii,objFunc,kE)
{var objKey;if(window.event)objKey=window.event.keyCode;else if(e)objKey=e.which;if(objKey==idAscii)
{objFunc(object);if(kE)rmvEvent(e);}}
function rmvEvent(e)
{if(!e)
var e=window.event;if(e.preventDefault)
e.preventDefault();else
{e.cancelBubble=true;e.returnValue=false;e.keyCode=0;}}
var timeToMove;function waitToExecute(fn,t)
{if(timeToMove)
clearTimeout(timeToMove)
timeToMove=setTimeout(fn,t)}