function ShowPhoto(url) {
	var scroll = "no";
	if(screen.width < 1000)	{scroll = "yes";}
	window.open(url, '_blank', 'width=0, height=0, menubar=no, scrollbars=' + scroll + ', status=no, top=0, left=0');
}

function GetObj(objId) {
	if (navigator.appName.substring(0,2) !="Mi")
		return document.getElementById(objId);
	else
		return document.all[objId];
}
		
function GetAbsoluteTop(obj_id) {
   
	var obj;
   var result = 0;
   obj = GetObj(obj_id);
   if(obj == null) return 257;
	while( obj.tagName != 'BODY' ) {

     result += obj.offsetTop;
     obj = obj.offsetParent;
   }
   return result;
}

function GetAbsoluteLeft(obj_id) {
   var obj;
   var result = 0;
   obj = GetObj(obj_id);
   while( obj.tagName != 'BODY' ) {
     result += obj.offsetLeft;
     obj = obj.offsetParent;
   }
   return result;
}
		
function SetFavorites(url, title) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url, '');
	}
	else if (window.opera && window.print) { // Opera Hotlist
		var mbm = document.createElement('a');
		mbm.setAttribute('rel', 'sidebar');
		mbm.setAttribute('href', url);
		mbm.setAttribute('title', title);
		mbm.click();
	}
	else if (document.all) { // IE Favorite
		window.external.AddFavorite( url, title);
	}
}

var id_menu = 0;
var timer1 = '';
var timer2 = '';
var blockhidemenu = false;

function enlight_menu(id) {
	oMenuArrow	= GetObj("MenuArrow" + id);
	oMenuItem	= GetObj("MenuItem" + id);
	
	oMenuArrow.bgColor = '#FF000F';
	oMenuItem.style.color = '#FF000F';
}

function endark_menu(id) {
	oMenuArrow	= GetObj("MenuArrow" + id);
	oMenuItem	= GetObj("MenuItem" + id);
	oMenuArrow.bgColor = '#BDA088';
	oMenuItem.style.color = '#824322';
}

function hide_submenu(id) {
	GetObj("SubMenu"+id).style.display = "none";
	id_menu = 0;
}

function show_submenu(id) {
	var oSubMenu = GetObj("SubMenu" + id);
	oSubMenu.style.display = "block";
	oSubMenu.style.left = GetAbsoluteLeft("MenuArrow" + id) + 'px';
	oSubMenu.style.top = (GetAbsoluteTop("imposition") - 3) + 'px';
}

function MenuOn(id, submenu) {
	enlight_menu(id);
	if (submenu) {
		if (id_menu != 0) {
			if (id_menu != id) {
				endark_menu(id_menu);
				hide_submenu(id_menu);
			}
			clearTimeout(timer1);
			clearTimeout(timer2);
		}
		show_submenu(id);
		id_menu = id;
	}
}

function MenuOff(id, submenu) {
	if (!blockhidemenu) return;
	if (submenu) {
		timer2 = window.setTimeout("endark_menu('"+id+"');",1000);
		timer1 = window.setTimeout("hide_submenu('"+id+"');",1000);
	}
	else {
		endark_menu(id);
	}
}

function SubMenuOn(id) {
	clearTimeout(timer1);
	clearTimeout(timer2);
	blockhidemenu = true;
}

function SubMenuOff(id) {
	timer2 = window.setTimeout("endark_menu('"+id+"');",1000);
	timer1 = window.setTimeout("hide_submenu('"+id+"');",1000);
	blockhidemenu = false;
}

var version = 6;
var flash = false;
if (navigator.plugins) {
	if(navigator.plugins["Shockwave Flash"])  {
		  plugin = navigator.plugins["Shockwave Flash"].description;
		 if ( parseInt(plugin.charAt(plugin.indexOf('.') - 2))) {
    		    flash = parseInt(plugin.charAt(plugin.indexOf('.') - 2) * 10) >= version;
	        }
    		else {
        	    flash = parseInt(plugin.charAt(plugin.indexOf('.') - 1)) >= version;
    		}
	} else	{
		if ((navigator.userAgent.indexOf('MSIE') != -1)&&(navigator.userAgent.indexOf('Win') != -1)) {
		   	var vb = '<script language="vbscript">\n'
		            + '  on error resume next\n'
		            + '  flash = IsObject(CreateObject('
		            + '     "ShockwaveFlash.ShockwaveFlash.' + version + '"))\n'
		            + '<' + '/script>';
			document.write(vb);
		}
	}
}

function PrintFlash(path, width, height, params) {
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + version + ",0,0,0" width="' + width + '" height="' + height + '">');
	document.write ('<param name=movie value="' + path + '">');
	document.write ('<param name=quality value=high>');
	document.write ('<PARAM NAME=wmode VALUE=transparent>');
	document.write ('<PARAM name=menu value=false>');
	document.write ('<PARAM name=FlashVars value="' + params + '">');
	document.write ('<embed wmode="opaque" src="' + path + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height +'" FlashVars="' + params + '"></embed>');
  	document.write ('</object>');
}

//--------------------------------// Slide
function Slide(id) {
	if (!(objb = document.getElementById(id+'_block')) || !(objl = document.getElementById(id+'_link')))
		return;

	if (!objb.style.display || objb.style.display == 'none') {
		objb.style.display = 'block';
		objl.className = 'slideopen';
	}
	else {
		objb.style.display = 'none';
		objl.className = 'slideclose';
	}
}

