function getE(id){
	return document.getElementById(id);
}

function ShowWin(url,x,y,name,isscrollbars, menubar) {
cx=screen.width/2-(x/2);
cy=screen.height/2-(y/2);
isscrollbars=(isscrollbars=="no")?"no":"yes";
if(name == null) name="_blank";
if(menubar == null) menubar = 'no';
window.open(url,name,"toolbar=no,status=no,directories=no,menubar="+menubar+",resizable=yes,width="+x+",height="+y+",scrollbars="+isscrollbars+",top="+cy+",left="+cx);
}

function defined(x){
	return typeof(x) != 'undefined' && x != null;
}

function addListener(element, event, func){
	if(element.attachEvent)
		element.attachEvent('on' + event, function(){ func(window.event) });
	else if(element.addEventListener)
		element.addEventListener(event, func, false);
}

function makeBookmark(url, name) {				
  var qs;	
  with(window.location) {		
	qs = search;
	if (qs == '')
             qs = "?";
	qs += "&_action=" + pathname + "&_pn=" + name;
  }
  ShowWin(url+qs,300,200,"","yes"); 
}


function makeBookmark2(form_name, url, action) {				
  var form = document.forms[form_name];
  	
  var qs = '';

  qs = add_qs(form, 'input', qs );
  qs = add_qs(form, 'select', qs );	

  ShowWin(url+"?"+qs+"&_action="+action,300,200,""); 
}

function add_qs(form, tagElemet, qs) {
	var elemets = form.getElementsByTagName(tagElemet);
	for(var i = 0; i < elemets.length; i++){
		if(qs.length) 
			qs += '&';	  
		qs += elemets[i].name+'='+elemets[i].value;
	}  
	return qs;
}

function switchElement(element, onNone, onBlock, elText, elImg, elDelimeter) {
	var display = 'none';
	var text = onBlock;
	var img = "/i/plus.gif";

	if (document.getElementById(element).style.display == 'none') {
		display = 'inline';
		text = onNone;
		img = "/i/minus.gif";
	}
	
	document.getElementById(element).style.display = display;
	document.getElementById(elText).innerHTML = text;
	
	if (elImg) 
		document.getElementById(elImg).src = img;		
	
	if (elDelimeter)
		document.getElementById(elDelimeter).style.display = display;		
}

function ti_op(obj) {
	ShowWin_ti_order(obj.href,450,400,"","yes"); 
	return false;
}

function ti_bp(obj) {
	ShowWin_ti_order(obj.href,1000,600,"","yes"); 
	return false;	
}

function ti_bk(obj, operatorId) {
	ShowWin_ti_order(obj.href,1024,768,"","yes");

	if(typeof(nl_count_params) == 'function' && typeof(operatorId) != 'undefined' ) {						
		nl_count_params(1007, 9, operatorId, 0);
	}
	return false;	
}

function ti_of(obj) {
	ShowWin_ti_order(obj.href,780,580,"","yes"); 
	return false;	
}

function ti_ms(obj) {
	ShowWin(obj.href,450,470,"","yes"); 
	return false;	
}

function ti_am(obj) {
	cx=screen.width / 2 - (450 / 2);
	cy=(screen.height/2-(470/2));
	window.open('about:blank','report','"toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width=450,height=470,scrollbars=yes,top='+cy+',left='+cx+'"');
	//ShowWin(obj.action, 450, 470, "", "yes");
}

function ShowWin(url,x,y,name,isscrollbars) {
	cx=screen.width / 2 - (x / 2);
	cy=(screen.height/2-(y/2));
    
    isscrollbars=(isscrollbars=="no")?"no":"yes";
	window.open(url,name,"toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width="+x+",height="+y+",scrollbars="+isscrollbars+",top="+cy+",left="+cx);
}


function ShowWin_ti_order(url,x,y,name,isscrollbars) {
	cx=screen.width / 2 - (x / 2);
	cy=(screen.height/2-(y/2));
    
    isscrollbars=(isscrollbars=="no")?"no":"yes";
	window.open(url,name,"toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width="+x+",height="+y+",scrollbars="+isscrollbars+",top="+cy+",left="+cx);
}

function ShowPropWin(url,prx,pry,name,isscrollbars) {
	var x,y;
	y=screen.availHeight
	if(!y) y=screen.height
	x=screen.availWidth
	if(!x) x=screen.width
	
	x = parseInt(prx*x/100);
	y = parseInt(pry*y/100);
	
	cx=screen.width / 2 - (x / 2);
	cy=(screen.height/2-(y/2));
	isscrollbars=(isscrollbars=="no")?"no":"yes";
	window.open(url,name,"toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width="+x+",height="+y+",scrollbars="+isscrollbars+",top="+cy+",left="+cx);
}
