var myprompt=document.createElement('div');
myprompt.id='prompt';
myprompt.style.display='none';
myprompt.style.position='absolute';
myprompt.style.top='0px';
myprompt.style.left='0px';
myprompt.show_delay=50;
myprompt.hide_delay=500;
myprompt.cursor_shiftX=20;
myprompt.cursor_shiftY=-25;
myprompt.prompt_elements=new Array('a');
 
function showPrompt(event,id){
    if(!event) event=window.event;
    if(myprompt.mustShow==undefined){
        if(myprompt.timer_id){
            window.clearInterval(myprompt.timer_id);
            myprompt.mustHide=undefined;
        }
        if (!id) id=1;
        if (id==1){	
        	myprompt.next_message='<p align=justify>Мастер-класс - формат обучения, целью которого является передача уникальных, авторских методик и опыта. Как правило, мастер-классы ведут эксперты, имеющие серьезный опыт работы в заявленной профессиональной области.</p>';
        }	
	else if (id==2){
		myprompt.next_message='<p align=justify>Практикум - формат обучения, в процессе которого участники имеют возможность познакомиться с новыми для них способами поведения или схемами анализа, позволяющими существенно повысить личную эффективность, и попрактиковаться в их применении.</p>';
	}
	else if (id==3){
		myprompt.next_message='<p align=justify>Семинар-презентация - формат общения с постоянными и потенциальными клиентами компании. На презентациях мы рассказываем о своих подходах к работе, делимся опытом реализованных проектов, обсуждаем найденные нами новые идеи и решения в области корпоративного обучения.</p>';
	}
	else if (id==4){
		myprompt.next_message='<p align=justify>Мастерская - клуб для тренеров, целью которого является обмен опытом и профессиональное развитие. Тренеры компании "99 по Фаренгейту" предлагают коллегам поучаствовать в выполнении различных упражнений (с последующим обсуждением и анализом). Участники могут выносить на обсуждение актуальные для них вопросы (связанные с разработкой и проведением тренингов). </p>';
	}
	else if (id==5){
		myprompt.next_message='<p align=justify>Тренинг - формат обучения, целью которого является  развитие у участников навыков и умений, необходимых им в работе или в личной жизни. В процессе тренинга у участников также происходит формирование новых представлений, изменение привычных взглядов, подходов, отношений.</p>';
	}	
        myprompt.mustShow=true;
        myprompt.oldX=event.clientX+document.body.scrollLeft-150;
        myprompt.oldY=event.clientY+document.body.scrollTop-50;
        myprompt.timer_id=window.setInterval('showPrompt();',myprompt.show_delay);
    }else{
        window.clearInterval(myprompt.timer_id);
        myprompt.innerHTML=myprompt.next_message;
        myprompt.timer_id=undefined;
        myprompt.mustShow=undefined;
        myprompt.style.left=(myprompt.oldX+myprompt.cursor_shiftX-150)+'px';
        myprompt.style.top=(myprompt.oldY+myprompt.cursor_shiftY-50)+'px';
        myprompt.style.display='block';
    }
}
function hidePrompt(){
    if(myprompt.mustHide==undefined){
        if(myprompt.timer_id){
            window.clearInterval(myprompt.timer_id);
            myprompt.mustShow=undefined;
        }
        myprompt.mustHide=true;
        myprompt.timer_id=window.setInterval('hidePrompt();',myprompt.hide_delay);
    }else{
        window.clearInterval(myprompt.timer_id);
        myprompt.timer_id=undefined;
        myprompt.mustHide=undefined;
        myprompt.style.display='none';
    }
}
function refreshPromptCoords(event){
    if(myprompt.mustShow==undefined) return;
    if(!event) event=window.event;
    myprompt.oldX=event.clientX+document.body.scrollLeft;
    myprompt.oldY=event.clientY+document.body.scrollTop;
}
function setPromptEvents(){
    document.body.appendChild(myprompt);
    for(var k=0; k<myprompt.prompt_elements.length; k++){
        var anchors=document.getElementsByTagName(myprompt.prompt_elements[k]);
        for(var i=0; i<anchors.length; i++){
            var spans=anchors[i].getElementsByTagName('span');
            if(spans.length==0) continue;
            for(var j=0; j<spans.length; j++){
                if(spans[j].className=='prompt'){
                    anchors[i].prompt_text=spans[j].innerHTML;
                    break;
                }
            }
            if(!anchors[i].prompt_text) continue;
            anchors[i].onmouseover=showPrompt;
            anchors[i].onmouseout=hidePrompt;
            anchors[i].onmousemove=refreshPromptCoords;
 
            myprompt.onmouseout = hidePrompt;
            myprompt.onmouseover = function(){
                clearTimeout(myprompt.timer_id);
                myprompt.mustHide = undefined;
            }
            myprompt.onclick = function() {
                myprompt.mustHide = true;
                hidePrompt();
            }
        }
    }
}

