﻿				
/*
 * OptInOver(TM) code generated by PopUpMaster Pro from
 * http://popupmaster.com
 * Copyright (c)2003, Steve Shaw, takanomi.com
 */

				
			
var ns_oio = document.layers || navigator.userAgent.toLowerCase().indexOf("mac") != -1;
var ns6_oio = (!document.all && document.getElementById) ? true : false;
var debug = false;
if (ns6_oio && !debug)
{
	document.write('<div style="position: relative;z-index:100">');
}

// grey table with rounded corners "
var message_oio='<table id="mainTable" cellspacing="0" cellpadding="0" border="0" style="width:100%">';
// top
message_oio+='<tr>';
message_oio+='	<td><img src="http://www.richestsg.com/images/_top_left.gif" style="padding: 0px;width: 5px;height: 5px;display: block;margin: 0px"  border="0" alt="" /></td>';
message_oio+='	<td style="background-color:#f1f1f1; border-top: 1px solid #00357D; width:100%"><img src="http://www.richestsg.com/images/_.gif" style="padding: 0px;width: 1px;height: 1px;display: block;margin: 0px" alt="" /></td>';
message_oio+='	<td><img src="http://www.richestsg.com/images/_top_right.gif" style="padding: 0px;width: 5px;height: 5px;display: block;margin: 0px" border="0" alt="" /></td>';
message_oio+='</tr>';
// middle
message_oio+='<tr>';
message_oio+='<td style="background-color:#f1f1f1; border-left: 1px solid #00357D;">';
message_oio+='<img src="http://www.richestsg.com/images/_.gif" width="1" height="1"></td>';
message_oio+='	<td style="background-color:#f1f1f1;" align="center">';


//	main content
message_oio+="<style type=\"text/css\">";
message_oio+=".rText {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color:#000000;}";
message_oio+=".hText {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color:#00357D;}";
message_oio+="</style>";
message_oio+='<table width="97%" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td align="left">';


// define string to be searched
var text = '<p>&nbsp;&nbsp; <img src=\"http://www.richestsg.com/images/fraamoneymakingtips.jpg\" alt=\" \" /></p><p>&nbsp;</p>'+
'';

// define search pattern
var pattern = /(<\/div>|<\/p>|<br[^>]*>)$/;

// search and return result
if(text.search(pattern) == -1)
{
	text+='<br />';
}

message_oio += '<font face=\"\'Times New Roman\',Times,serif\" size=\"3\">' + text + '</font>';

if (debug)
{
	message_oio += '<a href="javascript:alert(document.body.innerHTML)">debug</a>';
}
message_oio+='</td></tr><tr><td style="text-align:center">';
message_oio+='<form id=\"mainForm\" method=\"post\" action=\"./process.aspx\" accept-charset=\"UTF-8\">';
message_oio+="	<table width=\"97%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color:#DEDEF4; border: 1px #404040 solid;\"><tr><td style=\"text-align:center\">";
message_oio+="		<span class=\"hText\">Your name:</span><br><input type=\"text\" name=\"category2\" onmousedown=\"this.focus();\"><br>";
message_oio+="  	<span class=\"hText\">Your email:</span><br><input type=\"text\" name=\"category3\" onmousedown=\"this.focus();\"><br>";
message_oio+="		<img border=\"0\" src=\"http://www.richestsg.com/images/_.gif\" width=\"1\" height=\"5\"><br>";
message_oio+="		<input type=\"submit\" id=\"mainSubmit\" value=\"Get FREE Money Making Tips!\" style=\"color:#00357D; font-weight:bold; font-size:11px\">";
message_oio+='		<input type=\"hidden\" name=\"category1\" value=\"simplyrichsingapore\">';
message_oio+='		<input type=\"hidden\" name=\"confirmation\" value=\"http://www.richestsg.com/messagesent\">';
message_oio+="		<input type=\"hidden\" name=\"misc\" value=\"\">";
message_oio+="		<input type=\"hidden\" name=\"ref\" value=\"600\">";
message_oio+="		<br><img src=\"http://www.richestsg.com/images/_.gif\" width=\"1\" height=\"4\"><br>";
message_oio+="	</td></tr></table>";
message_oio+="<img src=\"http://www.richestsg.com/images/_.gif\" width=\"1\" height=\"1\"><br>";
message_oio+="</form>";
message_oio+="<span class=\"rText\">Remember, your privacy is safe!</span></td></tr></table>";

