

//Проверка на нажатие enter
function TestKeyPressOnEnter(event, UniqueID){
	if (event.keyCode == 13) {
	    var p = document.getElementById(UniqueID);
		p.focus();
//		p.click();
        var agt = navigator.userAgent.toLowerCase();
        if (agt.indexOf('ie') != -1 ){
            p.click();
        }
        else{
            var oEvt = document.createEvent ('MouseEvents');
            oEvt.initMouseEvent("click", true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null);                    
            p.dispatchEvent(oEvt);	
        }
     }
}

//открытие popupwindow
function PopupWindow(url)
{
	window.open(url);
}

//Редирект после паузы
function CountRedirect(sUrl, nTime, CounterName) {
	if(nTime == "0") {
		window.location = sUrl;
	} else {
		var pCounter = document.getElementById(CounterName);
		pCounter.innerText = nTime.toString();
		setTimeout("CountRedirect('" + sUrl + "'," + (--nTime).toString() + ", '" + CounterName + "')", 1000);
	}
}

