

function PrintScreen()
{
  scd = new Date();
  OpenPage('PrintingFrame.asp?scd=' + scd);
}

function ShowSearch(Clear,Main,ForceRecolor)
{

 window.top.document.body.rows = '0,0,*,0,' +window.top.MenuSize+',0,0';
 window.top.Display.document.location.href='loading.asp';
 if (Clear)
  {
    window.top.SearchScreen.SearchScreen.reset();   
  }

 if (Main)
  {   
    window.top.SearchScreen.showSearch('divSearchMain',ForceRecolor);
  }

 
}


function ShowBB()
{


 window.top.document.body.rows = '0,0,0,*,0,0,0';
 window.top.Buttons.document.location.href='menubottom.asp';

}



function NYI()
 {
  alert("This feature is coming soon.");
  return
 }



function HomePage()
 {
  

 window.top.document.body.rows = '*,0,0,0,0,0,0';
  
 }






function CityList()
{
var opts = "";

opts =+  "directories=no,"
opts =+  "fullscreen=no,"
opts =+  "left=200,"
opts =+  "location=no,"
opts =+  "menubar=no,"
opts =+  "resizable=no,"
opts =+  "scrollbars=yes,"
opts =+  "status=no,"
opts =+  "toolbar=no,"
opts =+  "top=25,"
opts =+  "width=400,"
opts =+  "height=500,"

opts =+  "screenX=0,"
opts =+  "screenY=0,"


w = window.open("CityList.asp","CityList",opts);
w.focus();

}



var LoginTimeout;

function OpenLogin(MemberType)

{
LoginTimeout = setTimeout('OpenLoginTrue("' +MemberType + '")',1);
// OpenLoginTrue(MemberType);
}


function OpenLoginTrue(MemberType)
{



var opts = "";

var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;

if (sw > 700)
  {
  sw=700;
  l = (screen.width - sw) / 2;
  }


if (sh > 550)
  {
  sh=550;
  t = (screen.height - sh) / 2  ;
  }

sh=550
sw=700


opts = opts + "directories=no,"
opts = opts + "fullscreen=no,"

opts = opts + "location=no,"
opts = opts + "menubar=no,"
opts = opts + "resizable=no,"
opts = opts + "scrollbars=yes,"
opts = opts + "status=no,"
opts = opts + "toolbar=no,"
opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","


//w = window.open("Login.asp?MemberType=" + MemberType,"Login",opts);
//w.focus();


//OpenPage("Login.asp?MemberType=" + MemberType);
window.top.document.location.href="Login.asp?MemberType=" + MemberType;



}




function OpenPage(PageName)
{

var opts = "";
var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;

if (sw > 800)
  {
  sw=800;
  l = (screen.width - sw) / 2;
  }


if (sh > 600)
  {
  sh=600;
  t = (screen.height - sh) / 2  ;
  }

sh=580
sw=798


opts = opts + "directories=no,"
opts = opts + "fullscreen=no,"

opts = opts + "location=no,"
opts = opts + "menubar=no,"
opts = opts + "resizable=no,"
opts = opts + "scrollbars=yes,"
opts = opts + "status=no,"
opts = opts + "toolbar=no,"
opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","


w = window.open(PageName,"",opts);
w.focus();

}

function GB()
{


window.top.close();

}








function SendInquiry()

{



var opts = "";
var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;

if (sw > 800)
  {
  sw=800;
  l = (screen.width - sw) / 2;
  }


if (sh > 260)
  {
  sh=260;
  t = (screen.height - sh) / 2  ;
  }

sh=260
sw=798


var opts = ' ';

opts = "directories=no,";
opts = opts + "fullscreen=no,";
opts = opts +  "location=no,";
opts = opts +  "menubar=no,";
opts = opts +  "resizable=no,";
opts = opts +  "scrollbars=no,";
opts = opts +  "status=no,";
opts = opts +  "toolbar=no,";


opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","





w=window.open("SendInquiry.asp","",opts);
w.focus();

}






function CompDisc()
 {
  if (window.top.CompDiscShown==false)
  {
   window.showModalDialog("CompDisclaimer.asp","","dialogHeight:400px;dialogWidth:600px;status:no;help:no")
   window.top.CompDiscShown=true;
  }
 }