//	end of main content


message_oio+='</td>';
message_oio+='	<td style="background-color:#f1f1f1; border-right: 1px solid #00357D;">';
message_oio+='		<img src="http://www.richestsg.com/images/_.gif" style="padding: 0px;width: 1px;height: 1px;display: block;margin: 0px"  border="0" alt="" /></td>';
message_oio+='</tr>';
// bottom
message_oio+='<tr>';
message_oio+='	<td>';
message_oio+='		<img src="http://www.richestsg.com/images/_bottom_left.gif" style="padding: 0px;width: 5px;height: 5px;display: block;margin: 0px"  border="0" alt="" /></td>';
message_oio+=' <td style="background-color:#f1f1f1; border-bottom: 1px solid #00357D;">';
message_oio+='		<img src="http://www.richestsg.com/images/_.gif" style="padding: 0px;width: 1px;height: 1px;display: block;margin: 0px"  border="0" alt="" /></td>';
message_oio+='	<td>';
message_oio+='		<img src="http://www.richestsg.com/images/_bottom_right.gif" style="padding: 0px;width: 5px;height: 5px;display: block;margin: 0px"  border="0" alt="" /></td>';
message_oio+='</tr>';
message_oio+='</table>';

var title_oio = 'Free Money Making Tips';

var responder_oio = 'richestsg';

var confirmation_page_oio = 'http://www.richestsg.com/messagesent';


		

	var IE_oio = (navigator.appName == "Microsoft Internet Explorer") ? 1 : 0;

	// IE hack
	if(IE_oio)
	{
		var WCH_Constructor = function()
		{
			//	exit point for anything but IE5.0+/Win
			if ( !(document.all && document.getElementById && !window.opera && navigator.userAgent.toLowerCase().indexOf("mac") == -1) ) {
				this.Apply = function() {};
				this.Discard = function() {};
				return;
			}

			//	private properties
			var _bIE55 = false;
			var _bIE6 = false;
			var _oRule = null;
			var _bSetup = true;
			var _oSelf = this;

			//	public: hides windowed controls
			this.Apply = function(vLayer, vContainer, bResize) {
				if (_bSetup) _Setup();

				if ( _bIE55 && (oIframe = _Hider(vLayer, vContainer, bResize)) ) {
					oIframe.style.visibility = "visible";
				} else if(_oRule != null) {
					_oRule.style.visibility = "hidden";
				}

			};

			//	public: shows windowed controls
			this.Discard = function(vLayer, vContainer) {
				if ( _bIE55 && (oIframe = _Hider(vLayer, vContainer, false)) ) {
					oIframe.style.visibility = "hidden";
				} else if(_oRule != null) {
					_oRule.style.visibility = "visible";
				}
			};

			//	private: returns iFrame reference for IE5.5+
			function _Hider(vLayer, vContainer, bResize) {
				var oLayer = _GetObj(vLayer);
				var oContainer = ( (oTmp = _GetObj(vContainer)) ? oTmp : document.getElementsByTagName("body")[0] );
				if (!oLayer || !oContainer) return;
				//	is it there already?
				var oIframe = document.getElementById("WCHhider" + oLayer.id);

				//	if not, create it
				if ( !oIframe ) {
					//	IE 6 has this property, IE 5 not. IE 5.5(even SP2) crashes when filter is applied, hence the check
					var sFilter = (_bIE6) ? "filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);" : "";
					//	get z-index of the object
					var zIndex = oLayer.style.zIndex;
					if ( zIndex == "" ) zIndex = oLayer.currentStyle.zIndex;
					zIndex = parseInt(zIndex);
					//	if no z-index, do nothing
					if ( isNaN(zIndex) ) return null;
					//	if z-index is below 2, do nothing (no room for Hider)
					if (zIndex < 2) return null;
					//	go one step below for Hider
					zIndex--;
					var sHiderID = "WCHhider" + oLayer.id;
					oContainer.insertAdjacentHTML("afterBegin", '<iframe class="WCHiframe" src="javascript:false;" id="' + sHiderID + '" scroll="no" frameborder="0" style="position:absolute;visibility:hidden;' + sFilter + 'border:0;top:0;left;0;width:0;height:0;background-color:#ccc;z-index:' + zIndex + ';"></iframe>');
					oIframe = document.getElementById(sHiderID);
					//	then do calculation
					_SetPos(oIframe, oLayer);
				} else if (bResize) {
					//	resize the iFrame if asked
					_SetPos(oIframe, oLayer);
				}
				return oIframe;
			};

			//	private: set size and position of the Hider
			function _SetPos(oIframe, oLayer) {
				//	fetch and set size
				oIframe.style.width = oLayer.offsetWidth + "px";
				oIframe.style.height = oLayer.offsetHeight + "px";
				//	move to specified position
				oIframe.style.left = oLayer.offsetLeft + "px";
				oIframe.style.top = oLayer.offsetTop + "px";
			};

			//	private: returns object reference
			function _GetObj(vObj) {
				var oObj = null;
				switch( typeof(vObj) ) {
					case "object":
						oObj = vObj;
						break;
					case "string":
						oObj = document.getElementById(vObj);
						break;
				}
				return oObj;
			};

			//	private: setup properties on first call to Apply
			function _Setup() {
				_bIE55 = (typeof(document.body.contentEditable) != "undefined");
				_bIE6 = (typeof(document.compatMode) != "undefined");

				if (!_bIE55) {
					if (document.styleSheets.length == 0)
						document.createStyleSheet();
					var oSheet = document.styleSheets[0];
					oSheet.addRule(".WCHhider", "visibility:visible");
					_oRule = oSheet.rules(oSheet.rules.length-1);
				}

				_bSetup = false;
			};
		};
		//var WCH = new WCH_Constructor();

		var WCH_Null = function()
		{
			this.Apply = function() {};
			this.Discard = function() {};
			return;
		}
		var WCH = new WCH_Null();

	}

