function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
	
  return xmlHttp;
}

function show_image(mlsnum,num,imagecnt,sysid)
{
if ((mlsnum == null) || (mlsnum == "") ) {
     alert("There is no mlnum available");
     return false ;
 }
  var loc = "/public/pages/media/highresmedia.jsp?mlnum=" + mlsnum + "&num=" + num + "&res=highres&imagecnt="+imagecnt+"&sysid="+sysid;
 document.location= loc;
} // end of show_image

//function show_image(mlsnum,num)
//{
//if ((mlsnum == null) || (mlsnum == "") ) {
  //   alert("There is no mlnum available");
    // return false ;
	// }
//var cntr = parent.document.pageForm.inside_report_counter.value ;
//cntr++;
//parent.document.pageForm.inside_report_counter.value = cntr;

  // var loc = "/public/common/blank3_3.jsp?req=/media/getImage.do&mlnum=" + mlsnum + "&num=" + num + "&officeid=99999";
//   parent.document.frames["report"].location= loc;
// alert("after this " + mlsnum + "," + num);
//} // end of show_image

var ht =screen.availHeight-10;
var wd =screen.availWidth-15;
var winfeature = "height="+ht+","+"width="+wd +",left=1,top=1" +",resizable=1,scrollbars=0";
var rptflag=false;
var win;

function show_report(sysid,link_type)
{
if (link_type == 'AGENT') {
		if(sysid == null) {
		 alert("There is no agentid available");
		 return false ;
		 }

		 
	win =window.open("/public/runProfileReport.do?method=getAgentProfileReport&selectedPubId="+sysid,"MEDIA",winfeature);
	win.focus();
	}else if (link_type == 'OFFICE') {
		 var officeid = sysid ;
		if(sysid == null) {
		 alert("There is no officeid available");
		 return false ;
	 }
 
 win =window.open("/public/runProfileReport.do?method=getOfficeProfileReport&selectedOfficeId="+sysid,"MEDIA",winfeature);
win.focus();
}

} // end of show_report


function open_link_bus(sysid,link_type)
{
if (link_type == "MAP") {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=BUS" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA') {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=BUS&report=" + 'BUS_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT') {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_bus


function open_link_com(sysid,link_type)
{
if (link_type == "MAP") {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=COM" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA') {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=COM&report=" + 'COM_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT') {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_com

function open_link_lnd(sysid,link_type)
{
if (link_type == "MAP")  {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=LND" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA')  {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=LND&report=" + 'lnd_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT')  {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_lnd


function open_link_mul(sysid,link_type)
{
if (link_type == "MAP")  {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
// alert(parent.document.pageForm.inside_report_counter.value);
    parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=MUL" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA')  {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
// alert(parent.document.pageForm.inside_report_counter.value);
    parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=MUL&report=" + 'mul_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT')  {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_mul


function open_link_rnt(sysid,link_type)
{
if (link_type == "MAP")  {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
    parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=RNT" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA')  {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
    parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=RNT&report=" + 'rnt_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT')  {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_rnt


function open_link_res(sysid,link_type)
{
if (link_type == "MAP")  {
    if(sysid == null){
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/mapping/getMap.do&sysid=" +sysid + "&ptype=RES" ;
                       } // do if the user wants to see the map

if (link_type == 'MEDIA')  {
    if(sysid == null) {
     alert("There is no sysid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runReport.rpt&sysid=" + sysid +  "&ptype=RES&report=" + 'res_media' ;
                       } // do if the user wants to see the map

if (link_type == 'AGENT')  {
    if(sysid == null) {
     alert("There is no agentid available");
     return false ;
	 }
var cntr = parent.document.pageForm.inside_report_counter.value ;
cntr++;
parent.document.pageForm.inside_report_counter.value = cntr;
parent.document.frames["report"].location="/public/common/blank2_2.jsp?req=/reports/runOfficeReport.rpt&report=AG_PROFILE&sysid='" + sysid + "'";
                       } // do if the user wants to see the map

} // end of open_link_res

function reload_language(obj){
   		var langValue = obj.value;
   		var report = document.all("languageForm").report.value;
   		var Id = document.all("languageForm").Id.value;
   		document.all("languageForm").method = "post";
		document.all("languageForm").action="/public/show_public_report_rpt.do?&method=getData&report="+report+"&Id="+Id+"&langValue="+langValue;
		document.all("languageForm").target="_self";
		document.all("languageForm").submit();


}

function show_highres_image(mlsnum,num,imagecnt,sysid,pubId,servername)
{
	if ((mlsnum == null) || (mlsnum == "") ) {
	     alert("There is no mlnum available");
	     return false ;
	 }
	 var loc = "/public/media.do?method=gethighresolution&mlnum=" + mlsnum + "&num=" + num + "&res=highres&imagecnt="+imagecnt+"&sysid="+sysid+"&pubid="+pubId+"&servername="+servername;
	  document.location= loc;
}

function show_highres_media(num,sysid,pubId,imagecount)
{
 if(imagecount != 0){
	var currcntval = sysid+"currentcnt";
	if(document.all(currcntval) != null){
		var currcnt =  document.all(currcntval).value;
		if(currcnt != 'null'){
			num = currcnt ;
		}
	}
	var loc = "/public/media.do?method=gethigresmedia&num=" + num + "&sysid="+sysid+"&pubid="+pubId;
	document.location= loc;
 }
} 


