// get required auth info
if (typeof embed_authKey === 'undefined') { embed_authKey = false;}

//set default result attributes here
if (typeof embed_ResultShowDesc === 'undefined') { embed_ResultShowDesc = false;}
if (typeof embed_ResultImages === 'undefined') { embed_ResultImages = true;}
if (typeof embed_ResultLimit === 'undefined') { embed_ResultLimit = 10;}
if (typeof embed_ResultShowNext === 'undefined') { embed_ResultShowNext = true;}

// set appearance attributes here
if (typeof embed_Title === 'undefined') { embed_Title = "Featured Listings";}
if (typeof embed_BackgroundColor === 'undefined') { embed_BackgroundColor = "#F4F4F4";}
if (typeof embed_BorderColor === 'undefined') { embed_BorderColor = "#CCCCCC";}
if (typeof embed_BorderStyle === 'undefined') { embed_BorderStyle = "solid";}
if (typeof embed_BorderWidth === 'undefined') { embed_BorderWidth = 1;}
if (typeof embed_Height === 'undefined') { embed_Height = 300;}
if (typeof embed_Width === 'undefined') { embed_Width = 300;}


// alright, you had your chance. NOW STEP OFF 
var paginationNum = 0;
if(!document.getElementById(embed_authKey)) { document.write("<ins id='"+embed_authKey+"'></ins>");}
var targetFrame = document.getElementById(embed_authKey);
var embed = document.createElement('div');
embed.id = "diggerslistEmbed";
embed.style.background = embed_BackgroundColor;
embed.style.borderColor = embed_BorderColor;
embed.style.borderStyle = embed_BorderStyle;
embed.style.borderWidth = embed_BorderWidth+"px";
embed.style.height = embed_Height+"px";
embed.style.width = embed_Width+"px";

var embed_titleBar = document.createElement('div');
embed_titleBar.style.background = "url(http://www.diggerslist.com/syndication/styles/images/greenTitleBar.jpg) repeat-x top left";
embed_titleBar.style.height = "40px";
embed_titleBar.style.width = "100%";

if(embed_Title) {
var embed_title_title = document.createElement('div');
embed_title_title.style.fontFamily = "Arial, Helvetica, sans-serif";
embed_title_title.style.fontSize = "16px";
embed_title_title.style.fontWeight = "bold";
embed_title_title.style.color = "#FFFFFF";
embed_title_title.style.width = "170px";
embed_title_title.style.padding = "12px 0px 8px 10px";
embed_title_title.style.margin = "0px";
embed_title_title.style.cssFloat = "left";
embed_title_title.style.styleFloat = "left";
var embed_title_titleText = document.createTextNode(embed_Title.substring(0,20));
embed_title_title.appendChild(embed_title_titleText);
embed_titleBar.appendChild(embed_title_title);
}

var embed_title_logo = document.createElement('div');
embed_title_logo.style.width = "120px";
embed_title_logo.style.margin = "0px";
embed_title_logo.style.cssFloat = "right";
embed_title_logo.style.styleFloat = "right";
var embed_title_logoLink = document.createElement('a');
embed_title_logoLink.href = "http://www.diggerslist.com";
embed_title_logoLink.target = "_blank";
var embed_title_logoImg = document.createElement('img');
embed_title_logoImg.src = "http://www.diggerslist.com/syndication/styles/images/poweredByLogo_greenBlackWhite.jpg";
embed_title_logoImg.className = "DLTopLogo";
embed_title_logoImg.border = "0";
embed_title_logoLink.appendChild(embed_title_logoImg);
embed_title_logo.appendChild(embed_title_logoLink);
embed_titleBar.appendChild(embed_title_logo);

embed.appendChild(embed_titleBar);

var embed_results = document.createElement('iframe');
embed_results.id = "diggerslistEmbed_results";
params = "browse="+paginationNum+"&limit="+embed_ResultLimit+"&ref="+window.location.host+"&showDesc="+embed_ResultShowDesc+"&showImg="+embed_ResultImages;
embed_results.setAttribute("src", "http://www.diggerslist.com/widget/"+embed_authKey+"/?"+params);
embed_results.style.background = "none";
embed_results.style.border = "none";
embed_results.style.height = (embed_Height-40)+"px";
embed_results.style.width = embed_Width+"px";

embed.appendChild(embed_results);

targetFrame.parentNode.insertBefore(embed,targetFrame);



