/*Script to generate newsletter widget*/
var IRMLA=document.getElementById('IRMLA');
IRMLA.style.width='200px';
IRMLA.style.border='1px dotted #cccccc';
IRMLA.style.padding='5px';
IRMLA.style.fontSize='10px';
IRMLA.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';

var IRMLB=document.getElementById('IRMLB');
IRMLB.style.fontSize='9px';
IRMLB.style.color='blue';
IRMLB.style.textDecoration='none';
IRMLB.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';

var cleared = 0;
var IRMLC=document.getElementById('IRMLC');
IRMLC.style.fontSize='10px';
IRMLC.style.border='1px solid #cccccc';
IRMLC.style.width='160px';
IRMLC.style.color='#cccccc';
IRMLC.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';

var IRMLD=document.getElementById('IRMLD');
IRMLD.style.fontSize='10px';
//IRMLD.style.border='1px solid #cccccc';
IRMLD.style.width='30px';
IRMLD.style.color='black';
IRMLD.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';

IRMLC.onclick = function ()
{
    if(cleared == 0)
    {
	IRMLC.value='';
	IRMLC.style.color='#000000';
	cleared = 1;
    }
};

IRML_cid=document.getElementById('IRML_cid');
if(document.getElementById('IRML_dopu')&&IRML_readCookie('buletin_popup')!='seen'+IRML_cid.value)
{
  window.onload=function(){
  var IRML_POPUP = document.createElement('div');
  IRML_POPUP.setAttribute('id','IRML_POPUP');
  IRML_POPUP.style.maxWidth='300px';
  IRML_POPUP.style.maxHeight='300px';
  IRML_POPUP.style.position='fixed';
  IRML_POPUP.style.top='30px';
  IRML_POPUP.style.left='30px';
  IRML_POPUP.style.background='#ebf4fb';
  IRML_POPUP.style.border='2px solid #B7DEF2';
  IRML_POPUP.style.padding='14px 14px 14px 14px';
  IRML_POPUP.style.fontFamily='Verdana, Arial, Helvetica, sans-serif';
  IRML_POPUP.style.fontSize='12px';
  IRML_POPUP.style.display = 'block';
  IRML_POPUP.style.margin = '0px';
  IRML_POPUP.style.zIndex = 100000000;

  IRML_POPUP.innerHTML = '<form name="IRML_FORM" method="post" action="http://www.infored.com.mx/subscribe.php">\
    <h1 style="font-size:14px;font-weight:bold;color:black;font-family:Verdana, Arial, Helvetica, sans-serif;">Suscr&iacute;bete a nuestro Bolet&iacute;n</h1>\
    <p style="font-size:11px;color:#666666;margin-bottom:20px;border-bottom:solid 1px #b7ddf2;padding-bottom:10px;font-family:Verdana, Arial, Helvetica, sans-serif;padding:0px;">Quieres recibir las &uacute;ltimas ofertas, promociones y noticias de nosotros? Suscribete a nuestro bolet&iacute;n ahora!</p>\
    <label style="display:block;font-weight:bold;text-align:right;width:120px;float:left;font-family:Verdana, Arial, Helvetica, sans-serif;color:black;">Nombre\
        <span style="color:#666666;display:block;font-size:11px;font-weight:normal;text-align:right;width:120px;font-family:Verdana, Arial, Helvetica, sans-serif;">nombre y apellido</span>\
    </label>\
    <input type="text" name="name" style="float:left;font-size:12px;padding:4px 2px;border:solid 1px #aacfe4;width:150px;margin:2px 0 20px 10px;font-family:Verdana, Arial, Helvetica, sans-serif;" />\
    <label style="display:block;font-weight:bold;text-align:right;width:120px;float:left;font-family:Verdana, Arial, Helvetica, sans-serif;color:black;">Correo\
        <span style="color:#666666;display:block;font-size:11px;font-weight:normal;text-align:right;width:120px;">correo electr&#243;nico</span>\
    </label>\
    <input type="text" name="email" style="float:left;font-size:12px;padding:4px 2px;border:solid 1px #aacfe4;width:150px;margin:2px 0 20px 10px;font-family:Verdana, Arial, Helvetica, sans-serif;"/>\
    <div align="center" style="border:0px;"><input style="width:119px;height:31px;padding:0px;margin:0px;" type=image src="http://www.infored.com.mx/img/suscribirse.png" name="dosubmit"> <img width="115" height="31" style="cursor:pointer;border:0px;" onclick="IRML_close_popup();" src="http://www.infored.com.mx/img/no-gracias.png"></div>\
  <h2 style="font-size:10px;font-weight:normal;margin-bottom:4px;margin-top:10px;text-align:center;color: #666;font-family:Verdana, Arial, Helvetica, sans-serif;">servicio de <a href="http://www.infored.com.mx/" title="InfoRed" style="text-decoration:none;color: #356AA0;">InfoRed.com.mx</a></h2>\
<input type=hidden name=cid value="' + IRML_cid.value + '">\
  </form>';
  //H1
  
  IRML_createCookie('buletin_popup','seen'+IRML_cid.value,2000);
   document.body.appendChild(IRML_POPUP);
  }
}

function IRML_createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function IRML_readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function IRML_close_popup()
{
    document.getElementById('IRML_POPUP').style.visibility='hidden';
}


