var m_start = 1470;
var m_dec = 30;
var m_cur = m_start;
var cs_df_to = 0; var cs_df_url = "";
function _scrl() {
	m_cur-=m_dec;
	if (m_cur<0) m_cur = m_start;
	document.getElementById('ldr').style.marginTop = "-" + m_cur + "px";
	setTimeout(_scrl, 70);
}
function _csshow() {
	csintldr.location.replace(document.getElementById(cs_frame_url).value);
	document.getElementById('cs_int').style.visibility="visible";
	document.getElementById('cs_int').style.display="";
	setTimeout(_scrl, 70);
}
function showInline(height) {
	document.getElementById('int_ldmsg').style.visibility="hidden";
	document.getElementById('int_frame').style.visibility="visible";
	if (/^[0-9]+$/.test(height) && height!="0") {
		document.getElementById(cs_csintldr).style.height = height + "px";
		var nh = parseInt(height);
		if (document.getElementById('csthankyou')) {
			document.getElementById('csthankyou').style.top = nh + "px";
		}	
		if (nh>248) {
			nh = nh+ 40;
			document.getElementById('cscontainer').style.height = nh + "px";
		}
	}
}
function csGetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) {
      return csGetCookieVal (j);
    }
    i = document.cookie.indexOf(" ", i) + 1;
	    if (i == 0) break; 
    }
    return null;
}
function csGetCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1) { endstr = document.cookie.length; }
    return unescape(document.cookie.substring(offset, endstr));
}
function csSetCookie(name,value) {
    document.cookie = name + "=" + escape (value);
}
function doForward(fwdUrl){
    var oldUrl = csGetCookie("fwdurl");
	if (fwdUrl==oldUrl || fwdUrl==unescape(oldUrl)) {
		return;
	}
	csSetCookie("fwdurl", fwdUrl);
	if (cs_df_to != 0) clearTimeout(cs_df_to);
	cs_df_url = "/inpage/redir.aspx?u=" + escape(fwdUrl.replace("http://www.reply.com", "___").replace("http://landing.reply.com", "_l__"));
	cs_df_to = setTimeout(cs_df_fx, 500);
}
function cs_df_fx() {
	//if (document.cookie.indexOf("csol=y")==-1) {
	//	document.cookie = "csol=y";
		window.location.href=cs_df_url;
	//} else {
	//	cs_df_ck_clr();	
	//}
}
function _clsearh() {
	window.location.reload();
}

function cs_submit_lf_inline(rand) {
	var csrand = csGetCookie("csrand");

	if (csrand==rand || rand==unescape(csrand)) {
		return;
	}
	csSetCookie("csrand", rand);
	cs_submit_lf();
}

function cs_submit_lf(){
    setTimeout(cs_lf_loc, 200);
}
function cs_lf_loc(){
    var  _lfurl = document.getElementById(cs_vl_url).value;
    window.location.href=_lfurl;
}
function cs_df_ck_clr() { 
    //document.cookie = "csol=n"; 
}
//setTimeout(cs_df_ck_clr, 1000);

