var check;
document.onclick= addText;

function addText()

{

 if(check!='keywords' && check!='become')      
{  

      document.getElementById("keywords").value="Search PSVillage";
      document.getElementById("become").value="Enter Your Email";
}
check=null;

}
function textclear(id)
 {
        check=id.id;
	document.getElementById(id.id).value="";
 }

function index_height()

  {

  var feed_hei = document.getElementById("news").offsetHeight;

  var sugg_hei = document.getElementById("discussions").offsetHeight;

  var exp_hei = document.getElementById("sponsors").offsetHeight;

  var myArray = new Array(feed_hei,sugg_hei,exp_hei);

  for (var i=0; i<(myArray.length-1); i++)

        for (var j=i+1; j<myArray.length; j++)

            if (myArray[j] < myArray[i]) {

                var dummy = myArray[i];

                myArray[i] = myArray[j];

                myArray[j] = dummy;

            }

    document.getElementById("news").height=myArray[2];

    document.getElementById("discussions").height=myArray[2];

    document.getElementById("sponsors").height=myArray[2];

  }

var profileWindow;
function openProfileWindow(urltoopen)
{


	if(profileWindow)
	{
		if(profileWindow.open())
		{profileWindow.close();}
	}
                urlToGo = "http://www.psvillage.com/index.php/Upcoming-Events/bioprofile/?url_title="+urltoopen;
                var winLeft = (screen.availWidth/2)-250;
                var winTop = (screen.availHeight/2)-200;

	openpopup(urlToGo , profileWindow, 'status=no,menubar=0,location=0,scrollbars,resizable,width=500,height=400');

}
function openpopup(url,name,options,fullscreen) {
  fullurl =  url;
  windowobj = window.open(fullurl,name,options);
  if (fullscreen) {
     windowobj.moveTo(0,0);
     windowobj.resizeTo(screen.availWidth,screen.availHeight);
  }
   windowobj.focus();
  return false;
}