if (typeof document.attachEvent!='undefined') window.attachEvent('onload',setPromptEvents);
else window.addEventListener('load',setPromptEvents,false);


function viewcaldiv(id,ar){
 did = 'cal_d'+id; 
 d = document.getElementById(did); 
 iid = 'cal_i'+id; 
 i = document.getElementById(iid);
 if (ar==1){
  d.style.display = 'block';
  d.style.visibility = 'visible';
  i.innerHTML = "<img style='cursor:hand;'"+" onclick=viewcaldiv("+id+",2) src='images/cal_up.gif' border=0>";
 }
 else{
  d.style.display = 'none';
  d.style.visibility = 'hidden';
  i.innerHTML = "<img style='cursor:hand;'"+" onclick=viewcaldiv("+id+",1) src='images/cal_down.gif' border=0>";
 }
}//viewcaldiv

function viewcaldate(id){
 did = 'cal'+id; 
 d = document.getElementById(did); 
 if (d.style.display=='block'){
  d.style.display='none';
  d.style.visibility = 'hidden';
 }
 else {
  d.style.display='block'; 
  d.style.visibility = 'visible';
 } 
}//viewcaldate


function calendarvisible(eId,direction) {


for (j=0;j<=2;j++){
for (i=1;i<=3;i++){

	teId = 'c'+j+'d'+i;
	meId = 'c'+j+'m'+i;
	ieId = 'c'+j+'i'+i;

	//alert(ieId+'='+eId);	

	ve = document.getElementById(teId);	

	if (ve != null){

	me = document.getElementById(meId);
	ie = document.getElementById(ieId);	

	//alert(teId+'='+eId);
	
	if (teId == eId){	
		
		
		if (ve.style.display == "none"){
			ve.style.display = "block";
			me.innerHTML = "<input type=button class=calendarbutton"+j+" onclick='calendarvisible(\""+teId+"\","+j+");' value='закрыть'>";	
			ie.innerHTML = "<img style='cursor:hand;'"+" onclick='calendarvisible(\""+teId+"\","+j+");' src='images/close.gif' width=12 height=12 align=right border=0>";

			
		}
		else{
			if (ve.style.display == "block"){
				ve.style.display = "none";
				me.innerHTML = "<input type=button class=calendarbutton"+j+" onclick='calendarvisible(\""+teId+"\","+j+");' value='подробнее'>";	
				ie.innerHTML = "<img style='cursor:hand;'"+" onclick='calendarvisible(\""+teId+"\","+j+");' src='images/more.gif' width=12 height=12 align=right border=0>";
			}
			else{
				ve.style.display = "block";
				me.innerHTML = "<input type=button class=calendarbutton"+j+" onclick='calendarvisible(\""+teId+"\","+j+");' value='закрыть'>";	
				ie.innerHTML = "<img style='cursor:hand;'"+" onclick='calendarvisible(\""+teId+"\","+j+");' src='images/close.gif' width=12 height=12 align=right border=0>";
			}
		}
	}
	else{	
		
		ve.style.display = "none";
		me.innerHTML = "<input type=button class=calendarbutton"+j+" onclick='calendarvisible(\""+teId+"\","+j+");' value='подробнее'>";	
		ie.innerHTML = "<img style='cursor:hand;'"+" onclick='calendarvisible(\""+teId+"\","+j+");' src='images/more.gif' width=12 height=12 align=right border=0>";		
	}
	}//null
}//i
}//j

}//calendarvisible

function checksendmessage() {
  if (document.send_message.name.value=="") {
    alert ("Укажите Ваше имя");
    document.send_message.name.focus();
    return false;
  } 
  else {
	if (document.send_message.message.value=="") {
    		alert ("Укажите текст сообщения");
    		document.send_message.message.focus();
    		return false;
	}
	else {
		visibleelement('dmessage',0);
		return true;
	}
  }
}


function messagevisible1(eId,eVisible,left,top) {

	if (eVisible == 0){
		ve = document.getElementById(eId).style.visibility = "hidden";
	}
	else{
		ve = document.getElementById(eId).style.visibility = "visible";

		ve.style.left = left;
		ve.style.top = top;
		
	}
}//visibleelement

function messagevisible(eId,eVisible,left,top,is_top) {

	ve = document.getElementById(eId);

	if (eVisible == 0){
		ve.style.display = "none";
	}
	else{
		ve.style.display = "block";	

		if(navigator.appName.substring (0,3)=='Mic'){			
			iy=event.y;
		}
		else{	
				
			iy=event.pageY;
			
		}
		
		//iy=ve.offsetTop;

		ve.style['left'] = Math.round((screen.width/2)-240);

		if (is_top == 1){
			ve.style['top'] = iy + 10;//Math.round((screen.height/2)-130);
		}
		else{
			ve.style['top'] = iy - 372;
		}
		ve.style['position'] = "absolute";	
		document.send_message.name.focus();
		
	}
}//visibleelement