function OpenSample(PageName)
{

var opts = "";
var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;

if (sw > 760)
  {
  sw=760;
  l = (screen.width - sw) / 2;
  }


if (sh > 560)
  {
  sh=560;
  t = (screen.height - sh) / 2  ;
  }

sh=560
sw=760


opts = opts + "directories=no,"
opts = opts + "fullscreen=no,"

opts = opts + "location=no,"
opts = opts + "menubar=no,"
opts = opts + "resizable=no,"
opts = opts + "scrollbars=yes,"
opts = opts + "status=no,"
opts = opts + "toolbar=no,"
opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","


w = window.open(PageName,"",opts);
w.focus();

}













function mark(MarketID, on)
{

 var l =   document.frmCity.City.length ;
 
if (l>0)
{

 for (i=0;i<l;i++)
  {
    document.frmCity.City[i].checked=on ; 
  }
}
else
{
    document.frmCity.City.checked=on ; 
}
 

   var opts = "";

   opts += "directories=no,"
   opts += "fullscreen=no,"
   opts += "left=10000,"
   opts += "location=no,"
   opts += "menubar=no,"
   opts += "resizable=no,"
   opts += "scrollbars=no,"
   opts += "status=yes,"
   opts += "toolbar=no,"
   opts += "top=175,"
   opts += "width=600,"
   opts += "height=250,"
   opts += "screenX=0,"
   opts += "screenY=0,"



  window.open("SelectMarket.asp?MarketID=" + MarketID + "&select=" + on ,"",opts);



}



function ShowImages(ID,type,first)
 {

  var opts = "";


  sh=600;
  sw=800;

  var l=(screen.width - sw) / 2;
  var t=(screen.height - sh) / 2 ;

  opts = opts + "directories=no";
  opts = opts + ",fullscreen=no";
  opts = opts + ",location=no";
//  opts = opts + ",menubar=yes";
//  opts = opts + ",resizable=yes";
  opts = opts + ",scrollbars=yes";
 // opts = opts + ",status=yes";
 // opts = opts + ",toolbar=yes";
  opts = opts + ",top=" + t ; 
  opts = opts + ",left=" + l ;
  opts = opts + ",width=" + sw ;
  opts = opts + ",height=" + sh   ;



 window.open("Photo.asp?ID=" + ID + "&type=" + type + "&first=" + first ,"Photo",opts,false);

 }



function MoreInfo(ID,fullview)
 {

  var opts = "";
    
  var w = 800, h = 600;


 if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
  }

 var popH = 530;
 var popW = 794;


 var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;





  opts = "directories=no,";
  opts = opts + "top=" + topPos +",";
  opts = opts + "left=" + leftPos +",";
  opts = opts + "width=" + popW + ",";
  opts = opts + "height=" + popH +",";
  opts = opts + "fullscreen=no,";
  opts = opts + "location=no,";
  opts = opts + "menubar=no,";
  opts = opts + "resizable=no,";
  opts = opts + "scrollbars=no,";
  opts = opts + "status=no,";
  opts = opts + "toolbar=no,";


  window.open('/MoreInfoFrame.asp?ListingID=' + ID + '&FullView=' + fullview, '', opts, false);

 }




function PhotoViewer(ID,imgType,MyListings)
 {

  var opts = "";
    
  var w = 800, h = 600;


 if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
  }

 var popH = 530;
 var popW = 794;


 var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;





  opts = "directories=no,";
  opts = opts + "top=" + topPos +",";
  opts = opts + "left=" + leftPos +",";
  opts = opts + "width=" + popW + ",";
  opts = opts + "height=" + popH +",";
  opts = opts + "fullscreen=no,";
  opts = opts + "location=no,";
  opts = opts + "menubar=no,";
  opts = opts + "resizable=no,";
  opts = opts + "scrollbars=no,";
  opts = opts + "status=no,";
  opts = opts + "toolbar=no,";


  window.open('/PhotoViewer.asp?ListingID=' + ID + '&imgType=' + imgType + '&MyListings=' + MyListings, 'PhotoViewer', opts, false);

 }


