
document.write("<div id='dhtmltooltip'></div>");

	var offsetxpoint=-100 //Customize x offset of tooltip
	var offsetypoint=15 //Customize y offset of tooltip
	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
	
	function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}
	
	function ddrivetip(thetext, thecolor, thewidth){
	if (ns6||ie){
	if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
	if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
	tipobj.innerHTML=thetext
	enabletip=true
	return false
	}
	}
	
	function positiontip(e){
	if (enabletip){
	var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
	var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
	var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
	
	var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
	
	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<tipobj.offsetWidth)
	//move the horizontal position of the menu to the left by it's width
	tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
	else if (curX<leftedge)
	tipobj.style.left="5px"
	else
	//position the horizontal position of the menu where the mouse is positioned
	tipobj.style.left=curX+offsetxpoint+"px"
	
	//same concept with the vertical position
	if (bottomedge<tipobj.offsetHeight)
	tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
	else
	tipobj.style.top=curY+offsetypoint+"px"
	tipobj.style.visibility="visible"
	}
	}
	
	function hideddrivetip(){
	if (ns6||ie){
	enabletip=false
	tipobj.style.visibility="hidden"
	tipobj.style.left="-1000px"
	tipobj.style.backgroundColor=''
	tipobj.style.width=''
	}
	}
	
	document.onmousemove=positiontip
	
                  function generic_generateHTMLSnippet(index){
                        var win = window.open('about:blank', 'win', 'menubar=1,scrollbars=1,resizable=1,width=850,height=650');
                        var innerText = '';
						
						
  
                              innerText = '';
                              innerText += '&lt;';
							  innerText += 'div';
							  innerText += '&gt;';
  							  innerText += '<br>';
							  innerText += '&lt;';
                              innerText += 'iframe name="blognwsnap" ';
                              innerText += 'name="blognwsnap" ';
							  innerText += 'marginwidth="0" ';
							  innerText += 'marginheight="0" ';
							  innerText += 'width="100%" height="500px" ';
							  innerText += 'frameborder="0"  ';
							  innerText += 'src="http://www.homescopes.com/getblogsnap.php"';
							  innerText += '&gt;';
   							  innerText += '<br>';

                              innerText += '&lt;';
							  innerText += '/iframe';
							  innerText += '&gt;'; 
   							  innerText += '<br>';
                              innerText += '&lt;';
							  innerText += '/div';
							  innerText += '&gt;';
                              
                              outputHTML = '<!-- Copy and paste This snippet to your blog or website -->';
                              outputHTML = '';


                              outputHTML += '<div>';
                              outputHTML += '      <iframe id="blognwsnap" ';
                              outputHTML += '              name="blognwsnap" ';
                              outputHTML += '              marginwidth="0" ';
                              outputHTML += '              marginheight="0" ';
                              outputHTML += '              width="100%" ';
                              outputHTML += '              height="650px" ';
                              outputHTML += '              scrolling="no" ';
                              outputHTML += '              frameborder="0" ';
                              outputHTML += '              style="overflow: hidden; ';
							  outputHTML += '	border: none; margin:0px; padding:0px;" ';
                              outputHTML += '              src="http://homescopes.com/getblogsnap.php">; ';
                              outputHTML += '      </iframe>';
                              outputHTML += '</div>';
                             
                              win.document.open();
                              win.document.write('<html><head><title>Code Snippet & Previewer</title></head><body style="font-family: Verdana, Geneva, Arial, Helvetica, sans;"><div><b>Copy this code snippet (preview is on right) and paste into your website or blog:</b><br /></div><div style="width: 100%; display: table-cell;"><div style="width: 65%; height:450px; float: left; position: relative; top: 0px; border: solid 1px #000000; font-family: \'courier new\', sans-serif; overflow: scroll;">'+innerText+'</div><div style="float: right; width: 30%; position: relative; top: 50px;">'+outputHTML+'</div></div></body></html>');
                              win.document.close();
                  }


