﻿/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.

var defaultimageheight = 40;	// maximum image size.
var defaultimagewidth = 40;	// maximum image size.

var timer;

function gettrailobj(){
if (document.getElementById)
return document.getElementById("preview_div").style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("preview_div")
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function hidetrail(){	
	gettrailobj().display= "none";
	document.onmousemove=""
	gettrailobj().left="-500px"
	clearTimeout(timer);
}


function showtrail(h,l,f){
	timer = setTimeout("show('" + h + "','" + l + "','" + f + "');", 200);
}

function show(H,L,F){
    var width = 425;
    var height= 590;
    
    var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse[0]
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if( (navigator.userAgent.indexOf("Konqueror")==-1  || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
		( width == 0 ) ? width = defaultimagewidth: '';
		( height == 0 ) ? height = defaultimageheight: '';
			
		width+=30
		height+=55
		defaultimageheight = height
		defaultimagewidth = width
	
		document.onmousemove=followmouse; 

	
          newHTML = '<table width="100" border="0" cellpadding="0" cellspacing="0" class="thick_black_box"><!--<tr><td height="15" align="center" class="brickfont">[This is just a preview. Actual flyer size is larger.]</td></tr>--><tr><td>';	
          newHTML = newHTML + '<table width="100" border="0" cellpadding="0" cellspacing="0">'
          newHTML = newHTML + '<tr><td><img src="' + H + '" alt=""/></td></tr>'
          newHTML = newHTML + '<tr><td><img src="' + L + '" alt=""/></td></tr>'
          newHTML = newHTML + '<tr><td><img src="' + F + '" alt=""/></td></tr>'
          newHTML = newHTML + '</table></td></tr></table>'	
          
		if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
			//newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
		}		

		gettrailobjnostyle().innerHTML = newHTML;
		gettrailobj().display="block";
	}
}

function showhelp(content){
	timer = setTimeout("showHelp(" + content + ");", 200);
}

function showHelp(content){

    var offsetfrommouse2=[0,0];
    var width = 600;
    var height= 5;
    
    var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse2[0]
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)
	if( (navigator.userAgent.indexOf("Konqueror")==-1  || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
		( width == 0 ) ? width = defaultimagewidth: '';
		( height == 0 ) ? height = defaultimageheight: '';
		
		width+=0
		height+=0
		defaultimageheight = height
		defaultimagewidth = width
	
		document.onmousemove=followmouse; 
		
        newHTML = '<table width="600" border="0" cellpadding="0" cellspacing="0" class="help_box"><tr><td valign="middle">';	
        newHTML = newHTML + '<table width="100%" border="0" cellpadding="3" cellspacing="3"><tr><td align="left" valign="middle">'

        newHTML1 = '<table width="250" border="0" align="right" cellpadding="0" cellspacing="0" class="help_box"><tr><td valign="middle">';	
        newHTML1 = newHTML1 + '<table width="100%" border="0" cellpadding="3" cellspacing="3"><tr><td align="left" valign="middle">'

        switch(content)
        {
            case 1:
            newHTML = newHTML + helpDeliveryDate
            break;
            case 2:
            newHTML = newHTML + helpEmailSubject
            break;
            case 3:
            newHTML = newHTML + helpPropertyAddress
            break; 
            case 4:
            newHTML = newHTML + helpPropertyDesc
            break; 
            case 5:
            newHTML = newHTML + helpPropertyHighlights
            break;  
            case 6:
            newHTML = newHTML + helpCustomeFields
            break;  
            case 7:
            newHTML = newHTML + helpLinks
            break;    
            case 8:
            newHTML = newHTML + helpLogos
            break;
            case 9:
            newHTML = newHTML1 + helpZillow
        }
        
        newHTML = newHTML + '</td></tr>'
        newHTML = newHTML + '</table></td></tr></table>'	
          
		if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
			newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="20" height="'+height+'"></iframe>';
		}		

		gettrailobjnostyle().innerHTML = newHTML;
		gettrailobj().display="block";
	}
}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}

// Loader Begin

var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;

function animate()
{
var elem = document.getElementById('progress');
if(elem != null) {
if (pos==0) len += dir;
if (len>32 || pos>79) pos += dir;
if (pos>79) len -= dir;
if (pos>79 && len==0) pos=0;
elem.style.left = pos;
elem.style.width = len;
}
}

function remove_loading() {
this.clearInterval(t_id);
var targelem = document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
var t_id = setInterval(animate,60);
}

// Loader End