function AddToPrintList(ListingID,on,fullview)
 { 
  scd = new Date();
  if (fullview==true)    
   window.top.WorkArea.document.location.href="AddToPrintList.asp?scd=" + scd + "&ListingID=" + ListingID + "&select=" + on + "&fullview=" + fullview;
  else   
   window.top.WorkArea.document.location.href="AddToPrintList.asp?scd=" + scd + "&ListingID=" + ListingID + "&select=" + on + "&fullview=" + fullview;
   
 }




//---------------------------------------------------------------------


function toCurrency(pElem)
{

var v = pElem.value;

v=cleanNumber(v);

if (isNaN(v))
 {
 alert ('Invalid Entry');
 pElem.value='';
 }
else
 {
  var o = outputMoney(v);
  pElem.value=o;
  if (o=='$0.00')
   pElem.value='';
 }
}


function toSingle(pElem)
{

var v = pElem.value;

v=cleanNumber(v);

if (isNaN(v))
 {
 alert ('Invalid Entry');
 pElem.value='';
 }
else
 {
  var o = outputSingle(v);
  pElem.value=o;
  if (o==0)
   pElem.value='';
 
 }
}


function toNumber2(pElem)
{

var v = pElem.value;

if (v=='')
 return;

v=cleanNumber(v);

if (isNaN(v))
 {
  alert ('Invalid Entry');
  pElem.value='';
 }
else
 {
  var o = outputNumber(v);
  if (o.length == 1)
   pElem.value='0' + o;
  else
   pElem.value= o;
 
 }
}

function toNumber(pElem)
{
 var v = pElem.value;

 v=cleanNumber(v);

 if (isNaN(v))
  {
   alert ('Invalid Entry');
   pElem.value='';
  }
 else
  {
   var o = outputNumber(v);
   
   pElem.value=o;
   if (o==0)
    pElem.value='';
 
 }



}


function cleanNumber(strNum)
{
	if (!strNum) return strNum;
	strNum = replace(strNum, '$', '', 0);
	strNum = replace(strNum, ',', '', 0);
	strNum = replace(strNum, '%', '', 0);	
	return strNum;
}

function replace(szBuf, szFind, szReplace, lStart)
{
	var lFind = 0;
	if (!lStart) lStart = 0;
	
	while (lFind != -1) {
		lFind = szBuf.indexOf(szFind, lStart);

		if (lFind != -1) {
			szBuf = szBuf.substring(0,lFind) + szReplace + szBuf.substring(lFind + szFind.length);
			lStart = lFind + szReplace.length;
		}
	}
	return szBuf;
}


function outputNumber(number) {
    return outputDollars(Math.floor(number-0) + '') 
}


function outputSingle(number) {
    return outputDollars(Math.floor(number-0) + '') + outputCents(number - 0);
}




function outputMoney(number) {
    return "$" + outputDollars(Math.floor(number-0) + '') + outputCents(number - 0);
}


function outputDollars(number) {
    if (number.length <= 3)
        return (number == '' ? '0' : number);
    else {
        var mod = number.length%3;
        var output = (mod == 0 ? '' : (number.substring(0,mod)));
        for (i=0 ; i < Math.floor(number.length/3) ; i++) {
            if ((mod ==0) && (i ==0))
                output+= number.substring(mod+3*i,mod+3*i+3);
            else
                output+= ',' + number.substring(mod+3*i,mod+3*i+3);
        }
        return (output);
    }
}


function outputCents(amount) {
    amount = Math.round( ( (amount) - Math.floor(amount) ) *100);
    return (amount < 10 ? '.0' + amount : '.' + amount);
}









function email(AgentID,ListingID)
{
window.top.WorkArea.document.location.href='/email.asp?ListingID=' + ListingID + '&AgentID=' + AgentID;
}







