function new_window(location) { window.open(location,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=700, height=550"); }
function changeBackgroundColor(selector, color) 
{ 	a = $$(selector);
	for(var i=0;i< a.length;i++) {  a[i].style.backgroundColor = color; }		
}

function changeTextColor(a, color)
{  for(var i=0;i< a.length;i++) {  a[i].style.color = color; }		
}		
function changeColor(color_position) {
	document.getElementById("page_header").style.backgroundPosition = color_position;
	document.getElementById("page_footer").style.backgroundPosition = color_position;
	login_button = document.getElementById("login_button");
	if (login_button) login_button.style.backgroundPosition = color_position;			
	// alert(color_position);
	if (color_position == "top")
	{	changeBackgroundColor( ".primary", "#366");				
		changeBackgroundColor( ".alternate", "#699");				
		changeTextColor( $$(".primary_text"), "#366");				
		changeTextColor( $$(".alternate_text"), "#699");				
	} else if (color_position == "center")
  	{ 	changeBackgroundColor( ".primary", "#060");				
		changeBackgroundColor( ".alternate", "#090");				
		changeTextColor( $$(".primary_text"), "#060");				
		changeTextColor( $$(".alternate_text"), "#090");				
    } else if (color_position == "bottom")
	{   changeBackgroundColor( ".primary", "#C60");				
		changeBackgroundColor( ".alternate", "#F60");				
		changeTextColor( $$(".primary_text"), "#C60");				
		changeTextColor( $$(".alternate_text"), "#F60");				
	}			
	setCookie("color", color_position, 365, "/");						
}

// 	Initialization
window.addEvent('domready', 
function() 
{	
	// 	set default color
	var color = Cookie.read("color"); 
	if (color) changeColor(color);

	// Load tips only for non-IE6 browsers
	if  (!(Browser.Engine.trident && Browser.Engine.version <= 4 ))
	{  var textTip = new Tips('.textTip',{ className: 'tooltip', fixed: true, forInput: true });
	   var tooltip = new Tips('.toolTip',{ className: 'tooltip', fixed: true});
	}	

} );		

