function openwin(url,w,h){
	l=(screen.width-w)/2;
	t=(screen.height-h)/2;
	feat="width="+w+",height="+h+",top="+t+",left="+l+",statusbar=no,scrollbars=yes,menubar=no";
	w1=window.open(url,'',feat);
}

function openwinr(url,w,h){
	if(w>screen.width) w=screen.width-20;
	if(h>screen.height) h=screen.height-80;
	l=(screen.width-w)/2;
	t=(screen.height-h)/2;
	feat="width="+w+",height="+h+",top="+t+",left="+l+",statusbar=no,scrollbars=yes,menubar=no,resizable=yes";
	w1=window.open(url,'',feat);
}

function openwins(url,w,h){
	l=(screen.width-w)/2;
	t=(screen.height-h)/2;
	feat="width="+w+",height="+h+",top="+t+",left="+l+",statusbar=no,scrollbars=no,menubar=no";
	w1=window.open(url,'',feat);
}

function opennew(id){
	openwinr('news.php?id='+id,400,300);

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function mOvr(src,clrOver) {
	if(document.all){
	if (!src.contains(event.fromElement)) {
	src.style.cursor = 'hand';
	src.bgColor = clrOver;}
	}
}

function mOut(src,clrIn) {
	if(document.all){
	if (!src.contains(event.toElement)) {
	src.style.cursor = 'default';
	src.bgColor = clrIn;}
	}
}

function mClk(src) {
	if(document.all){
	if(event.srcElement.tagName=='TD')
	src.children.tags('A')[0].click();
	}
}

function politica(){
	openwin('politica.htm',450,500)
}

function politicaemp(){
	openwin('politica.php',350,370)
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_getTextOfTextfield(objName) { //v3.0
  var obj = MM_findObj(objName); if (obj) return obj.value;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function reloadcentro(){
	document.location.reload();
	//parent.centro.location.href=parent.centro.location.href;
}

function perfil(id){
	openwins('perfil.php?autor='+id,450,150)
}

function sndfrnd(url){
	openwinr("sndfrnd.php?url="+escape(url),450,300);
}

function fflash(tsrc,w,h,vars,bg){
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
	document.write("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' ");
	document.write("WIDTH='"+ w + "' HEIGHT='"+ h + "' id='iflash' ALIGN='center'> ");
	document.write("<PARAM NAME=movie VALUE='" + tsrc + "'> <PARAM NAME=quality VALUE=high> <PARAM NAME=menu VALUE=false> ");
	document.write("<param name='FlashVars' value='"+ vars +"'> ");
	document.write("<param name='allowScriptAccess' value='sameDomain'>");
	document.write("<PARAM NAME=bgcolor VALUE="+bg+"> <EMBED src='" + tsrc + "' quality=high ");
	document.write("bgcolor="+bg+" WIDTH='"+ w + "' HEIGHT='"+ h + "' NAME='iflash' ALIGN='center' ");
	document.write("TYPE='application/x-shockwave-flash' menu='false' ");
	document.write("PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' flashvars='" + vars + "' allowScriptAccess='sameDomain'></EMBED></OBJECT>");
}
