/*
	by Malkin S.A. KPI-Telecom 2005-2006
*/

function my_function() {
		var d_height;
		var e;
		s=document.getElementById('middle_c').offsetHeight;
		document.getElementById('middle_l').style.height = s;
		//window.alert(s);
		document.getElementById('middle_r').style.height = s;
		//e = window.event;
		//if (e.type=='resize') { 
		//		document.getElementById('middle_l').style.height = document.getElementById('middle_c').offsetHeight;
		//}
		d_height = document.getElementById('text').offsetHeight;
		//document.getElementById('wrapper').style.height=d_height;
		//document.body.style.height=d_height;
		//window.alert(document.getElementById('middle').offsetHeight + document.body.style.height);
}
function getSubs() {
	return document.getElementById('subs_id').value;
}
function getAction() {
	return document.getElementById('action_id').options[document.getElementById('action_id').selectedIndex].value;
}
function getMime() {
	return document.getElementById('mime_id').options[document.getElementById('mime_id').selectedIndex].value;
}
function getSubmit() {
	return document.getElementById('submit_id').value;
}
function myprint() {
	return document.getElementById('text').innerHTML;
}
function mytitle() {
	return document.getElementById('title').innerHTML;
}
function testFaq() {
	if (document.getElementById('name').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Ваше ім\'я'!");
		document.getElementById('name').focus();
	}
	else if (document.getElementById('email').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Ваш email'!"); 
		document.getElementById('email').focus();
		return false; 
	}
	else if (document.getElementById('email').value.match(/^[a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,6}$/i)== null)
	{
		alert("Ви ввели не коректну e-mail адресу. Будь-ласка введіть коректні данні!"); 
		document.getElementById('email').focus();
		return false; 
	}
	else if (document.getElementById('question').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Введіть ваше запитання'!");
		document.getElementById('question').focus();
	}
	else { document.getElementById('faqform').submit(); }
}
function testFeed() {
	if (document.getElementById('element[1]').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Ваше ім\'я'!");
		document.getElementById('element[1]').focus();
	}
	else if (document.getElementById('element[2]').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Ваш email'!"); 
		document.getElementById('element[2]').focus();
		return false; 
	}
	else if (document.getElementById('element[2]').value.match(/^[a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,6}$/i)== null)
	{
		alert("Ви ввели не коректну e-mail адресу. Будь-ласка введіть коректні данні!"); 
		document.getElementById('element[2]').focus();
		return false; 
	}
	else if (document.getElementById('element[3]').value == '')
	{
		alert("Будь-ласка, заповніть поле 'Ваше повідомлення'!");
		document.getElementById('element[3]').focus();
	}
	else { document.getElementById('feedForm').submit(); }
}
function changeBanner() {
	document.getElementById('bigmirbanner').innerHTML="<a href='http://www.bigmir.net'><img src='/img/b02.png' alt='birmir counter' /></a>";
}
/*function Tooltip(){
	this.timer_delay=500;
	this.left_offset=-2;
	this.top_offset=18;
	this.popup_max_width=400;
	this.popup_obj=document.createElement("DIV");
	this.tag_new_attribute="x_tooltip";
	this.show_process=false;
	this.check_opera=false;
	this.timer_id=null;
	this.search_tag=search_tag;
	this.set_event=set_event;
	this.show_popup=show_popup;
	this.set_coordinate=set_coordinate;
	this.hidden_popup=hidden_popup;
	this.popup_obj.className=this.tag_new_attribute;
	document.body.appendChild(this.popup_obj);
	this.search_tag("a");
	this.search_tag("imb");
	this.search_tag("input");
	function search_tag (name){
		var tag_obj=document.getElementsByTagName(name);
		var total_elm=tag_obj.length;
		var elm_title=null;
		var elm_alt=null;
		var new_title='';
		for (var i=0; i<total_elm; i++){
				elm_title=tag_obj[i].getAttribute("title");
				elm_alt=tag_obj[i].getAttribute("alt");
				if ((elm_title!=null && elm_title!='') || (elm_alt!=null && elm_alt!='')){
					(elm_title!=null && elm_title.length>0)? new_title=elm_title : new_title=elm_alt;tag_obj[i].setAttribute(this.tag_new_attribute, new_title);
				if (tag_obj[i].getAttribute(this.tag_new_attribute)){
					tag_obj[i].removeAttribute("title");
					tag_obj[i].removeAttribute("alt");
					this.set_event(tag_obj[i], "mouseover", this.show_popup);
					this.set_event(tag_obj[i], "mouseout", this.hidden_popup);
					}
				}
			}
		}
	function set_event (obj, ev_name, attach){
		if (obj.addEventListener) obj.addEventListener(ev_name, attach, false);
		else if (obj.attachEvent) obj.attachEvent("on"+ev_name, attach);
		else return null;
	}
	function show_popup (oME){
		var elm=window.event ? window.event.srcElement : oME.currentTarget;
		if (elm!=null && (elm.tagName=="A" || elm.tagName=="IMG" || elm.tagName=="INPUT")){
				document.onmousemove=x_tooltip.set_coordinate;
				txt=elm.getAttribute(x_tooltip.tag_new_attribute);
				x_tooltip.popup_obj.innerHTML=main.trim(txt);
				x_tooltip.show_process=true;
				x_tooltip.timer_id=setTimeout('x_tooltip.popup_obj.style.visibility="visible";', x_tooltip.timer_delay);
		}
		else alert("This link can\'t parser by x_tooltip :-), TAG=>"+elm.tagName);
	}
	function set_coordinate (oME){
		if (x_tooltip.show_process){
				var new_x_pos=0;
				var new_y_pos=0;
				var opera_height_tooltip=0;
				var ev_obj=window.event ? window.event : oME;
				var db_obj=document.body;
				var x=ev_obj.clientX+db_obj.scrollLeft;
				var y=ev_obj.clientY+db_obj.scrollTop;
				var popup_width=(window.event)? x_tooltip.popup_obj.clientWidth : x_tooltip.popup_obj.offsetWidth;
				var popup_height=(window.event)? x_tooltip.popup_obj.clientHeight : x_tooltip.popup_obj.offsetHeight;
				var window_width=db_obj.clientWidth+db_obj.scrollLeft;
				var window_height=db_obj.clientHeight+db_obj.scrollTop;
				if (x_tooltip.check_opera && main.get_user_agent()=='Opera') 
					opera_height_tooltip=20;
				( (window_width-x)<(popup_width))? new_x_pos=(x-popup_width)+6 :  new_x_pos=x+x_tooltip.left_offset;
				( (window_height-(y+opera_height_tooltip))<(popup_height+x_tooltip.top_offset))? new_y_pos=(y-popup_height)-5 :  new_y_pos=y+opera_height_tooltip+x_tooltip.top_offset;
				if (popup_width>x_tooltip.popup_max_width){x_tooltip.popup_obj.style.width=x_tooltip.popup_max_width+"px";
				popup_width=x_tooltip.popup_obj.clientWidth;
				}
				x_tooltip.popup_obj.style.left=new_x_pos+"px";
				x_tooltip.popup_obj.style.top=new_y_pos+"px";
				}
		}
	function hidden_popup (){
		x_tooltip.show_process=false;
		x_tooltip.popup_obj.style.left="-99px";
		x_tooltip.popup_obj.style.top="-99px";
		x_tooltip.popup_obj.style.visibility="hidden";
		clearTimeout(x_tooltip.timer_id);
	}
}
main.add_onload_method("x_tooltip=new Tooltip();");*/