var werd;
function openopen(linkk,name,w_,h_){
	linkk='/popwin.php?link='+linkk+'&dir='+name;
	var up_=100;
	var left_=100;
	param = 'top='+up_+',left='+left_+',width='+w_+',height='+h_;
	if (werd==null||werd.closed){
		werd=window.open(linkk,name, param+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
	}
	else{
		werd.close();
		werd=window.open(linkk,name, param+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
	}
	werd.focus();
}
function open_win(links,name){
	//if (un_window==null||un_window.closed){
		//un_window=window.open('http://'+links,name);
	//}
	//else{
	un_window=window.open('http://'+links,name);
	//}
	un_window.focus();
}
var nam;
function dok0(url,h,w){
	if (nam!=null && !nam.closed)nam.close();
	tops(h,w);
	nam=window.open(url,null,"height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,top="+top_+",left="+left_+",scrollbars=no,resizable=yes");
	nam.focus();
}
function tops(h,w){
	if (navigator.appName == "Netscape") {
		top_=window.innerHeight/2-h/2;//innerHeight
		left_=window.innerWidth/2-w/2;//outerWidth
	}
	else {
		top_=document.body.clientHeight/2-h/2;//clientHeight
		//document.write(top_);
		left_=document.body.clientWidth/2-w/2;//offsetWidth
	}
	if(top_<0)top_=20;
	if(left_<0)left_=0;
}
function get_cur_date(b){
	a=new Date();
	year=a.getYear();
	if(year<2000)year+=1900;
	if((a.getMonth()+1+b)>12)return "01/01/"+(year+1);
	return "01/"+(a.getMonth()+1+b)+"/"+year;
}
function get_cur_date_year(b){
	a=new Date();
	year=a.getYear();
	if(year<2000)year+=1900;
	return (year-b)+"-01-01";
}
function len(a,le,name){
	var b=a.value.length;
	document.forms[name].form_count.value=b;
	if(b>le){
		a.value=a.value.substring(0,le);
	}
}
function confirmLink(text_conf ,theSqlQuery)
{
    var is_confirmed = confirm(text_conf + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        return true;
    }
    return false;
}
