/*
 *	Krakonos
 *	2008 (c) Khaac
 *  Javascript
 */

function fActivate(elm) {
  elm.style.border="1px solid #838383";
  elm.style.backgroundColor="#EEEDED";
}



function fDeactivate(elm) {
 elm.style.border="1px solid #ddd";
 elm.style.borderLeftColor="#c3c3c3";
 elm.style.borderTopColor="#7c7c7c";
 elm.style.backgroundColor="#FFFFFF";
}

function OpenFlash() {
  var WinTest = window.open("assets/templates/chepos/chepos-flash.html", "", "width=570,height=420,toolbar=no,menubar=no,scrollbars=no,resizable=yes");  
  // 
  if (! WinTest) {
    alert("A popup blocker was detected. Please\n" +
          "disable popup blocker to open window.");
  }
}

function PagePrint(lang){ 
	switch(lang){
		case("en"): string = 'Modern browsers will print the page using styles specially designed for print.' +	
	'\n\n Do you want to print the active page?'; break;
		case("ru"): string = 'Современные браузеры распечатают страницу с использованием стилей, специально подготовленных для печати.' +	
	'\n\n Хотите распечатать данную страницу?'; break;
		default:	string = 'Moderní prohlížeče vytisknou stránku s využitím stylů zvlášť připravených pro tisk.' +	
	'\n\n Chcete vytisknout aktuální stránku?'; break;
	}	
	if (confirm(string)) window.print();
}



function NoFile(lang){
	switch(lang){
		case("de"): string = "We apologize for a temporary unavailable document."; break;
		default:	string = "We apologize for a temporary unavailable document.";
	}
	
 	alert(string);
} 

function Bookmark(url, title) { 

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    	var mbm = document.createElement('a');
    	mbm.setAttribute('rel','sidebar');
    	mbm.setAttribute('href',url);
    	mbm.setAttribute('title',title);
    	mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);
}


function mailReverse(str) {
	if (str.substr(0, 7) != 'mailto:') return str;
	var res = 'mailto:';
	for(var i=1; i<=str.length-7;i++) res+=str.charAt(str.length-i);
	return res;
}
