function popUp01(url){
		window.open(url,"newWindow","height=345,width=425,resizable=yes,menubar=no,scrollbars=yes");
}

function popUp02(url){
		window.open(url,"newWindow","height=300,width=725,resizable=yes,menubar=no,scrollbars=yes");
}
	

var myPix = new Array(
	"images/quotes/box_btm_q01.gif", 
	"images/quotes/box_btm_q02.gif", 
	"images/quotes/box_btm_q03.gif",
	"images/quotes/box_btm_q04.gif",
	"images/quotes/box_btm_q05.gif",
	"images/quotes/box_btm_q06.gif",
	"images/quotes/box_btm_q07.gif",
	"images/quotes/box_btm_q08.gif",
	"images/quotes/box_btm_q09.gif",
	"images/quotes/box_btm_q10.gif",
	"images/quotes/box_btm_q11.gif",
	"images/quotes/box_btm_q12.gif",
	"images/quotes/box_btm_q13.gif",
	"images/quotes/box_btm_q14.gif",
	"images/quotes/box_btm_q15.gif",
	"images/quotes/box_btm_q16.gif",
	"images/quotes/box_btm_q17.gif",
	"images/quotes/box_btm_q18.gif",
	"images/quotes/box_btm_q19.gif",
	"images/quotes/box_btm_q20.gif",
	"images/quotes/box_btm_q21.gif",
	"images/quotes/box_btm_q22.gif",
	"images/quotes/box_btm_q23.gif",
	"images/quotes/box_btm_q24.gif",
	"images/quotes/box_btm_q25.gif")

	function choosePic() {

	if (document.images) {

	randomNum =

	Math.floor((Math.random() * 25)) % 75

	document.myPicture.src = myPix[randomNum]

	}

	}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
    RH();
}

// ----- BEGIN: FOR OPENING GENERAL POPUP WINDOWS -----
function OpenPopup(URL, width, height) {
	window.self.name = "main";
	var now = new Date();
	var remote = window.open(URL, "popup" + now.getTime(), "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,resizable=1,status=1,menubar=0,scrollbars=0");
}

function OpenScrollingPopup(URL, width, height) {
	window.self.name = "main";
	var now = new Date();
	var remote = window.open(URL, "popup" + now.getTime(), "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,resizable=1,status=1,menubar=0,scrollbars=yes");
}
// ----- END: FOR OPENING GENERAL POPUP WINDOWS -----



// ----- BEGIN: FOR OPENING SPECIAL POPUP WINDOWS -----
function openPopUnder() {
	if(getCookie('PopUnder') == ''  &&  getCookie('HSID') != ''  &&  parseInt(navigator.appVersion) >= 4) {
		var dtmExp = new Date();
		dtmExp.setTime(dtmExp.getTime() + (24 * 60 * 60 * 1000));  // 24-hour expiry
		setCookieWithPath('PopUnder', 'true', '/', dtmExp.toGMTString());

		var strURL = addStdArgsToURL('/Ads/PopUnderPop.asp');

		var winPopUnder = window.open(strURL, 'PopUnder', 'resizable=yes,status=no,toolbar=no,location=no,menu=no,scrollbars=no,width=730,height=310');

		if(navigator.appName.indexOf('Microsoft') == -1 || parseInt(navigator.appVersion) > 4)
			winPopUnder.blur();
		window.self.focus();
	}
}

function openMessenger(agentID,agentScreenName,emailURL,promoURL,ftmlsid,ftmlsalias,fthsid,ftspg,ftsid,ftaid,ftlid,ftctype){
	var url = "http://homestoreimlink.facetime.net/messengerLaunch.html" + "?agentID=" + agentID + "&agentScreenName=" + escape(agentScreenName) + "&emailURL=\"" + emailURL + "\"" + "&promoURL=\"" + promoURL + "\"" + "&mlsid=" + escape(ftmlsid) + "&mlsalias=" + escape(ftmlsalias) + "&aid=" + escape(ftaid) + "&lid="  + escape(ftlid) + "&ctype=" + escape(ftctype) + "&spg="  + escape(ftspg) + "&HSID=" + escape(fthsid) + "&sid=" + escape(ftsid);

	var urlRD = addStdArgsToURL("/Redir/Redir.asp?target=" + escape(url) );
	window.open(urlRD,'_blank','width=3,height=3');

}

function softpop() {
	var strGateway = getGateway();
	if(strGateway == "homestore" || strGateway == "realtor" || strGateway == "" || strGateway.substring(0, 2) == "go" || strGateway.substring(0, 3) == "aol" || strGateway.substring(0, 6) == "excite") {
		if(getCookie('MEMUSER') == ''  &&  getCookie('HSSoftgate') == '') {
			var intRandomNumber = Math.floor(Math.random() * 100 + 1);
			var intMagicNumber = 100;
			if(intRandomNumber <= intMagicNumber) {
				var mydate = new Date();
				mydate.setHours(23);
				mydate.setMinutes(59);
				mydate.setSeconds(59);
				var strSoftGateCookie = "HSSoftgate" + "=" + "True" + ";expires=" + mydate.toGMTString() + "; Path=/" ;
				document.cookie = strSoftGateCookie;
				OpenScrollingPopup("/Redir/Redir_CreateProfile.asp?Target=/persplanout/SignUp1Pop.asp?DSF1=True&gate=" + strGateway,350,550); return true;
			}
		}
	}
}
function softpopUReg(strURL) {
	if(getCookie('HSAuth') == ''  &&  getCookie('HSSoftgate') == '') {
		var strGateway = getGateway();
		if(strGateway == 'homestore' || strGateway == 'realtor' || strGateway == '' || strGateway.substring(0, 2) == 'go' || strGateway.substring(0, 3) == 'aol' || strGateway.substring(0, 6) == 'excite') {
			var intRandomNumber = Math.floor(Math.random() * 100 + 1);
			var intMagicNumber = 100;
			if(intRandomNumber <= intMagicNumber) {
				var mydate = new Date();
				mydate.setHours(23);
				mydate.setMinutes(59);
				mydate.setSeconds(59);
				var strSoftGateCookie = 'HSSoftgate=True;expires=' + mydate.toGMTString() + '; Path=/';
				document.cookie = strSoftGateCookie;
				OpenScrollingPopup(strURL + "?DSF2=True&poe=Realtor&gate=" + strGateway,400,500); 			return true;
			}
		}
	}
}
// ----- END: FOR OPENING SPECIAL POPUP WINDOWS -----