var cookie_oio="richestsg5";
var drag_oio= false, x_oio, y_oio, a_oio, b_oio;

var old_event_handler = new Array;

function move(e)
{
	if (drag_oio)
	{
		left_oio = ns6_oio ? a_oio + e.clientX - x_oio : a_oio + event.clientX-x_oio;
		optinover.style.left = left_oio + "px";
		top_oio = ns6_oio ? b_oio + e.clientY - y_oio : b_oio + event.clientY - y_oio - document.body.scrollTop;
		optinover.style.top = top_oio + (ns6_oio ? 0 : document.body.scrollTop) + "px";
		shadow.style.left = left_oio + 0;
		shadow.style.top = top_oio+(ns6_oio ? 0 : document.body.scrollTop) + 0;
		if (IE_oio) WCH.Apply("optinover", null, true);
		return false;
	}
}

function drags_oio(e)
{
	if (!document.all && !ns6_oio)
	{
		return;
	}

	var obj_oio = ns6_oio ? e.target : event.srcElement;
	var topelement = ns6_oio ? "HTML" : "BODY";
	while (obj_oio.tagName != topelement && obj_oio.className != "draggable_oio")
	{
		obj_oio = ns6_oio ? obj_oio.parentNode : obj_oio.parentElement;
	}
	if (obj_oio.className == "draggable_oio")
	{
		drag_oio = true;
		a_oio = parseInt(optinover.style.left + 0);
		b_oio = parseInt(optinover.style.top + 0);
		x_oio = ns6_oio ? e.clientX : event.clientX;
		y_oio = ns6_oio ? e.clientY : event.clientY;
		document.onmousemove = move;
		return false;
	}
}

function stop_drag_oio()
{
	drag_oio = false;
	document.onmousemove = old_event_handler["onmousemove"];
}

if (!ns_oio)
{
	old_event_handler["onmousemove"] = document.onmousemove;
	old_event_handler["onclick"]     = document.onclick;
	old_event_handler["onmouseup"]   = document.onmouseup;
	old_event_handler["onmousedown"] = document.onmousedown;

	document.onmousedown = drags_oio;
	document.onmouseup = stop_drag_oio;
	//document.onmouseup = new Function("drag_oio=false;");
}


				
			
