
		document.onselectstart=new Function ("return false;");	
		document.onmousedown=new Function ("return false;");		
		document.oncontextmenu=new Function ("return false;");	

DynWeb = {		

	showAjaxBox: function(sTitle,sUrl)
	{
		Shadowbox.open({
		    content:    sUrl,
		    player:     "img",
		    title:      sTitle    
		});
    },
    
    showFoto: function(sTitle,sImg)
    {
		DynWeb.showAjaxBox(sTitle,sImg);		
    },
    
    showBox: function(oThis)
    {						
		hs.outlineType = 'rounded-white';
		hs.dimmingOpacity = 0.5;		
		hs.align = 'center';		
		/*
		hs.registerOverlay({
			html: '<div class="closebutton" onclick="return hs.close(this)" title="Cerrar"></div>',
			position: 'top right',
			useOnHtml: true,
			fade: 2 // fading the semi-transparent overlay looks bad in IE
		});
		*/
		return hs.expand(oThis,{wrapperClassName: 'borderless floating-caption', dimmingOpacity: 0.75, align: 'center'});
    },

	getHTTPObject: function()
	{
		var xmlhttp;
		/*@cc_on
		@if (@_jscript_version >= 5)
		   try {
		      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		   } catch (e) {
		      try {
		         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		      } catch (E) { xmlhttp = false; }
		   }
		@else
		xmlhttp = false;
		@end @*/
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		   try {
		      xmlhttp = new XMLHttpRequest();
		   } catch (e) { xmlhttp = false; }
		}
		return xmlhttp;
	},
	
	compiler: function(http,url,params){
		if (http) {
			http.open("post", url, true);
			http.onreadystatechange = function (){										
				if (http.readyState == 4) {													
					if (http.status == 200) {																
						if (http.responseText.indexOf('invalid') == -1) {							
							returnCode=http.responseText;														
							eval(returnCode);
						}
					}
				}
			};			
			http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			http.setRequestHeader("HTTP_DynWeb","application/x-www-form-urlencoded");			
			http.send("ms=" + new Date().getTime() + "&" + params);
		}
		return true;
	},
	
	isIE6: function()
	{
		return (typeof document.body.style.maxHeight == "undefined");
	},
	
	screen:
	{
		show: function(iWidth,iHeight,sContent)
		{			
			var oScreen = document.getElementById('screen');
			var oBackScreen = document.getElementById('backScreen');
			var oTopScreen = document.getElementById('topScreen');		
			var oScreenContent = document.getElementById('screenContent');							
			
			if (!!DynWeb.isIE6())
			{
				oScreen.style.position='absolute';
				document.body.style.overflow='hidden';	
			}
				
			oTopScreen.style.width = iWidth + 'px';
			oTopScreen.style.height = iHeight + 'px';												
						
			oScreenContent.innerHTML = sContent;
						
			setTimeout(function(){DynWeb.screen.fadeIn(oScreen,oBackScreen,oTopScreen,0);},10);
									
		},
		
		fadeIn:function(oScreen,oBackScreen,oTopScreen,iOpacity)
		{
			if (!!oBackScreen.filters)
			{											
				oBackScreen.style.filter='alpha(opacity=' + iOpacity + ')';																				
			}else{				
				oBackScreen.style.opacity = (iOpacity/100);
				oBackScreen.style.MozOpacity = (iOpacity/100);
			}
			
			if (iOpacity==50)
			{
				oTopScreen.style.display = 'block';
			}else{
				oScreen.style.display = 'block';
				setTimeout(function(){DynWeb.screen.fadeIn(oScreen,oBackScreen,oTopScreen,(iOpacity+5));},10);
			}
		},
		
		hide: function()
		{
			var oScreen = document.getElementById('screen');						
			var oBackScreen = document.getElementById('backScreen');
			var oTopScreen = document.getElementById('topScreen');		
			
			if (!!DynWeb.isIE6())
			{
				document.body.style.overflow='visible';
			}
			
			oTopScreen.style.display = 'none';
			
			setTimeout(function(){DynWeb.screen.fadeOut(oScreen,oBackScreen,oTopScreen,50);},10);
		},
		
		fadeOut:function(oScreen,oBackScreen,oTopScreen,iOpacity)
		{
			if (!!oBackScreen.filters)
			{											
				oBackScreen.style.filter='alpha(opacity=' + iOpacity + ')';																				
			}else{				
				oBackScreen.style.opacity = (iOpacity/100);
				oBackScreen.style.MozOpacity = (iOpacity/100);
			}
			
			if (iOpacity==0)
			{
				oScreen.style.display = 'none';				
			}else{
				setTimeout(function(){DynWeb.screen.fadeOut(oScreen,oBackScreen,oTopScreen,(iOpacity-5));},10);
			}
		}
				
	},			
	
	functions:
	{			
		
		addFavorite: function(sTitle , sUrl)
		{
			if (window.sidebar){
				window.sidebar.addPanel(sTitle, sUrl,'');
			}else if( window.external ){
				window.external.AddFavorite(sUrl, sTitle);
			}else if(window.opera && window.print) {
				return true; 
			}
		},
		
		contact: function()
		{
			sContact = 'consultas'
			sDomain = 'mijardinrodante.com.ar'
			document.getElementById('FRM_contact').src='mailto:' + sContact + '@' + sDomain;
		},
		
		showMenu: function(sMenu)
		{
			var oMenus = document.getElementById('menu').getElementsByTagName('DIV');			
			for(i=0;i<oMenus.length;i++)
			{				
				oMenus[i].className = '';
				var oMenuItems = document.getElementById('menuItems_' + oMenus[i].id.replace('menu_',''));
				oMenuItems.style.display = 'none';
			}
			
			var oMenu = document.getElementById('menu_' + sMenu);
			oMenu.className = 'selected';

			var oMenuItem = document.getElementById('menuItems_' + sMenu);			
			oMenuItem.style.display = 'block';
		},						
		
		shareCurso: function(sTitle,sLink)
		{
			var sContent ='';
			sContent+='<div class="titulo">Envíar el curso a un colega</div>';
			sContent+='<div class="subtitulo">'+ sTitle +'</div>';
			sContent+='	<br/>';
			sContent+='	Ingrese su nombre y apellido';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_emisor" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';			
			sContent+='	Ingrese su correo electrónico';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_emisor_correo" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	Ingrese el nombre y apellido de su colega';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_receptor" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	Ingrese el correo electrónico de su colega';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_receptor_correo" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	<input type="button" name="enviar" id="enviar_colega_enviar" value="Enviar" class="button" onclick="DynWeb.functions.shareCursoSend(\'' + escape(sTitle) + '\',\'' + escape(sLink) + '\');"/>';
			sContent+='	<input type="button" name="cancelar" id="enviar_colega_cancelar" value="Cancelar" class="button2" onclick="DynWeb.screen.hide();"/>';			
			DynWeb.screen.show(400,360,sContent);			
		},
		
		shareCursoSend: function(sTitle,sLink)
		{
			var sUrl = document.location.href.toLowerCase().replace('/cursos/','/enviar_cursos/');
			var sParams ='';
			sParams += 'emisor=' + escape(document.getElementById('enviar_colega_emisor').value);			
			sParams += '&emisor_correo=' +  escape(document.getElementById('enviar_colega_emisor_correo').value);
			sParams += '&receptor=' +  escape(document.getElementById('enviar_colega_receptor').value);
			sParams += '&receptor_correo=' +  escape(document.getElementById('enviar_colega_receptor_correo').value);
			var httpWindow = DynWeb.getHTTPObject();
			DynWeb.compiler(httpWindow,sUrl,sParams);						
			
			document.getElementById('enviar_colega_enviar').style.display = 'none';			
		},
		
		joinCurso: function(sTitle,sId)
		{
			var sContent ='';
			sContent+='<div class="titulo">Inscribirse al curso</div>';
			sContent+='<div class="subtitulo">'+ sTitle +'</div>';
			sContent+='	<br/>';
			sContent+='	Por favor confirme la inscripción al curso.';									
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	<input type="button" name="enviar" id="enviar_colega_enviar" value="Confirmar" class="button" onclick="DynWeb.functions.joinCursoSend(\'' + escape(sTitle) + '\',\'' + escape(sId) + '\');"/>';
			sContent+='	<input type="button" name="cancelar" id="enviar_colega_cancelar" value="Cancelar" class="button2" onclick="DynWeb.screen.hide();"/>';			
			DynWeb.screen.show(400,360,sContent);			
		},
		
		joinCursoSend: function(sTitle,sId)
		{
			var sUrl = document.location.href.toLowerCase().replace('/cursos/','/inscripcion_cursos/');
			var sParams ='';			
			var httpWindow = DynWeb.getHTTPObject();
			DynWeb.compiler(httpWindow,sUrl,sParams);						
			
			document.getElementById('enviar_colega_enviar').style.display = 'none';			
		},
		
		login: function(sSite)
		{
			var sContent ='';
			sContent+='<div class="titulo">Identifíquese en el sistema</div>';
			sContent+='<div class="subtitulo">Ingrese su usuario y contraseña</div>';
			sContent+='	<br/>';
			sContent+='	Usuario';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="usuario" value="" maxlength="20" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';			
			sContent+='	Contraseña';
			sContent+='	<br/>';
			sContent+='	<input type="password" class="input" id="clave" value="" maxlength="20" size="60"/>';			
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	<input type="button" name="enviar" id="enviar_colega_enviar" value="Identificarse" class="button" onclick="DynWeb.functions.loginSend(\'' + sSite + '\');"/>';
			sContent+='	<input type="button" name="cancelar" id="enviar_colega_cancelar" value="Cancelar" class="button2" onclick="DynWeb.screen.hide();"/>';			
			DynWeb.screen.show(400,360,sContent);			
		},
		
		loginSend: function(sSite)
		{
			var sUrl = sSite + 'identificarse';			
			var sParams ='';			
			sParams += 'usuario=' +  escape(document.getElementById('usuario').value);
			sParams += '&clave=' +  escape(document.getElementById('clave').value);
			var httpWindow = DynWeb.getHTTPObject();
			DynWeb.compiler(httpWindow,sUrl,sParams);						
			
			document.getElementById('enviar_colega_enviar').style.display = 'none';			
		},
		
		logout: function(sSite)
		{
			var sContent ='';
			sContent+='<div class="titulo">Salir del sistema</div>';
			sContent+='<div class="subtitulo">Confirme su salida</div>';
			sContent+='	<br/>';
			sContent+='	Por favor confirme la salida del sistema.';									
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	<input type="button" name="enviar" id="enviar_colega_enviar" value="Salir" class="button" onclick="DynWeb.functions.logoutSend(\'' + sSite + '\');"/>';
			sContent+='	<input type="button" name="cancelar" id="enviar_colega_cancelar" value="Cancelar" class="button2" onclick="DynWeb.screen.hide();"/>';			
			DynWeb.screen.show(400,360,sContent);			
		},
		
		logoutSend: function(sSite)
		{
			var sUrl = sSite + 'salir';			
			var sParams ='';						
			var httpWindow = DynWeb.getHTTPObject();
			DynWeb.compiler(httpWindow,sUrl,sParams);						
			
			document.getElementById('enviar_colega_enviar').style.display = 'none';			
		},				

		shareCursoOnline: function(sTitle,sLink)
		{
			var sContent ='';
			sContent+='<div class="titulo">Envíar el curso a un colega</div>';
			sContent+='<div class="subtitulo">'+ sTitle +'</div>';
			sContent+='	<br/>';
			sContent+='	Ingrese su nombre y apellido';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_emisor" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';			
			sContent+='	Ingrese su correo electrónico';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_emisor_correo" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	Ingrese el nombre y apellido de su colega';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_receptor" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	Ingrese el correo electrónico de su colega';
			sContent+='	<br/>';
			sContent+='	<input type="text" class="input" id="enviar_colega_receptor_correo" value="" maxlength="50" size="60"/>';
			sContent+='	<br/>';
			sContent+='	<br/>';
			sContent+='	<input type="button" name="enviar" id="enviar_colega_enviar" value="Enviar" class="button" onclick="DynWeb.functions.shareCursoOnlineSend(\'' + escape(sTitle) + '\',\'' + escape(sLink) + '\');"/>';
			sContent+='	<input type="button" name="cancelar" id="enviar_colega_cancelar" value="Cancelar" class="button2" onclick="DynWeb.screen.hide();"/>';			
			DynWeb.screen.show(400,360,sContent);			
		},
		
		shareCursoOnlineSend: function(sTitle,sLink)
		{
			var sUrl = document.location.href.toLowerCase().replace('/cursos_online/','/enviar_cursos_online/');
			var sParams ='';
			sParams += 'emisor=' + escape(document.getElementById('enviar_colega_emisor').value);			
			sParams += '&emisor_correo=' +  escape(document.getElementById('enviar_colega_emisor_correo').value);
			sParams += '&receptor=' +  escape(document.getElementById('enviar_colega_receptor').value);
			sParams += '&receptor_correo=' +  escape(document.getElementById('enviar_colega_receptor_correo').value);
			var httpWindow = DynWeb.getHTTPObject();
			DynWeb.compiler(httpWindow,sUrl,sParams);						
			
			document.getElementById('enviar_colega_enviar').style.display = 'none';			
		},
		
		navigate: function(sLink,sParams)
		{
			var oBody = document.body;
			var oForm = document.createElement('FORM');				
				oForm.setAttribute('action',sLink);
				oForm.setAttribute('method','post');				
				
				var sTempInnerHTML = sParams;
				sTempInnerHTML = sTempInnerHTML.replace('=','" VALUE="');
				sTempInnerHTML = sTempInnerHTML.replace('&','"/><input TYPE="hidden" name="');
				
				var sInnerHTML = '<input TYPE="hidden" name="' + sTempInnerHTML + '"/>';												
								
				oForm.innerHTML = sInnerHTML;												
				oResult = oBody.appendChild(oForm);	
				/*
				oEl = document.createElement('input');
				oEl.type='hidden';
				oEl.name='c';
				oEl.value='cac';				
				oResult.appendChild(oEl);
				*/
				//alert(oResult.getElementsByTagName('input')[0].value);
				//alert(oResult.innerHTML);
				oResult.submit();
		}		
		
	}		
}
