// Change table style
function HighLight ( tr, oldclass, newclass, check ) {

	currentclass = tr.className;
 
	if ( currentclass != 'bg5' && newclass != 'bg5' ) {
 		tr.className = newclass;
	}
	else {
		
		if ( currentclass == 'bg5' && newclass == 'bg5' ) { // unmark
			tr.className = oldclass;
			
			if ( check && oldclass != 'bg3' )
				document.getElementById( check ).checked = false;			
		
		}
		else if ( currentclass != 'bg5' && newclass == 'bg5' ) { // mark
			tr.className = newclass;
			
			if ( check && oldclass != 'bg3' )
				document.getElementById( check ).checked = true;
		
		}
				
	} 
 
}

// reload secret image
function reloadSI() {
	document.getElementById('si').src='si.php?id='+Math.random();	
}

// Show modal window
function showPopUp( url, winx, winy, scroll, confirmation, name ) {
	
	scrx=window.screen.availWidth;
	scry=window.screen.availHeight;
	vleft=(scrx-winx)/2;
	vtop=(scry-winy)/2;
			
	if ( confirmation ) {
	
		if( confirm('{%Вы уверены?%}') ) {
				
			PopUpWin = window.open(url, name, "width="+winx+",height="+winy+",left="+vleft+",top="+vtop+",modal=1,fullscreen=0,directories=0,location=0, menubar=0,resizable=1,scrollbars="+scroll+",status=0,toolbar=0"); 
		
		}
	}
	else	PopUpWin = window.open(url, name, "width="+winx+",height="+winy+",left="+vleft+",top="+vtop+",modal=1,fullscreen=0,directories=0,location=0, menubar=0,resizable=1,scrollbars="+scroll+",status=0,toolbar=0"); 

}