//--------+
// BEHAVIOR: 
// - replaced header containing descrition of the page 
// - with footer containing banners
//--------+
function copy_text() {
            moveCopyTextToFooter();
            moveBannersToHeader();
            
            }

	
	 function moveBannersToHeader()
  {
	head = document.getElementById("top_banners");
	foot = document.getElementById("pnlBanners");
	head.innerHTML = foot.innerHTML;
	foot.style.display = 'none';
  }
  
    function moveCopyTextToFooter()
  {
	head = document.getElementById("copyInHeader");
	foot = document.getElementById("copyInFooter");
	foot.innerHTML = head.innerHTML;
	head.style.display = 'none';
  }
  
  function bannersToHeader()
  {
    copyHead = document.getElementById("copyInHeader");
    copyHead.style.display = 'none';
    head = document.getElementById("top_banners");
	foot = document.getElementById("pnlBanners");
	head.innerHTML = foot.innerHTML;
	head.style.display = 'block';
  }
  
  function removeCopyFromHeader()
  {
      copyHead = document.getElementById("copyInHeader");
      copyHead.style.display = 'none';
  }
  
  function removeCopyFromHeaderToFooter()
  {
    foot = document.getElementById("copyInFooter");
    foot.innerHTML = document.getElementById("copyInHeader").innerHTML
  }


//---------------------------------------------------------------------------
var win = null;
var last_w   = 625;
var last_h   = 675;
//--------+
// BEHAVIOR: 
// - show popup window with width=w, height=h, and content=url
// - repeated calls will reuse the same window
// - defaults to w=675, h=675
//--------+
function pop(url,w,h)
{
   // new window size
   //var w_dft = 675; // default width
   //var h_dft = 675; // default height
   var w_dft = 820; // default width
   var h_dft = 600; // default height
   w = w ? w : w_dft;
   h = h ? h : h_dft;

   var params = "scrollbars,resizable,width=" + w + ",height=" + h;

   if (!win || win.closed) {

      // new window position: 10 pixels inside current window
      var top, left, val;
      if (typeof(window.screenTop) != "undefined") { // IE only
        val = window.screenTop + 10;
	top = ",top=" + val;
        val = window.screenLeft + 10;
	left = ",left=" + val;
      }
      else { // Netscape/Firefox
        val = window.screenY + 10;
	top = ",screenY=" + val;
        val = window.screenX + 10;
	left = ",screenX=" + val;
      }
      params += top + left;
     win = window.open(url,"popWin",params);
     // win = window.open(url,"popWin");


   } else { // window's already open
      if (last_w != w || last_h != h) {
         win.resizeTo(w,h);
      }
      win.location.href = url;
   }

   win.focus();

   // save new window size
   last_w = w;
   last_h = h;
}



function pop2(url)
{
 window.open(url);
   win.focus();
}
//--------+
// BEHAVIOR: 
// - open and closes the left side menu
// - Currently not used in the classified pages but used in the variouse types of landing pages
//--------+
function alter(id) {
		dispalyClass = (document.getElementById(id).className == 'subcategory') ? 'notcurrent' : 'subcategory';
		document.getElementById(id).className=dispalyClass
	}
	

//-----+
// switchs the imagesin the detail page.
// 
//-----+
	
function switchImg1(location, imgID, css_cls) {
        var currImg = document.getElementById(imgID).className = "cur_image_bor"; 
        
	    var bigImgNameArray = document.getElementById('imgLarge').src.split("_")           
        document.getElementById('imgLarge').src = bigImgNameArray[0] + "_" + bigImgNameArray[1] + "_" + location + ".jpg" 
        
        var chosenImgClass = "thumb_image thumb_image_float cur_image " + css_cls
        var imgClass = "thumb_image thumb_image_float"

       for (i=1;i<=4;i++)
        {
            if (i == location)
                document.getElementById('thumb' + i).className=chosenImgClass 
            else
                document.getElementById('thumb' + i).className=imgClass
        }  
}

//-----
// Change css class for the given element
//-----
function changeCss(obj, css) {
    obj.className = css;
}