	var newwindow;
	function popdetails(url) {
		newwindow=window.open(url,'popdetails','height=500,width=500,resizable=yes,scrollbars=yes,status=yes');
		if (window.focus) newwindow.focus();
	}

	function poppeer(url) {
		newwindow=window.open(url,'poppeers','height=400,width=650,resizable=yes,scrollbars=yes');
		if (window.focus) newwindow.focus();
	}

	function resize(img) {
		if (img.width>500) {
			img.height=parseInt(img.height*500/img.width);
			img.width=500;
			var foo=document.getElementById(img.name);
			foo.innerHTML='<strong>Click on image for full size view.</strong><a href="'+img.src+'" target="_blank">'+foo.innerHTML+'</a>';
		}
	}

	function resize_avatar(img) {
		if(img.width>100) {
			img.height=parseInt(img.height*100/img.width);
			img.width=100;
		}
	}

	function resize_chat(img) {
		if(img.width>600) {
			img.height=parseInt(img.height*600/img.width);
			img.width=600;
		}
	}

	function resize_chat2(img) {
		if(img.width>290) {
			img.height=parseInt(img.height*290/img.width);
			img.width=290;
		}
	}	

function blinkIt()
{
	if (!document.all) return;
	else
	{
		for(i=0;i<document.all.tags('blink').length;i++)
			{
				s=document.all.tags('blink')[i];
				s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
			}
	}
}

 function openwin(url,txt) {

try {
	var w=Windows.getWindow('MESS').getId();
}
 catch(err) {
		win = new Window({id:'MESS',
			className: 'alphacube', title: 'Message', width:250,height: 100,
			minimizable:false, maximizable: false, destroyOnClose: true
		});
		win.getContent().innerHTML =txt;
		win.showCenter();
	}
  }

 function openAlertwin(url,txt) {
	try {
		var w=Windows.getWindow('MESS').getId();
	}
	 catch(err) {
	    Dialog.alert(txt, 
       	            {id:'MESS', width:250, className: "greylighting", okLabel: "CLOSE"})
	}
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getElements(name){
        var x=document.getElementsByName(name);
        return x;
}

function getElementsByName_iefix(tag, name) {
     
     var elem = document.getElementsByTagName(tag);
     var arr = new Array();
     for(i = 0,iarr = 0; i < elem.length; i++) {
          att = elem[i].getAttribute("name");
          if(att == name) {
               arr[iarr] = elem[i];
               iarr++;
          }
     }
     return arr;
}

 function openwinmess(url) {
var ur='user_pm_ajax.php?'+url;

try {
	var w=Windows.getWindow('PMESSAGE').getId();
}
 catch(err) {
		win = new Window({id:'PMESSAGE',
			className: 'alphacube', title: 'Message', width:600,height: 450,
			minimizable:false, maximizable: false, destroyOnClose: true,
			url: ur
		});
		win.showCenter();

	}
}


function trim(myString) {
	return myString.replace(/^s+/g,'').replace(/s+$/g,'');
}