var helpDeliveryDate = '<span class="helpTitle">';
helpDeliveryDate = helpDeliveryDate + 'Flyer Delivery Date:';
helpDeliveryDate = helpDeliveryDate + '</span><br/>';
helpDeliveryDate = helpDeliveryDate + '<span class="helpContent">';
helpDeliveryDate = helpDeliveryDate + 'Enter the date on which you like this flyer to be delivered.';
helpDeliveryDate = helpDeliveryDate + '</span>';
helpDeliveryDate = helpDeliveryDate + '<br/>'
helpDeliveryDate = helpDeliveryDate + '<img src="images/space.gif" height="5" width="1"><br/>';

helpDeliveryDate = helpDeliveryDate +'<span class="helpTitle">';
helpDeliveryDate = helpDeliveryDate + 'MLS Number:';
helpDeliveryDate = helpDeliveryDate + '</span><br/>';
helpDeliveryDate = helpDeliveryDate + '<span class="helpContent">';
helpDeliveryDate = helpDeliveryDate + 'Enter MLS number of the property. This is an optional field.';
helpDeliveryDate = helpDeliveryDate + '</span>';
helpDeliveryDate = helpDeliveryDate + '<br/>'
helpDeliveryDate = helpDeliveryDate + '<img src="images/space.gif" height="5" width="1"><br/>';

helpDeliveryDate = helpDeliveryDate +'<span class="helpTitle">';
helpDeliveryDate = helpDeliveryDate + 'Price/Rent:';
helpDeliveryDate = helpDeliveryDate + '</span><br/>';
helpDeliveryDate = helpDeliveryDate + '<span class="helpContent">';
helpDeliveryDate = helpDeliveryDate + 'Enter price or rent of the propert here. Only enter digits without space or comma. Select other rent or pricing infromation from dropdowns if needed.';
helpDeliveryDate = helpDeliveryDate + '</span>';
helpDeliveryDate = helpDeliveryDate + '<br/>'
helpDeliveryDate = helpDeliveryDate + '<img src="images/space.gif" height="5" width="1"><br/>';
helpDeliveryDate = helpDeliveryDate + '<img border="1" src="images/help/mlsnumber.jpg"/>';


var helpEmailSubject = '<span class="helpTitle">';
helpEmailSubject = helpEmailSubject + 'Email Subject:';
helpEmailSubject = helpEmailSubject + '</span><br/>';
helpEmailSubject = helpEmailSubject + '<span class="helpContent">';
helpEmailSubject = helpEmailSubject + 'Enter a catchy text here. Your flyer will be emailed to other agents or clients. The text specified by you in this field will be used as a subject line for delivering the mail.';
helpEmailSubject = helpEmailSubject + '</span>';
helpEmailSubject = helpEmailSubject + '<br/>'
helpEmailSubject = helpEmailSubject + '<img src="images/space.gif" height="5" width="1"><br/>';

helpEmailSubject = helpEmailSubject +'<span class="helpTitle">';
helpEmailSubject = helpEmailSubject + 'Flyer Title & Flyer Sub Title:';
helpEmailSubject = helpEmailSubject + '</span><br/>';
helpEmailSubject = helpEmailSubject + '<span class="helpContent">';
helpEmailSubject = helpEmailSubject + 'Enter an appealing and descriptive heading for your flyer here.';
helpEmailSubject = helpEmailSubject + '</span>';
helpEmailSubject = helpEmailSubject + '<br/>'
helpEmailSubject = helpEmailSubject + '<img src="images/space.gif" height="5" width="1"><br/>';
helpEmailSubject = helpEmailSubject + '<img border="1" src="images/help/flyertitle.jpg"/>';

var  helpPropertyAddress = '<span class="helpTitle">';
helpPropertyAddress = helpPropertyAddress + 'Property Address (Address1, Address2, City, State & Zipcode):';
helpPropertyAddress = helpPropertyAddress + '</span><br/>';
helpPropertyAddress = helpPropertyAddress + '<span class="helpContent">';
helpPropertyAddress = helpPropertyAddress + 'Provide address of the property here. A valid property address is required to show location on the map.';
helpPropertyAddress = helpPropertyAddress + '</span>';
helpPropertyAddress = helpPropertyAddress + '<br/>'
helpPropertyAddress = helpPropertyAddress + '<img src="images/space.gif" height="5" width="1"><br/>';
helpPropertyAddress = helpPropertyAddress + '<img border="1" src="images/help/propaddress.jpg"/>';

