function openWindow(url) {
   opinion = window.open(url,"Handheld",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=150,height=400');
}

function makeRemote(url){
	remote = window.open(url,"remotewin","width=600,height=480,scrollbars=1");
	remote.location.href = url;
	if (remote.opener == null) remote.opener = window;
}

function checkit(val) {
   dlink=document.thisform;
   len = dlink.elements.length;
   var i=0;
   for( i=0 ; i<len ; i++) {
//      if (dlink.elements[i].name=='u_id') {
         dlink.elements[i].checked=val;
//      }
   }
}

function check_cookie(cookie_name) {
   var cookies = document.cookie;
   var pos = cookies.indexOf(cookie_name,'=');
   if (pos != -1) {
      return true;
   }
   else {
      return false;
   }
}

function smilie_remote(emotionicon) {
   self.opener.document.thisform.message.value += emotionicon+" ";
   self.opener.document.thisform.message.focus();
}

function smilie(emotionicon) {
   document.thisform.message.value += emotionicon+" ";
   document.thisform.message.focus();
}

function choose_avatar(avatar) {
   self.opener.document.thisform.pc.value = avatar;
}

function jumpPage(form) {
   i = form.forum.selectedIndex;
   if (i == 0) return;
   window.location.href = url[i+1];
}

function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}

function checkUncheckAll(theElement)
{
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++)
	{
	if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
		{
		theForm[z].checked = theElement.checked;
		}
    	}
}