function create_oio(doc)
{
	d_oio = (doc ? doc : document);

	d_oio.write('<div id="shadow" style="position:absolute;visibility:hidden;display:none;z-index:98;">&nbsp;</div>');
	d_oio.write('<div id="optinover" class="draggable_oio" style="visibility:hidden; position:absolute; z-index:99; width:250px;height: 100px; overflow:hidden;">');
	d_oio.write('<table id="optinoverTable" width="100%" align="left" valign="top" cellpadding="0" cellspacing="0" border="0" style="background-color:white; cursor:move;background-color:#FFFFFF;border-style:solid;border-width:2px;border-color:blue;">');
	d_oio.write('<tr><td width="100%" style="background-color:blue" height="26"><font style="font-size:13px;font-family:Arial,verdana;color: #FFFFFF"><b>&nbsp;');

	// title
	var title = title_oio;

	d_oio.write(title);
	d_oio.write('</b></font></td>');

	d_oio.write('<td style="background-color:blue" align="center">');
	d_oio.write('	<table width="20" cellspacing="0" cellpadding="0" align="center" style="background-color:blue; border-collapse:collapse;border-style:outset;border-width:1px;border-color:white">');
	d_oio.write('	<tr><td>');
	d_oio.write('		<a onclick="hide_oio();" onmouseover="this.style.cursor=\'default\';this.style.background=\'#FF7359\'" onmouseout="this.style.cursor=\'default\';this.style.background=\'#E76741\'" style="background:#E76741; display:block; text-align:center; border:0px;color:white;font-family:arial,system,verdana;margin:0px;padding:0px;text-decoration:none;font-size:16px;left-indent:0px;"><b>X</b></a>');
	d_oio.write('	</td></tr>');
	d_oio.write('	</table>');
	d_oio.write('</td></tr>');
	d_oio.write('<tr><td valign="top" colspan="3" style="cursor:default; padding:5px">');

	// content
	d_oio.write(message_oio);
	//endof: content

	d_oio.write('</td></tr>');
	d_oio.write('</table></div></div>');

	return true;
}

		

function create_ns_oio()
{

}

if(getcookie_oio(cookie_oio) == "")
{
	if(ns_oio)
	{
		create_ns_oio();
	}
	else
	{
		//alert("oio:create");
		create_oio();
	}
}

var id_oio,d_oio,optinover,shadow,height_oio,left_oio,top_oio;

var top_distance = 165;
var left_distance = 400;

function var_oio()
{
	id_oio = "optinover";
	d_oio = document;
	optinover = d_oio.getElementById ? d_oio.getElementById(id_oio) : d_oio.all[id_oio];
	shadow = d_oio.getElementById ? d_oio.getElementById("shadow") : d_oio.all["shadow"];
	b = (typeof(window.innerWidth) == 'number') ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : (document.body && document.body.clientWidth ? document.body.clientWidth : 800));
	left_oio = left_distance;
	top_oio = top_distance;
}

if(!ns_oio && getcookie_oio(cookie_oio) == "")
{
	var_oio();
	repos_oio();
}

function repos_oio()
{
	if(ns6_oio)
	{
		optinover.style.top = top_oio + window.pageYOffset + "px";
		shadow.style.top = top_oio + window.pageYOffset + 0;
		optinover.style.height = document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
		shadow.style.height = document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height");
		shadow.style.width = document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("width");
	}
	else
	{
		optinover.style.top = top_oio + d_oio.body.scrollTop + "px";
		shadow.style.height = optinover.offsetHeight;
		shadow.style.top = (top_oio * 1 + 0 * 1) + d_oio.body.scrollTop;
		shadow.style.width = optinover.style.width;
	}

	optinover.style.left = left_oio + "px";
	shadow.style.left = left_oio + 0;
}

