// JavaScript Document

//
//function $(id){
//	return document.getElementById(id);
//}
//
//
//	if (window.addEventListener){
//	window.addEventListener("load", collapse, false);
//	}
//	else if (window.attachEvent) {
//  			 window.attachEvent("onload", collapse);
//	}
//	if (window.addEventListener){
//	window.addEventListener("load", send, false);
//	}
//	else if (window.attachEvent) {
//  			 window.attachEvent("onload", send);
//	}
//
//
//
//function collapse(){
//	if($('all')){
//	$('all').onclick = function(){
//					   		$('all').style.display='none';
//							$('display').style.display='block';
//						}}
//}
//
//function send(){
//	$('send').onclick = function(){
//		var buffer=0;
//		reg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
//		if (!$('email').value.match(reg)) {alert("Пожалуйста, введите свой настоящий e-mail"); $('email').value="";} else buffer+=1;
//		if($('question').value=='') {alert("Вы забыли ввести вопрос!");} else buffer+=1;
//		if($('numerals').value=='') {alert("Вы забыли ввести цифры");} else buffer+=1;
//		if(buffer==3) $('form').submit();
//	}
//}
//
//

$(function() {
	$('#country').change(function() {

		var country=$(this).val();
		$.post('/application/views/officetelephony/ajax/ajax.php?action=city&country='+country, function(d) {
			$('#city').html(d);
			$('#code').html('');
		}
		)
	});
	
	
	$('#city').change(function() {

		var city=$(this).val();
		$.post('/application/views/officetelephony/ajax/ajax.php?action=code&city='+city, function(d) {
			$('#code').html(d);
		}
		)
	});
	
});



function counter()
{
	counter = "<a href='http://www.liveinternet.ru/click' "+
	"target=_blank><img src='http://counter.yadro.ru/hit?t16.2;r"+
	escape(document.referrer)+((typeof(screen)=="undefined")?"":
	";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?
	screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
	";"+Math.random()+
	"' alt='' title='LiveInternet: показано число просмотров за 24"+
	" часа, посетителей за 24 часа и за сегодня' "+
	"border=0 width=88 height=31><\/a>";
	document.getElementById('cc').innerHTML = counter;
}


function googlerek()
{
	googlerek = "<!--google_ad_client = \"pub-1744184414538669\";google_ad_slot = \"9261051245\";google_ad_width = 300;google_ad_height = 250;//-->";
	document.getElementById('google').innerHTML = googlerek;
}

