var popWin;
function popupwindow1(url, width, height)
{
 if(popWin)
 {
  popWin.close();
  popWin='';
 }
 popWin=window.open(url,"popWin","toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,width="+ width +",height="+height);
 popWin.moveTo(150, 20);
 popWin.document.bgColor="#111111";
 popWin.document.write ("<HTML><HEAD><TITLE>paievents.com - Pai Event Calendar</TITLE></HEAD>");
 popWin.document.write ("<body bgcolor='#EEEEEE' leftmargin='0' topmargin='0' MARGINHEIGHT='0' MARGINWIDTH='0'>");
 popWin.document.write ("<img src='"+url+"'>");
 popWin.document.write ("</body></HTML>");
}

function popupwindow2(url, width, height)
{
 if(popWin)
 {
  popWin.close();
  popWin='';
 }
 popWin=window.open(url,"popWin","toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,width="+ width +",height="+height);
 popWin.moveTo(30, 100);
 popWin.focus();
}

/* Only set closed if JS-enabled */ 
document.getElementsByTagName('html')[0].className = 'isJS'; 
function tog(dt) 
{ 
 var display, dd=dt; 
 do
 {
  dd = dd.nextSibling
 } while(dd.tagName!='DD'); 
 toOpen =!dd.style.display;
 dd.style.display = toOpen? 'block':'' 
 dt.getElementsByTagName('span')[0].innerHTML = toOpen? '<font color="#008000"><IMG SRC="images/bclose.gif" WIDTH=20 HEIGHT=19 BORDER=0 style="vertical-align: middle;"><u> hide...</u></font>':'<font color="#008000"><IMG SRC="images/bopen.gif" WIDTH=20 HEIGHT=19 BORDER=0 style="vertical-align: middle;"> Read more about Soppong...</font>'; 
} 

function limitText(limitField, limitCount, limitNum)
{
 if (limitField.value.length > limitNum)
 {
  limitField.value = limitField.value.substring(0, limitNum);
 }
 else
 {
  limitCount.value = limitNum - limitField.value.length;
 }
}

function sForm()
{
 if (document.forms.sendfriend.fname.value == "")
 {
  alert("Please enter your name...");
  document.forms.sendfriend.fname.focus( );
  return false;
 }

 if (document.forms.sendfriend.temail.value == "")
 {
  alert("Please the receiver's email address...");
  document.forms.sendfriend.temail.focus( );
  return false;
 }

 if (document.forms.sendfriend.femail.value == "")
 {
  alert("Please enter your email address...");
  document.forms.sendfriend.femail.focus( );
  return false;
 }
}

function uForm()
{
 if (document.forms.xxxxx.headline.value == "")
 {
  alert("Please enter a headline...");
  document.forms.xxxxx.headline.focus( );
  return false;
 }

 if (document.forms.xxxxx.ntext.value == "")
 {
  alert("Please enter some text...");
  document.forms.xxxxx.ntext.focus( );
  return false;
 }

 if (document.forms.xxxxx.ppass.value != document.forms.xxxxx.ppass2.value)
 {
  alert("Your passwords don't match....");
  document.forms.xxxxx.ppass.value = "";
  document.forms.xxxxx.ppass2.value = "";
  document.forms.xxxxx.ppass.focus( );
  return false;
 }
}

function ireload()
{
 document.getElementById('sub_but').src='securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>'
}
