function openPopup(mypage,myname,w,h,pos,infocus)
{
        if(pos=='random')
                {
                        LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
                        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
                }
        if(pos=='center')
                {
                        LeftPosition=(screen.width)?(screen.width-w)/2:100;
                        TopPosition=(screen.height)?(screen.height-h)/2:100;
                }
        else
                if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}
                        settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes';

        acePopupWindow=window.open('',myname,settings);
        if(infocus=='back')
        {
                acePopupWindow.blur();
                acePopupWindow.location=mypage;
                acePopupWindow.blur();
        }
        else
                acePopupWindow.location=mypage;
 return false;
}

function openFotoPopup(mypage,myname)
{        w=10;h=10;
        LeftPosition=0;//(screen.width)?(screen.width-w)/2:100;
        TopPosition=0;//(screen.height)?(screen.height-h)/2:100;

        settings='width='+ w + ',height=' + h +',top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=no,status=no,resizable=yes,dependent=no,scrollbars=no';
        acePopupWindow=window.open(server_root+'auxiliary/fotopopup.html?foto='+mypage+'&title='+encodeURIComponent(myname),"",settings);


 		return false;
}

function openFotoPopup1(mypage,myname,w,h)
{
		w+=30;h+=30;
        LeftPosition=(screen.width)?(screen.width-w)/2:100;
        TopPosition=(screen.height)?(screen.height-h)/2:100;

        settings='width='+ w + ',height=' + h +',top=' + TopPosition + ',left=' + LeftPosition + ',toolbar=no,status=no,resizable=yes,dependent=no,scrollbars=no';
        acePopupWindow=window.open(server_root+'auxiliary/fotopopup1.html?foto='+mypage+'&title='+encodeURIComponent(myname),"",settings);


 		return false;
}


function GetToJS(vals){	get = new String(window.location);
	x = get.indexOf('?');
	if(x!=-1)
	{
  		l = get.length;
  		get = get.substr(x+1, l-x);
  		l = get.split('&');
 		x = 0;
  		_GET_Count  = l.length;
		evl_str='var arr={';
		for (i=0;i<_GET_Count;i++){			get = l[i].split('=');			evl_str+=get[0]+':"'+get[1]+'"';
			if (i<_GET_Count-1) evl_str+=',';		}
        evl_str+='}';
        eval(evl_str);
		return arr;
	}}
