var new_Win = null;
function newWin(File,title,width,height,scroll)
{   
		
	if (new_Win != null) {
		if(!new_Win.closed)
		   new_Win.close();
	}

	options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable=0,height='+width+',width='+height;
	new_Win = window.open(File,title,options);
	
	new_Win.resizeTo(width+10,height+70);
	
	posx = (screen.width/2) - (width/2); 
	posy = (screen.height/2) - (height/2);   
	
	new_Win.moveTo(posx,posy);
	new_Win.focus();
}

function newWinCheck(File,title,width,height,scroll,action)
{   	
	newWin(File,title,width,height,scroll);	
	setTimeout("CheckClose("+action+");", 1000);
}
                  
function CheckClose(action) 
{ 
	if(new_Win) setTimeout("CheckClose("+action+");", 1000); 
	if(new_Win && new_Win.closed) { 
	    eval(action);                     
	    new_Win = false; 
	} 
} 


function linkit(url)
{
	window.open(url,'_new')	
}

function emailLink(par1,par2,par3) {
	location.href	 = 'mailto:'+par3+'@'+par2+"."+par1;
}

var activeLayer = "";
var activeLayerHistory = "";
function activateLayer(layer)
{
	activeLayerHistory = activeLayer;
	activeLayer = layer;
	show(activeLayerHistory,0);
	show(activeLayer,1);
	
}	


var activateDisplayHistory = '';
function activateDisplay(layer) {
	if(activateDisplayHistory!='')		
		display(activateDisplayHistory,0);
	display(layer,1);
	activateDisplayHistory = layer;
}


var switch_layer_history = new Array();
function switch_layer(layer)
{	
	if (switch_layer_history[layer] != 0) {
		show(layer,1);
		switch_layer_history[layer] = 0;
	}
	else {
		show(layer,0);
		switch_layer_history[layer] = 1;
	}	
}

var switchTabHistory = '';
function switchTab(obj,layer,classname) {	
	switchTabHistory.className = classname;
	obj.className=classname+'_active';
	switchTabHistory = obj;
	activateDisplay(layer);
}


function confirmLink(link,msg)
{
     if(confirm(msg))
         location.href=link;
}

function confirmForm(name,action,msg) 
{		
	if(confirm(msg)) {
		tmp = 'document.'+name+'.'+name+'Action.value = "' + action + '"';
		eval(tmp);
		tmp = 'document.'+name+'.submit()';
		eval(tmp);
	}	
}



