if (BrowserDetect.browser=='Explorer') {
	document.write('<style media="all">.transparent { filter: alpha(opacity=80); } .opaque {filter: alpha(opacity=100);} .transparent2 { filter: alpha(opacity=20); }</style>');
	} else {
	document.write('<style media="all">.transparent { opacity: .8; } .opaque { opacity: 1;} .transparent2 { opacity: .2; } </style>');
	}
function show_wait(d) {
	document.getElementById(''+ d + '').innerHTML='<img src="gui/themes/main/images/a_timer.gif" width="11" height="11"> ';
}	

function toggle_this(elem,div_name) {
	if (elem.className=='left_menu_open') 
		elem.className='left_menu_closed';  
	else 
		elem.className='left_menu_open';  
	Effect.toggle(div_name,'blind',{duration:.2}); 
	return false;
}

function get_pos(el)	{ 
	var p = { x: el.offsetLeft, y: el.offsetTop };
	while (el.offsetParent)	{
		el = el.offsetParent;
		p.x += el.offsetLeft;
		p.y += el.offsetTop;
		if (el != document.body && el != document.documentElement) {
			p.x -= el.scrollLeft;
			p.y -= el.scrollTop;
		}
	}
	return p;
}
function toggle_pic(pic,el,what) {
	var s = get_pos(el); 
	//alert(s.x + ' ' + s.y); 
	document.getElementById('image_viewer_div').style.top = s.y-20 + 'px';
	document.getElementById('image_viewer_div').style.left = s.x-556 + 'px';
	if (what=='news') document.getElementById('image_content_div').innerHTML='<img src="nimages/' + pic + 'b.jpg" style="border:1px solid #666666; max-width:660px; max-height:460px;">';
	else if (what=='product') document.getElementById('image_content_div').innerHTML='<img src="pimages/' + pic + '.jpg" style="border:1px solid #666666; max-width:660px; max-height:460px;">';
	else if (what=='greenline') document.getElementById('image_content_div').innerHTML='<img src="gnimages/' + pic + '.jpg" style="border:1px solid #666666; max-width:660px; max-height:460px;">';
	Effect.toggle('image_viewer_div','blind',{duration:.2}); 
	return false;
}

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires==1 ) 
	expires = 30 * 1000 * 60  ;  
else 
	expires = 10 * 1000 * 60 ;
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


// this function gets the cookie, if it exists
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}


// this deletes the cookie when called
function Delete_Cookie( name, path, domain, type) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function toggle_left_menu (menu, what) {
	if (what=='show') {
		var d = 'block'; 
		if (d!='none') { 
			Set_Cookie('' + menu + '_div_is_visible', 0, 1, '/'); 
			document.getElementById('' + menu + '_div').style.display='none'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_closed'; 
		} else { 
			Set_Cookie('' + menu + '_div_is_visible', 1, 1, '/');  
			document.getElementById('' + menu + '_div').style.display='block'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_open'; 
		}
	} else	if (what=='hide') {
		var d = 'none'; 
		if (d!='none') { 
			Set_Cookie('' + menu + '_div_is_visible', 0, 1, '/'); 
			document.getElementById('' + menu + '_div').style.display='none'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_closed'; 
		} else { 
			Set_Cookie('' + menu + '_div_is_visible', 1, 1, '/');  
			document.getElementById('' + menu + '_div').style.display='block'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_open'; 
		}
	} else {
		var d = document.getElementById('' + menu + '_div').style.display; 
		if (d!='none') { 
			Set_Cookie('' + menu + '_div_is_visible', 0, 1, '/'); 
			document.getElementById('' + menu + '_div').style.display='none'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_closed'; 
		} else { 
			Set_Cookie('' + menu + '_div_is_visible', 1, 1, '/');  
			document.getElementById('' + menu + '_div').style.display='block'; 
			document.getElementById('' + menu + '_arrow').className='left_menu_open'; 
		}	
	}
    return false;	
	
}