function wopen(url, w, h, r) {
if (!url) return false;
if (!w) w = 690;
if (!h) h = 357;
if (!r) r = 0;
else r = 1;

var left = Math.round((screen.width/2)-240);
var top = Math.round((screen.height/2)-130);

var newWin = window.open(url, "popDialog", "status=0,menubar=0,titlebar=0,toolbar=0,scrollbars=0,resizable=0,width="+w+",height="+h+",left="+left+",top="+top);
return false;
}

function sOvr(src,clrOver) {
	src.style.cursor='hand';
	src.children.tags('a')[0].style.color=clrOver;
	src.style.border='solid 1px '+clrOver;

}
function sOut(src,clrOut1,clrOut2) {
	src.style.cursor = 'default';
	src.children.tags('a')[0].style.color=clrOut1;
	src.style.border='solid 1px '+clrOut2;

}
function mClk(src) {
	if(event.srcElement.tagName=='TD'){
	src.children.tags('a')[0].click();
	}
}


function rowOvr(src,clrOver) {
	src.style.cursor='pointer';
	src.style.backgroundColor=clrOver;

}
function rowOut(src,clrOut) {
	src.style.cursor = 'default';
	src.style.backgroundColor=clrOut;

}
function rowOvr2(src,clrOver) {
	src.style.backgroundColor=clrOver;
}
function rowOut2(src,clrOut) {
	src.style.backgroundColor=clrOut;
}
function rowClk(src) {
	document.location = src;
}


