var timer;
var h = -450;	// set this to the same value of the top property for the pa div in the style sheet
var w = 250;	// set this to the same value of the width property for the pa div in the style sheet, smaller to move it to the right, larger to move it to the left
var t = 100;	// set this to the actual pixel distance from the top where you want the pa div to be at the end of the descent

function startAp() {
	setLeft();
	showAp();
}

function hideAp() { 
	if (document.layers) document.layers.pa.visibility = 'hide';
	else if (document.all) document.all.pa.style.visibility = 'hidden';
	else if (document.getElementById) document.getElementById("pa").style.visibility = 'hidden';
}

function showAp() { 
	state=typeof tPos;
	if(state=='undefined') tPos = h;
	if(tPos < t) { 
		tPos+=25;
		if (document.layers) document.layers.pa.top = tPos+"px";
		else if (document.all) document.all.pa.style.top = tPos+"px";
		else if (document.getElementById) document.getElementById("pa").style.top = tPos+"px";
	}

	if(timer!=null) clearInterval(timer);
	timer = setTimeout("showAp()",10);
}

function getoPos() {
	if (document.layers) alert(document.layers.pa.top);
	else if (document.all) alert(document.all.pa.style.top);
	else if (document.getElementById) alert(document.getElementById("pa").style.top);
}

function setLeft() {
	if (document.layers) document.layers.pa.left = ((window.innerWidth / 2) - (w / 2))+"px";
	else if (document.all) document.all.pa.style.left = ((document.body.offsetWidth / 2) - (w / 2))+"px";
	else if (document.getElementById) document.getElementById("pa").style.left = ((window.innerWidth / 2) - (w / 2))+"px";
}

function zxcCreateCookie(nme,v,days){
 document.cookie=nme+'='+v+';expires='+(new Date(new Date().getTime()+days*86400000).toGMTString())+';path=/';
}

function eraseCookie(name) {
    zxcCreateCookie(name,"",-1);
}

function zxcReadCookie(nme){
 nme+='=';
 var split = document.cookie.split(';');
 for(var z0=0;z0<split.length;z0++){
  var s=split[z0];
  while (s.charAt(0)==' ') s=s.substring(1,s.length);
  if (s.indexOf(nme)==0) return s.substring(nme.length,s.length);
 }
 return null;
}

function Cookie(id,hrs){
 var time=zxcReadCookie(id),now=new Date().getTime();
 if (!(time&&(now-time)/1000/60/60<hrs)){
    return true;

 } else {
    return false;
 }
}

boxText = '	<div id="pa" class="kd">';
boxText += '		<div class="pa_close"><a href="javascript:void(0)" onclick="hideAp()"><img src="http://members.majon.com/img/close1.jpg" alt="close" width=25 height=24/></a></div>';

boxText += (<r><![CDATA[ 
<div style="margin: 0px auto; padding: 10px 0pt 0pt; width: 240px; height: 280px; font-size: 10px; line-height: 13px; border: 1px solid rgb(0, 0, 0); text-align: center; color: #000000;">
<a href="http://www.majon.com" target=_blank><img src="http://www.freemalls.com/images/logo-majonsm.gif" width=111 height=50></a><br><i>Internet Marketing Specialists</i><br>
            <div style="font-size: 16px; font-weight: bold; color: rgb(170, 20, 40); padding-top: 8px; height: 24px;">Free Website Evaluation!</div>

            Get an IMMEDIATE Free Website Evaluation from <a href="http://www.majon.com" target=_blank><font color="#990000">Majon.com</font></a> with real live data metrics
            <div style="text-align: left;" mce_style="text-align: left;">
            <form id="form1" name="form1" method="post" action="http://members.majon.com/report.php">
                <input type="hidden" name="f" id="f" value="create_account" />
                <table cellspacing="0" cellpadding="0" border="0" class="mceVisualAid mceItemTable" style="margin: 6px 0pt 0pt;" mce_style="margin: 6px 0pt 0pt;">
                    <tbody>
                        <tr>
                            <td align="right" class="mceVisualAid"><span style="font-size: 12px; color: rgb(0, 0, 0);">URL:</span><span style="color: rgb(255, 0, 0);">*</span></td>

                            <td width="127" class="mceVisualAid"><input type="text" gtbfieldid="62" name="url" id="url" value="http://" /></td>
                        </tr>
                        <tr>
                            <td align="right" class="mceVisualAid"><span style="font-size: 12px; color: rgb(0, 0, 0);">Email:</span><span style="color: rgb(255, 0, 0);">*</span></td>
                            <td class="mceVisualAid"><input type="text" gtbfieldid="63" name="email" id="email" value="" /></td>
                        </tr>
                        <tr>
                            <td align="right" class="mceVisualAid"><span style="font-size: 10px; color: rgb(0, 0, 0);">Name:</span></td>

                            <td class="mceVisualAid"><input type="text" gtbfieldid="64" name="name" id="name" value="" /></td>
                        </tr>
                        <tr>
                            <td align="right" class="mceVisualAid"><span style="font-size: 10px; color: rgb(0, 0, 0);">Phone:</span></td>
                            <td class="mceVisualAid"><input type="text" gtbfieldid="65" name="phone" id="phone" value="" /><br></td>
                        </tr>
                        <tr>
                            <td class="mceVisualAid">&nbsp;</td>

                            <td align="right" class="mceVisualAid"><input type="submit" name="submit" value="Get My FREE Report!" /><br></td>
                        </tr>
                    </tbody>
                </table>
            </form>
            </div>
            </div>
]]></r>).toString(); 

boxText += '	</div>';
force = false;
if(!zxcReadCookie('websiteeval') || force) {
    document.write(boxText);
    startAp();
    zxcCreateCookie('websiteeval',new Date().getTime(),1);
}
