﻿var m_start = 1470;
var m_dec = 30;
var m_cur = m_start;
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 _vl()
{
	doForward(document.getElementById(cs_vl_url).value);
}
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 _clint() {
	window.location.reload();
}
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 (nh>230) {
			//nh=429; // force
			nh = nh+ 20;
			document.getElementById('cscontainer').style.height = nh + "px";
			
		}
	}
}

var cs_df_to = 0; var cs_df_url = "";
function doForward(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 getCookiebyName(name) {
	var _cookie = name + "=";
	var _collection = document.cookie.split(';');
	for(var i=0;i < _collection.length;i++) {
		var c = _collection[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(_cookie) == 0) return c.substring(_cookie.length,c.length);
	}
	return null;
}

function cs_df_fx() {
	var _xCsol= getCookiebyName('csol');
	if (_xCsol!='y') {
		document.cookie = "csol=y";
		window.location.href=cs_df_url;
	} else {
		cs_df_ck_clr();	
	}
}
function cs_df_ck_clr() { document.cookie = "csol=n"; }
setTimeout(cs_df_ck_clr, 1000);