var  helpPropertyDesc = '<span class="helpTitle">';
helpPropertyDesc = helpPropertyDesc + 'Property Description:';
helpPropertyDesc = helpPropertyDesc + '</span><br/>';
helpPropertyDesc = helpPropertyDesc + '<span class="helpContent">';
helpPropertyDesc = helpPropertyDesc + 'Provide a short & snappy description of your property here. Do not cover topics like number of rooms etc as we have provided custom fields for the same below.';
helpPropertyDesc = helpPropertyDesc + '</span>';
helpPropertyDesc = helpPropertyDesc + '<br/>'
helpPropertyDesc = helpPropertyDesc + '<img src="images/space.gif" height="5" width="1"><br/>';
helpPropertyDesc = helpPropertyDesc + '<img border="1" src="images/help/propdesc.jpg"/>';


var  helpPropertyHighlights = '<span class="helpTitle">';
helpPropertyHighlights = helpPropertyHighlights + 'Property Bullets or Highlights:';
helpPropertyHighlights = helpPropertyHighlights + '</span><br/>';
helpPropertyHighlights = helpPropertyHighlights + '<span class="helpContent">';
helpPropertyHighlights = helpPropertyHighlights + 'Enter the property highlights here.';
helpPropertyHighlights = helpPropertyHighlights + '</span>';
helpPropertyHighlights = helpPropertyHighlights + '<br/>'
helpPropertyHighlights = helpPropertyHighlights + '<img src="images/space.gif" height="5" width="1"><br/>';
helpPropertyHighlights = helpPropertyHighlights + '<img border="1" src="images/help/prophighlights.jpg"/>';

var  helpCustomeFields = '<span class="helpTitle">';
helpCustomeFields = helpCustomeFields + 'Custom Fields:';
helpCustomeFields = helpCustomeFields + '</span><br/>';
helpCustomeFields = helpCustomeFields + '<span class="helpContent">';
helpCustomeFields = helpCustomeFields + 'Provide more property details using these custom fields. Enter label (like Bedrooms, Sq. Footage, Pets etc.) in the first box and then its corressponding value (like 4, 3500, Allowed etc.) to the box on right.';
helpCustomeFields = helpCustomeFields + '</span>';
helpCustomeFields = helpCustomeFields + '<br/>'
helpCustomeFields = helpCustomeFields + '<img src="images/space.gif" height="5" width="1"><br/>';
helpCustomeFields = helpCustomeFields + '<img border="1" src="images/help/customfields.jpg"/>';


var helpLinks = '<span class="helpTitle">';
helpLinks = helpLinks + 'MLS or More Info Link:';
helpLinks = helpLinks + '</span><br/>';
helpLinks = helpLinks + '<span class="helpContent">';
helpLinks = helpLinks + 'Enter a URL or web link that provides more detail about this property, like a link to MLS page or some other website.';
helpLinks = helpLinks + '</span>';
helpLinks = helpLinks + '<br/>'
helpLinks = helpLinks + '<img src="images/space.gif" height="5" width="1"><br/>';

helpLinks = helpLinks +'<span class="helpTitle">';
helpLinks = helpLinks + 'Virtual Tour Link:';
helpLinks = helpLinks + '</span><br/>';
helpLinks = helpLinks + '<span class="helpContent">';
helpLinks = helpLinks + 'If you have a virtual tour created for this property, enter its URL or web link here.';
helpLinks = helpLinks + '</span>';
helpLinks = helpLinks + '<br/>'
helpLinks = helpLinks + '<img src="images/space.gif" height="5" width="1"><br/>';

helpLinks = helpLinks +'<span class="helpTitle">';
helpLinks = helpLinks + 'Map Link:';
helpLinks = helpLinks + '</span><br/>';
helpLinks = helpLinks + '<span class="helpContent">';
helpLinks = helpLinks + 'Select "Use My Map Link" if you have a map create for this property and enter its URL or web link in the box below. Or select "Use FREE Google Map" that will show Flyerus map page with this property plotted on the Google Maps. Or select "No Map Link Please" for no map link.';
helpLinks = helpLinks + '</span>';
helpLinks = helpLinks + '<br/>'
helpLinks = helpLinks + '<img src="images/space.gif" height="5" width="1"><br/>';
helpLinks = helpLinks + '<img border="1" src="images/help/mlslink.jpg"/>';

var  helpLogos = '<span class="helpContent">';
helpLogos = helpLogos + 'Select the logo that you like to display on your flyer.<br/>MLS Logo:&nbsp;<img border="0" src="images/mlsLogo.gif"/>&nbsp;&nbsp;&nbsp;&nbsp;Equal Housing Logo:&nbsp;<img border="0" src="images/equalHousing.gif"/>';
helpLogos = helpLogos + '</span>';


var  helpZillow = '<span class="helpContent">';
helpZillow = helpZillow + 'By clicking this button you can fetch your property data automaticaly from Zillow.com if it exist there.';
helpZillow = helpZillow + '</span>';