function FullView(proptype,bcpid,listingid,ACMode)
 {

   var opts = "";
  
   sh=500;
   sw=780;

   var l=(screen.width - sw) / 2;
   var t=(screen.height - sh) / 2;

   opts = "directories=no,";
   opts = opts + "fullscreen=no,";
   opts = opts +  "location=no,";
   opts = opts +  "menubar=no,";
   opts = opts +  "resizable=no,";
   opts = opts +  "scrollbars=no,";
   opts = opts +  "status=no,";
   opts = opts +  "toolbar=no,";
   opts = opts + "width=" + sw + ","
   opts = opts + "height=" + sh + ","
   opts = opts + "top=" + t +","
   opts = opts + "left=" + l +","
   opts = opts + "screenX=" + t +","
   opts = opts + "screenY=" + l +","

   w=window.open("FullView.asp?proptype=" + proptype + "&bcpid=" + bcpid + "&listingid=" + listingid + "&ACMode=" + ACMode,"fullview",opts);
   w.focus();

 }










function LookupStreet(CityID,objStreet,objSuffix,objStreet2,objSuffix2)
 {

   var opts = "";
   var OtherStreet="";
   var OtherSuffix="";


   if (objStreet2!=null)
   {
    OtherStreet=objStreet2.value;
    OtherSuffix=objSuffix2.value;
   }
  
 

   scd = new Date();

   var sn=window.showModalDialog("StreetLookup.asp?Seed=" + objStreet.value +"&CityID=" + CityID  ,"","dialogHeight:350px;dialogWidth:210px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined')  && (sn != null))
    {
     var s = sn.split('|');
     
     objStreet.value=s[0];
     if (objSuffix != null)
      objSuffix.value=s[1];
     else    
      objStreet.value=s[0] + ' ' + s[1];


     if ((OtherStreet=="") &&  (objStreet2 != null))
      objStreet2.value =s[0]; 
     if ((OtherSuffix=="") &&  (objSuffix2 != null))
      objSuffix2.value =s[1]; 

    return true;
    }
     if ((OtherStreet=="") &&  (objStreet2 != null))
      objStreet2.value =""; 
     if ((OtherSuffix=="") &&  (objSuffix2 != null))
      objSuffix2.value =""; 
}

function LookupPark(CityID,objPark,objParkID)
 {



   scd = new Date();



   var sn=window.showModalDialog("ParkLookup.asp?Seed=" + objPark.value + "&CityID=" + CityID  ,"","dialogHeight:350px;dialogWidth:210px;status:no;help:no");
 if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');
     if (objParkID==null)
     {
      objPark.value=s[1];
     }
     else
     {
     objPark.value=s[1];
     objParkID.value=s[0];
    }
  }

}



function LookupComment(objComment,PropType,objFeatList,objOther)
 {


   var scd = new Date();
   var OtherText = "";

   if (objOther != null)
    OtherText=objOther.value ;


   var sn=window.showModalDialog("CommentLookup.asp?PropType=" +  PropType + "&Seed=" + objComment.value  ,"","dialogHeight:350px;dialogWidth:410px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');
      

    objFeatList.value ='.'+ s[0] + '.';

     objComment.value=s[1];
     if ((OtherText=="") &&  (objOther != null))
      objOther.value =s[1];   
     return true;
    }
     if ((OtherText=="") &&  (objOther != null))
      objOther.value="";   
     return false;


}


function LookupCommentEx(objComment,PropType,objFeatList,objOther)
 {


   var scd = new Date();
   var OtherText = "";

   if (objOther != null)
    OtherText=objOther.value ;


   var sn=window.showModalDialog("CommentLookup.asp?PropType=" +  PropType + "&Seed=" + objComment.value  ,"","dialogHeight:350px;dialogWidth:410px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');
      
    var l = objFeatList.options.length;
    objFeatList[l] = new Option(s[1]);

    objFeatList[l].value = s[0];


    var cmt = objComment.value;

    cmt = cmt.substring(0,cmt.length-s[2])

     objComment.value=cmt + s[1];
     if ((OtherText=="") &&  (objOther != null))
      objOther.value =objComment.value;   
     return true;
    }
     if ((OtherText=="") &&  (objOther != null))
      objOther.value="";   
     return false;


}

function LookupCompany(objName,objPhone,objID,objFax,objCity)
 {


   scd = new Date();

   var sn=window.showModalDialog("CompanyLookup.asp?Name=" + objName.value  ,"","dialogHeight:350px;dialogWidth:410px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');
     objID.value=s[0];
     objName.value=s[1];
     objPhone.value=s[2];
     if (objFax)
      objFax.value=s[3];
     if (objCity)
      objCity.value=s[4];
     return true;
    }
     return false;


}



