function validate_form(){

	elm_array = document.subscribeForm.elements;	
	for(i=0;i<elm_array.length;i++){	
	  if(elm_array[i].value == ""){	
	   if(elm_array[i].name == "Name"){
	   		alert("Please enter Name.");
	   		return false; 		   }
	   if(elm_array[i].name == "Email"){
	   		alert("Please enter Email Address.");
	   		return false; 
	   }  
	  }
	}	
	return true; 
}


function swapStyle0(theHref) {
 	var sOption="toolbar=yes,location=no,directories=yes,menubar=no,scrollbars=yes,width=600,left=100,top25"; 

 	var  sPageText2 = document.getElementById('main').innerHTML;

 	var  sTitle=document.title;
 	var  sUrl=document.location;
 	var winprint=window.open("","",sOption); 
 	   winprint.document.open(); 
 	   winprint.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"print.css\" ><title>"+sTitle+"</title></head><body bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"5\" rightmargin=\"0\" marginheight=\"0\" marginwidth=\"0\">"); 
 	   winprint.document.write("<center><table width=\"600\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td valign=\"top\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"95%\" class=\"textpage\" >");
 	   winprint.document.write("<tr><td width=180 align=\"left\" ><img src=\"img/print_logo.gif\" alt=\"Net Land Realty, Inc.\" width=\"92\" height=\"77\" border=\"0\"><BR></td><td align=left >&nbsp;&nbsp;&nbsp;<strong>");
 	   winprint.document.write(sTitle);
 	   winprint.document.write("</strong></td><td align=\"right\" ><strong><strong><a href=\"javascript:window.print();\">Print</a>&nbsp;|&nbsp;<a href=\"javascript:window.close();\">Close</a></strong></td></tr></table>");

 	   winprint.document.write("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"600\" ><tr><td height=\"2\" align=\"left\" valign=\"top\" bgcolor=\"000000\"></td></tr></table><BR><BR>");
	 

	   winprint.document.write("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"600\" ><tr><td align=\"left\" valign=\"top\" >");
  winprint.document.write(sPageText2);
winprint.document.write("</td></tr>");
winprint.document.write("</table><table><tr><td align=\"left\" valign=\"top\" >");
winprint.document.write("</strong></font><BR><BR><font size=1><center>&copy;2008 Net Land Realty, Inc.</center></font>");
 winprint.document.write("<BR><strong><font size=1>Reprinted from:<BR>"); 
 	   winprint.document.write(sUrl)
winprint.document.write("</td></tr></table><BR><BR>");
 	   winprint.document.write("</center></body></html>"); 
 	   winprint.document.close(); 
 	   winprint.focus(); 
 	return false; //cancels link action
 }




var hpwindowname;

function sendtofriend(){
if(hpwindowname){
if(!hpwindowname.closed) hpwindowname.close();
}
hpwindowname = window.open("tell_a_friend.asp","hpwindowname","width=330, height=406,scrollbars=0,location=0,status=0,resizable=0,menubar=0,toolbars=0");
hpwindowname.focus();
}

function changeParent(newURL)
{
	opener.document.location = newURL;
	opener.document.focus();
	window.close();
}

function rssfeed(){
if(hpwindowname){
if(!hpwindowname.closed) hpwindowname.close();
}
hpwindowname = window.open("rss_instruct.html","hpwindowname","width=470, height=480,scrollbars=1,location=0,status=0,resizable=1,menubar=0,toolbars=0");
hpwindowname.focus();
}

   
function getElementById( id )
         {
            if (document.layers)
            {
               var obj = document.layers( id );
               if ( obj != null )
               {
                  return obj;
               }
            }

            if (document.all)
            {
               var obj = document.all( id );
               if ( obj != null )
               {
                  return obj;
               }
            }

            if (document.getElementById)
            {
               var obj = document.getElementById( id );
               if ( obj != null )
               {
                  return obj;
               }
            }

            return document[ id ];
         }

function tooltip_findPosX(obj)
{
  var curleft = 0;
  if (obj.offsetParent)
  {
    while (obj.offsetParent)
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function tooltip_findPosY(obj)
{
    var curtop = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}

function show_tooltip(tooltipId, parentId, posX, posY)
{
    it = getElementById(tooltipId);

    if ((it.style.top == '' || it.style.top == 0)
        && (it.style.left == '' || it.style.left == 0))
    {
        // need to fixate default size (MSIE problem)
        it.style.width = it.offsetWidth + 'px';
        it.style.height = it.offsetHeight + 'px';

        img = document.getElementById(parentId);

        // if tooltip is too wide, shift left to be within parent
        if (posX + it.offsetWidth > img.offsetWidth) posX = img.offsetWidth - it.offsetWidth;
        if (posX < 0 ) posX = 0;

        x = tooltip_findPosX(img) + posX;
        y = tooltip_findPosY(img) + posY;

        it.style.top = y + 'px';
        it.style.left = x + 'px';
    }

    it.style.visibility = 'visible';
}

function hide_tooltip(id)
{
    it = getElementById(id);
    it.style.visibility = 'hidden';
}

function rollover(what_state, img, extension, img_path){

var state = what_state;
var img_name = img;
var ftype = extension;
var ipath = img_path;

if (ipath == 0) {
	ipath = "/img/";
}
else if (ipath == 1) {
	ipath = "img/";
}
else if (ipath == 2) {
	ipath = "../img/";
}

if (state == "on" ) {
var img_src = ipath + img_name + "_on." + ftype;
document[img_name].src = img_src;
}
else if( state == "off") {
var img_src = ipath + img_name + "_off." + ftype;
document[img_name].src = img_src;
}
}

function rollover(what_state, img, extension, img_path){
var state = what_state;
var img_name = img;
var ftype = extension;
var ipath = img_path;
if (ipath == 0) {
	ipath = "/img/";}
else if (ipath == 1) {
	ipath = "img/";

}
else if (ipath == 2) {
	ipath = "../img/";
}
if (state == "on" ) {
var img_src = ipath + img_name + "_on." + ftype;
document[img_name].src = img_src;
}
else if( state == "off") {
var img_src = ipath + img_name + "_off." + ftype;
document[img_name].src = img_src;
}
}

function loadImages() { 
 var d=document; if(d.images){ if(!d.p) d.p=new Array();
  var i,j=d.p.length,a=loadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