function hide_oio()
{
	if(optinover.style.left.substring(0, optinover.style.left.length - 2) < screen.width && !ns6_oio)
	{
		optinover.style.left=optinover.style.left.substring(0, optinover.style.left.length - 2) * 1 + 20;
		shadow.style.left=shadow.style.left.substring(0 ,shadow.style.left.length - 2) * 1 + 20;
		setTimeout("hide_oio()", 10);
	}
	else
	{
		optinover.style.visibility = 'hidden';
		shadow.style.visibility = 'hidden';
		window.scrollBy(0,1);

		if (!ns6_oio)
		{
			setTimeout('window.document.body.onscroll=null;', 2000);
		}

		optinover.style.left = 0;
	}
	if (IE_oio) WCH.Apply("optinover", null, true);
}

function mail_oio()
{
	if(ns_oio)
	{
		document.mailer.subscribe.click();
	}
	else
	{
		window.location = "mailto:?body=N/A - to use, select 'Show email' below";
	}
}

function show_ns_oio()
{
	message_oios = message_oio.split("<P><UL>");
	message_oio = message_oios[0];

	for(i = 1; i < message_oios.length; i++)
	{
		message_oio += "\n" + message_oios[i];
	}
	message_oios = message_oio.split("<P>");
	message_oio = message_oios[0];

	for(i = 1; i < message_oios.length; i++)
	{
		message_oio += "\n\n" + message_oios[i];
	}
	message_oios = message_oio.split("<BR>");
	message_oio = message_oios[0];

	for(i = 1; i < message_oios.length; i++)
	{
		message_oio += "\n" + message_oios[i];
	}
	message_oios = message_oio.split("<LI>");
	message_oio=message_oios[0];

	for(i = 1; i < message_oios.length; i++)
	{
		message_oio += "\n* " + message_oios[i];
	}
	message_oios = message_oio.split("<");
	message_oio = message_oios[0];

	for(i = 1; i < message_oios.length; i++)
	{
		temp_oios = message_oios[i].split(">");
		temp_oio="";

		if(temp_oios.length > 1)
		{
			temp_oio = temp_oios[1];
		}
		else
		{
			temp_oio = message_oios[i];
		}

		message_oio += temp_oio;
	}

	if(confirm(message_oio))
	{
		mail_oio();
	}
}

var temp_top_oio;

function show_oio()
{

	if (navigator.appVersion.indexOf("Mac") != -1)
	{
		return false;
	}

	if(getcookie_oio(cookie_oio) == "")
	{
		if(ns_oio)
		{
			show_ns_oio();
		}
		else
		{

			temp_top_oio = (ns6_oio ? window.pageYOffset : d_oio.body.scrollTop) - (ns6_oio ? document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").substring(0,document.defaultView.getComputedStyle(document.getElementById("optinoverTable"), "").getPropertyValue("height").length -2 ) : optinover.offsetHeight) - 0;
			optinover.style.top = temp_top_oio + "px";
			//alert(temp_top_oio);
			if(ns6_oio)
			{
				shadow.style.top = 0; // - optinover.offsetHeight; // 0;

			}
			else
			{
				shadow.style.top = 0 - optinover.offsetHeight;
			}

			optinover.style.overflow = 'visible';
			optinover.style.visibility = 'visible';
			shadow.style.visibility = 'visible';
			shadow.style.overflow = 'visible';
			move_oio();

			if(!ns6_oio)
			{
				window.document.body.onscroll = repos_oio;

			}
		}

		setcookie_oio();
	}
}

function move_oio()
{
	if (optinover.style.top.substring(0, optinover.style.top.length-2) < top_distance + (ns6_oio ? window.pageYOffset : d_oio.body.scrollTop))
	{


		temp_top_oio += 10;

		optinover.style.top = temp_top_oio + "px";
		shadow.style.top = temp_top_oio + 1;
		if (IE_oio) WCH.Apply("optinover", null, true);
		setTimeout("move_oio()", 10);
	}
}

function getcookie_oio(cookieName)
{
	var id = cookieName + "=";
	var cookievalue = "";

	if (document.cookie.length>0)
	{
		offset = document.cookie.indexOf(id);

		if (offset != -1)
		{
			cookievalue = "x";
		}
	}

	return cookievalue;
}

function setcookie_oio()
{
	if (1 == 0) return false;

	var today = new Date();
	var expdate = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000);
	document.cookie = cookie_oio + "=" + escape("done") + ";path=/;expires=" + expdate.toGMTString();
}

setTimeout("show_oio();", 2 == 2 ? 5000 : 1000);