function LookupAgent(CompanyID,objName,objEmail)
 {


   scd = new Date();

   var sn=window.showModalDialog("AgentLookup.asp?AgentName=" + objName.value + "&CompanyID=" + CompanyID  ,"","dialogHeight:350px;dialogWidth:410px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');
     objName.value=s[1];
     objEmail.value=s[2];
     return true;
    }
     return false;

}





function LookupFeatures(PropType,Features,obj, comments)
 {


   var sn=window.showModalDialog("FeatureLookup.asp?PropType=" + PropType + "&Features=" + Features +  "&comments=" + comments ,"","dialogTop:10;dialogHeight:750px;dialogWidth:800px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined'))
    {
     obj.value=sn;
     return true;
    }
     return false;


}



function LookupFeaturesEx(PropType,featureobj)
 {


   var sn=window.showModalDialog("CommentLookup.asp?PropType=" +  PropType  ,"","dialogHeight:350px;dialogWidth:410px;status:no;help:no");
   if ((sn != '') && (sn != 'undefined') && (sn != null))
    {
     var s = sn.split('|');

    var l = featureobj.options.length;
    featureobj[l] = new Option(s[1]);

    featureobj[l].value = s[0];

 
     return true;
    }
    
    return false;


}









function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
 



function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
 



function CopyValue(objFrom, objTo)
{

if (objTo.value=='' || objTo.value=='0' || objTo.value=='$0.00')
objTo.value=objFrom.value;


}


function CalcAvgFloor(floors, BCPsize, objTo)
{

//if (objTo.value=='')
//objTo.value=objFrom.value;


}




function OpenMyListings()
{

var opts = "";
var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;


sh=400
sw=780

t = (screen.height - sh) / 2  ;
l = (screen.width - sw) / 2;

opts = opts + "directories=no,"
opts = opts + "fullscreen=no,"

opts = opts + "location=no,"
opts = opts + "menubar=no,"
opts = opts + "resizable=no,"
opts = opts + "scrollbars=yes,"
opts = opts + "status=no,"
opts = opts + "toolbar=no,"
opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","


w = window.open('mylistings.asp',"MyListings",opts);
w.focus();

}





function OpenHotsheet()
{

var opts = "";
var sw = screen.width;
var sh = screen.height;
var l=0;
var t=0;


sh=545
sw=780

t = (screen.height - sh) / 2  ;
l = (screen.width - sw) / 2;

opts = opts + "directories=no,"
opts = opts + "fullscreen=no,"

opts = opts + "location=no,"
opts = opts + "menubar=no,"
opts = opts + "resizable=no,"
opts = opts + "scrollbars=no,"
opts = opts + "status=no,"
opts = opts + "toolbar=no,"
opts = opts + "width=" + sw + ","
opts = opts + "height=" + sh + ","

opts = opts + "top=" + t +","
opts = opts + "left=" + l +","


opts = opts + "screenX=" + t +","
opts = opts + "screenY=" + l +","

var scd = new Date();


w = window.open('hotsheet.asp?scd=' + scd ,"Hotsheet",opts);
w.focus();

}







function PrintBrochure(ID)
 {

  var opts = "";
    
  var w = 800, h = 600;

  if (document.all || document.layers) {
    w = screen.availWidth;
    h = screen.availHeight;
   }

   var popH = 530;
   var popW = 794;

   var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;

   opts = "directories=no,";
   opts = opts + "top=" + topPos +",";
   opts = opts + "left=" + leftPos +",";
   opts = opts + "width=" + popW + ",";
   opts = opts + "height=" + popH +",";
   opts = opts + "fullscreen=no,";
   opts = opts + "location=no,";
   opts = opts + "menubar=no,";
   opts = opts + "resizable=no,";
   opts = opts + "scrollbars=no,";
   opts = opts + "status=no,";
   opts = opts + "toolbar=no,";

   window.open('/print/brochure.asp?ListingID=' + ID , 'Brochure', opts, false);

 }









function DoSave()
 {

  var opts = "";
  bcd = new Date();    

  var w = 800, h = 600;

  if (document.all || document.layers) {
    w = screen.availWidth;
    h = screen.availHeight;
   }

   var popH = 550;
   var popW = 796;

   var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;

   opts = "directories=no,";
   opts = opts + "top=" + topPos +",";
   opts = opts + "left=" + leftPos +",";
   opts = opts + "width=" + popW + ",";
   opts = opts + "height=" + popH +",";
   opts = opts + "fullscreen=no,";
   opts = opts + "location=no,";
   opts = opts + "menubar=no,";
   opts = opts + "resizable=no,";
   opts = opts + "scrollbars=no,";
   opts = opts + "status=no,";
   opts = opts + "toolbar=no,";

   window.open('SaveSearch.asp?bcd=' + bcd, 'SaveSearch', opts, false);

 }






function DoQS()
{

  var opts = "";
  bcd = new Date();    

  var w = 800, h = 600;

  if (document.all || document.layers) {
    w = screen.availWidth;
    h = screen.availHeight;
   }

   var popH = 550;
   var popW = 796;

   var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;

   opts = "directories=no,";
   opts = opts + "top=" + topPos +",";
   opts = opts + "left=" + leftPos +",";
   opts = opts + "width=" + popW + ",";
   opts = opts + "height=" + popH +",";
   opts = opts + "fullscreen=no,";
   opts = opts + "location=no,";
   opts = opts + "menubar=no,";
   opts = opts + "resizable=no,";
   opts = opts + "scrollbars=no,";
   opts = opts + "status=no,";
   opts = opts + "toolbar=no,";

   window.open('QuickStat.asp?bcd=' + bcd, 'QuickStat', opts, false);

}



   function encodeHtml(toEncode) {
     encodedHtml = escape(toEncode);
     encodedHtml = encodedHtml.replace(/\//g,"%2F");
     encodedHtml = encodedHtml.replace(/\?/g,"%3F");
     encodedHtml = encodedHtml.replace(/=/g,"%3D");
     encodedHtml = encodedHtml.replace(/&/g,"%26");
     encodedHtml = encodedHtml.replace(/@/g,"%40");
     return encodedHtml;
   } 
 


// ====================================================================
//       URLEncode and URLDecode functions
//
// Copyright Albion Research Ltd. 2002
// http://www.albionresearch.com/
//
// You may copy these functions providing that 
// (a) you leave this copyright notice intact, and 
// (b) if you use these functions on a publicly accessible
//     web site you include a credit somewhere on the web site 
//     with a link back to http://www.albionresarch.com/
//
// If you find or fix any bugs, please let us know at albionresearch.com
//
// SpecialThanks to Neelesh Thakur for being the first to
// report a bug in URLDecode() - now fixed 2003-02-19.
// ====================================================================
function URLEncode(ecode )
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = ecode;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
 
	return encoded;
}

function URLDecode(ecode )
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   var encoded = ecode;
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2) 
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
 
   return plaintext;
}
 
function Jumper(BCPID, mode){

  window.open('/Jumper.asp?mode='+mode+'&BCPID='+BCPID);

}


function ViewCard(AdCardID,AdCatID,FromDir){
	
	var opts = "";
	bcd = new Date();    
	
	var w = screen.Width;
	var h = screen.Height;
	
	
	var popH = 670;
	var popW = 900;
	
	var leftPos = (w-popW)/2, topPos = (h-popH)/2  ;
	
	opts = "directories=no,";
	opts = opts + "top=" + topPos +",";
	opts = opts + "left=" + leftPos +",";
	opts = opts + "width=" + popW + ",";
	opts = opts + "height=" + popH +",";
	opts = opts + "fullscreen=no,";
	opts = opts + "location=no,";
	opts = opts + "menubar=no,";
	opts = opts + "resizable=no,";
	opts = opts + "scrollbars=no,";
	opts = opts + "status=no,";
	opts = opts + "toolbar=no,";
	
	window.open('/AdCard.asp?AdCardID='+AdCardID+'&AdCatID='+AdCatID+'&FromDir='+FromDir+'&bcd=' + bcd, 'AdCard', opts, false).focus();
	


}