function showFlash (flashName,w,h) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+w+"' height='"+h+"'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='movie' value='"+flashName+"' />");
	document.write("<param name='menu' value='false' />");
	document.write("<param name='quality' value='high' />");
	document.write("<embed src='"+flashName+"' menu='false' quality='high' width='"+w+"' height='"+h+"' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

function showPreloader() {
document.write("<div id='preloader' style='position:absolute; top:300px; left:500px; display:block;  background-color:#fff; padding:10px; z-index:1000;'><div style='background-color:#efefef; border: 1px solid #595959; text-align: center; padding:50px;'>Загрузка страницы,<br>пожалуйста, подождите<br><br><img src='/images/preloader.gif' alt='' width='104' height='17' border='0'></div></div>");

}


function hiddenPreloader() {
document.getElementById("preloader").style.visibility = "hidden";
}






function visibleelement(eId,eVisible) {

	if (eVisible == 0){
		ve = document.getElementById(eId).style.visibility = "hidden";
	}
	else{
		ve = document.getElementById(eId).style.visibility = "visible";
	}
}//visibleelement

function showelement(eId) {

  if (document.getElementById(eId).style.display=="none"){
    document.getElementById(eId).style.display="block";
  }
  else{
    document.getElementById(eId).style.display="none";
  }
}//showelement






function checkSiteSearchForm () {
  if (document.siteSearch.Requery.value=="" || document.siteSearch.Requery.value == "поиск по сайту") {
    alert ("Задан пустой поисковый запрос");
    document.siteSearch.Requery.focus();
    return false;
  } else {
    return true;
  }
}
/*
//---------------------------------------------------------------
// Opacity Displayer, Version 1.0
// Copyright Michael Lovitt, 6/2002.
// Distribute freely, but please leave this notice intact.
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY OBJECT
//
// Instantiates the object, defines the properties and methods.
function OpacityObject(divId, strPath) {

	this.id = divId;
	this.path = strPath;
	if (ns){
		if (browserVersion>=5) {
			this.layerObject = document.getElementById(divId).style;
		} else { 
			this.layerObject = eval("document."+divId);
		}
	} else {
		this.layerObject = eval(divId + ".style");
	}
	this.setBackground = od_object_setBackground;
}
// Uses AlphaImageLoader filter, or the css background property,
// as appropriate, to apply a PNG or GIF as the background of the layerObject.
function od_object_setBackground() {	
	if (pngAlpha) {
		this.layerObject.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.path+".png', sizingMethod='scale')";
	} else if (pngNormal) {
		this.layerObject.backgroundImage = 'url('+this.path+')';
	} else {
		this.layerObject.backgroundImage = 'url('+this.path+')';
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY DISPLAY FUNCTION
// Outputs the image as a div with the AlphaImageLoader, or with
// a standard image tag.
function od_displayImage(strId, strPath, intWidth, intHeight, strClass, strAlt) {	
	if (pngAlpha) {
		document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'\', sizingMethod=\'scale\')" id="'+strId+'" class="'+strClass+'"></div>');
	} else if (pngNormal) {
		document.write('<img src="'+strPath+'" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />');
	} else {
		document.write('<img src="'+strPath+'" width="'+intWidth+'" height="'+intHeight+'" name="'+strId+'" border="0" class="'+strClass+'" alt="'+strAlt+'" />');
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY ROLL-OVER FUNCTIONS
function od_rollOver(strId, strColor) {	
	if (pngAlpha) {
		document.getElementById(strId).style.backgroundColor = strColor;
	} else {
	    if (document.images && (flag == true)) {
	        document[strId].src = eval(strId + "on.src");
	    }
	}
}
function od_rollOut(strId, strColor) {	
	if (pngAlpha) {
		document.getElementById(strId).style.backgroundColor = strColor;
	} else {
	    if (document.images) {
	        document[strId].src = eval(strId + "off.src");
	    }
	}
}
//---------------------------------------------------------------

//---------------------------------------------------------------
// global variables

// if IE5.5+ on win32, then display PNGs with AlphaImageLoader
if ((browser.isIE55 || browser.isIE6up) && browser.isWin32) {
	var pngAlpha = true;
	var strExt = ".png";
// else, if the browser can display PNGs normally, then do that. that list includes:
	//     -Gecko Engine: Netscape 6 or Mozilla, Mac or PC
	//     -IE5+ Mac (OpacityObject applies the background image at 100% opacity)
	//     -Opera 6+ PC
	//     -Opera 5+ Mac (Doesn't support dynamically-set background images)
	//     -Opera 6+ Linux 
	//     -Omniweb 3.1+ 
	//     -Icab 1.9+ 
	//     -WebTV 
	//     -Sega Dreamcast
} else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) {
	var pngNormal = true;
	var strExt = ".png";
	// otherwise, we use plain old GIFs
} else {
	var strExt = ".gif";
}

var ns = (document.all)?false:true;
var browserVersion = parseFloat(navigator.appVersion );
//---------------------------------------------------------------
function BrowserDetectLite() {
	var ua = navigator.userAgent.toLowerCase(); 
	this.ua = ua;

	// browser name
	this.isGecko     = (ua.indexOf('gecko') != -1);
	this.isMozilla   = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length);
	this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
	this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
	this.isOpera     = (ua.indexOf("opera") != -1); 
	this.isKonqueror = (ua.indexOf("konqueror") != -1); 
	this.isIcab      = (ua.indexOf("icab") != -1); 
	this.isAol       = (ua.indexOf("aol") != -1); 
	this.isWebtv     = (ua.indexOf("webtv") != -1); 
	this.isOmniweb   = (ua.indexOf("omniweb") != -1);
	this.isDreamcast   = (ua.indexOf("dreamcast") != -1);
	
	// spoofing and compatible browsers
	this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE);
	this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla);
	
	// browser version
	this.versionMinor = parseFloat(navigator.appVersion); 
	
	// correct version number for NS6+ 
	if (this.isNS && this.isGecko) {
		this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
	}
	
	// correct version number for IE4+ 
	else if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	}
	
	// correct version number for Opera 
	else if (this.isOpera) {
		if (ua.indexOf('opera/') != -1) {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
		}
		else {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
		}
	}
	
	// correct version number for Konqueror
	else if (this.isKonqueror) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
	}
	
	// correct version number for iCab 
	else if (this.isIcab) {
		if (ua.indexOf('icab/') != -1) {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
		}
		else {
			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
		}
	}
	
	// correct version number for WebTV
	else if (this.isWebtv) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) );
	}
	
	this.versionMajor = parseInt(this.versionMinor); 
	this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
	
	// platform
	this.isWin   = (ua.indexOf('win') != -1);
	this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) );
	this.isMac   = (ua.indexOf('mac') != -1);
	this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
	
	// specific browser shortcuts
	this.isNS4x = (this.isNS && this.versionMajor == 4);
	this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
	this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
	this.isNS4up = (this.isNS && this.versionMinor >= 4);
	this.isNS6x = (this.isNS && this.versionMajor == 6);
	this.isNS6up = (this.isNS && this.versionMajor >= 6);
	
	this.isIE4x = (this.isIE && this.versionMajor == 4);
	this.isIE4up = (this.isIE && this.versionMajor >= 4);
	this.isIE5x = (this.isIE && this.versionMajor == 5);
	this.isIE55 = (this.isIE && this.versionMinor == 5.5);
	this.isIE5up = (this.isIE && this.versionMajor >= 5);
	this.isIE6x = (this.isIE && this.versionMajor == 6);
	this.isIE6up = (this.isIE && this.versionMajor >= 6);
	
	this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetectLite();
*/