function group_feed_widget(obj)
{
	
	var style = "<style>\n#divt {position:relative;padding-top:5px;width:100%}\n";
	//style += "#nw_main_box {font-family:arial;position:relative;padding-top:0px;width:"+nw_widget_width+"px; border-left:1px solid "+nw_widget_color+";border-right:1px solid "+nw_widget_color+"; }\n";
		style += "#nw_main_box {font-family:arial;position:relative;padding-top:0px;width:"+nw_widget_width+"px; border-left:1px solid #999999;border-right:1px solid #999999; border-top:1px solid #999999; border-bottom:1px solid #999999;}\n";

	style += "#nw_text_box {position:relative;padding-left:5px;padding-right:5px;padding-bottom:0px;font-size:14px}\n";
	style += "#nw_desc_box {position:relative;padding-left:5px;padding-right:5px;padding-bottom:5px;font-size:12px}\n";
	style += "#nw_main_link {color:"+nw_main_link_color+"; text-decoration:none;padding-left:3px;font-weight:bold; font-size:12px;}\n";
	//style += "#nw_main_header {position:relative;padding-top:0px;width:100%; height:20px; background-color:"+nw_widget_color+";}\n";
	style += "#nw_main_header {position:relative;padding-top:0px;width:100%; height:0px; background-color:"+nw_widget_color+";}\n";

	style += "#nw_bloglink_box {padding:3px 2px 5px 2px; background: transparent;}\n";
	style += "#nw_bloglink_box a {font-family:arial; font-size:12px; color:#006600; text-decoration:none;}\n";
	style += "#nw_bloglink_box a:hover {color:navy; background-color: #FFCC00;}\n";
	style += "#divta {position:absolute;top:-5px;right:3px;width:27px;height:16px;}\n";
	style += "#nw_main_footer {position:relative;padding-top:0px;width:100%; height:40px; font-family:arial; background-color:"+nw_widget_color+";padding-top:5px;text-align:center;}\n";
	style += "#dhtmltooltip{position: absolute;width: 100px;border: 1px solid #339900;padding: 2px;background-color:#bdfd40;visibility: hidden;z-index: 100;filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);}";
	
	style += ".formbutton{cursor:pointer;border:outset 1px #ccc;background:#999;color:#666;font-weight:bold;padding: 1px 2px;background:url(http://realivent.com/images/formbg2.gif) repeat-x left top;}";

	style += "<\/style>\n\n";
	
	document.write(style);
	
	var i
	var text_div = '';
	var number = '';
	
	text_div += "<div style='padding:5px; font-size:12px;'><div style='text-align:center'><a target='_top' href='http://www.homescopes.com' ><img border='0' src='http://www.homescopes.com/images/Logo/homescopes_logo.png' /></a></div><br><div><b>Blog Network Stats</b></div><br><div style='color:AA0044;'>Total Posts: <b> "+obj[0].article_count+" </b></div>";
	text_div += "<div style='color:AA0044'>Member Blogsites: <b> "+obj[1].blog_count+" </b></div></div><br><div style='padding-left:3px; font-size:14px;'><b>Recent Blog Posts</b></div><br>";
	
	for(i = 2 ; i < obj.length ; i++)
	{
		
	var post_title;
	
	post_title = (obj[i][0].post_title).substring(0,30);
	
		//text_div += "<div id='nw_bloglink_box'><a target='_top';  href='"+obj[i][0].guid+"'>"+obj[i][0].post_title+"</a></div>"
		
		text_div += "<div id='nw_bloglink_box'><a target='_top';  href='"+obj[i][0].guid+"'>"+post_title+"</a></div>"
	}
	
	
	var main_div = '';
	main_div = "<div id='nw_main_box'><div id='nw_main_header'><div id='topleft'></div><div id='topright'></div></div>"+text_div+"<div style='height:10px;'></div><div id='nw_main_footer'><div id='bottomleft'></div><div id='bottomright'></div><div id='nw_footer_image'></div><a id='nw_main_link' href='http://www.homescopes.com' target='_top'>Homescopes.com</a><div align='center'><form action='' method='post' style='width: 100%; padding-top:3px;'><input type='button' class='formbutton' value='Get Widget' onclick='generic_generateHTMLSnippet()' /></form></div></div></div>";
	
	
	document.write(main_div);
	
	

}