function PrintVersion(){
	if (document.print_form){
		PR=window.open("","wndPrint","alwaysRaised=yes,left=0,top=0,height=500,width=730,menubar=yes,toolbar=yes,resizable=yes,status=yes,scrollbars=yes");
		document.print_form.submit();

	}else{
		alert("No print version for this page!");
	}

}

function sSearch(lang){
var error	= Array();
	error['ukr'] = "Введіть слова для пошуку";
	error['rus'] = "Ввседите слова для поиска";
	error['eng'] = "Enter search words";

var text	= Array();
	text["ukr"]	= "пошук";
	text["rus"] = "поиск";
	text["eng"] = "search";

	if(document.srch.search_words.value == '' || document.srch.search_words.value  == text[lang]){
		alert(error[lang]);
	}else{
		document.srch.submit();
	}
}

function loadPoll(id){
	//alert(get_cookie('poll_complete'))
	if(!get_cookie('poll_complete_3')){
		wo('poll.php', 600, 600, 1);
	}
}
function loadVote(id){
	if(!get_cookie('vote_'+id)){
		wo('wap_quest.php',600,750,1);
	}
}
function setSkipPoll(id)
{

 var edate = new Date();
 edate.setTime(edate.getTime() + 365 * 24 * 60 * 60 * 1000);
 set_cookie('poll_'+id, "Y" ,edate,null,null,null); 

  window.close();  

}
// Atention!!! Link on this function insert into FCk-editor!!!--------------------------
function wo(_wurl,_ww,_wh,_wscrl){

/***************
	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
// if(_wscrl==undefined){ _wscrl = 0;}
 wind_desc=window.open(_wurl,"","alwaysRaised=0,top="+wpos_y+",left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=1,scrollbars="+_wscrl+",status=1");
 wind_desc.focus();
}
///-------------------------------------------------------------------------------------

///-----Sliding-text-----------------------------------------------------
/* EXAMPLE
	fullInfo(ID, BLOCK HEIGHT, SPEED, SPEEDUP);
*/

var bHeight = new Array();
var i = new Array();
var condition = new Array;
var blocked = new Array();
var sVal; 

function move(id,opHeight,speed,speedup){

	bHeight[id] = 1;
if(!i[id])
	i[id] = bHeight[id];

if(speed <= 0)
	speed = 1;

	blocked[id] = 1;
	if(!condition[id]){
		if(i[id] < opHeight){

			if(speedup > 0){
				i[id] += speed * speedup * ((opHeight-i[id])/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] > (opHeight-1))
					i[id] = opHeight;
			}else{
				i[id] = i[id] + speed
			}

			if(i[id] > opHeight)
				i[id] = opHeight;
			
			//document.getElementById('trace').innerHTML += i[id] + "<br>";

			document.getElementById(id).style.height = i[id]+'px';
			setTimeout("move('"+id+"',"+opHeight+","+speed+","+speedup+")",50);
		}else{
			
			condition[id] = condition[id]?0:1;
			blocked[id] = 0;
		}
	
	}else{
		if(i[id] > bHeight[id]){
			
			if(speedup > 0){
				i[id] -= speed * speedup * (i[id]/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] < (bHeight[id]+1))
					i[id] = bHeight[id];
			}else{
				i[id] = i[id] - speed;
			}			
			//document.getElementById('trace2').innerHTML += i[id] + "<br>";

			if(i[id] < bHeight[id])
				i[id] = bHeight[id];
			document.getElementById(id).style.height = i[id]+'px';
			setTimeout("move('"+id+"',"+opHeight+","+speed+","+speedup+")",50);	
		}else{
			condition[id] = condition[id]?0:1;
			blocked[id] = 0;
		}
	}

}


function fullInfo(id,opHeight,speed,speedup){
if(condition[id] !=1){
	condition[id] = 0;
	i[id] = bHeight[id];
}

if(!blocked[id])
	move(id,opHeight,speed,speedup);
}
///----------------------------------------------------------------------

///--for-covermap-------------
/*function opdesc(country){
	
	if(country == "Ukraine"){
		document.location.replace("covering_uk.php");
	}else{
		wopen("covermap_popup.php?roaming_country="+country+"","covermap",550,500,1);
	}
}*/
///-/for-covermap-------------

function wopen(_wurl,_wn,_ww,_wh,_wscrl){

/***************
	wurl: window URL
	wh: window height
	ww: window width
	wsr: scrollbars 1 - yes, 0 - no
***************/
 if(screen.width){
  wpos_x = (screen.width-_ww)/2;
  if (wpos_x < 0){ wpos_x = 0;}
  wpos_y = (screen.height-_wh)/2;
  if (wpos_y < 0){ wpos_y = 0;}
 }else{
  wpos_x = 0;
  wpos_y = 0;
 }
// if(_wscrl==undefined){ _wscrl = 0 
 if(_wn==""){ _wn = "w_test";}
 wind_desc = window.open(_wurl,_wn,"alwaysRaised=0,top="+wpos_y+",left="+wpos_x+",height="+_wh+",width="+_ww+",menubar=0,resizable=1,scrollbars="+_wscrl+",status=1");
 wind_desc.focus();
}


/*	CROSS LINKs------------------------------------*/
function cross(link){
	
	var URL = document.URL;
	//alert("URL: "+URL)
	var reg1 = /^http:\/\//;
	var reg2 = /^.*\/light\/+./i;
	var reg21= /\/light\//i;
	var reg3 = /http:\/\/+[^\/]*\/+/i

	if(reg1.test(link)){
		//alert("http://")
		if(reg2.test(URL)){
			//alert("LIGHT")
			
			if(reg2.test(link)){
				location.replace(link)
			}else{
				var arr=reg3.exec(link)
				link = link.replace(arr[0],arr[0]+"light/")
				//alert(link)
				location.replace(link)
			}
		
		}else{
			//alert("not LIGHT")
			if(reg2.test(link)){
				link = link.replace(reg21, "/");
				//alert(link)
				location.replace(link)
			}else{
				location.replace(link)
			}
		}
	}else{
		location.replace(link)
		//alert("in site")
	}

}

/*	/CROSS LINKs-----------------------------------*/



/* ---------------Copyrights---------------------*/
//var TEXT = Array(2,15,25,1,14);
var TEXT = Array(9,14,6,15);
var NUM = 0;
function copy(letter){
	//alert(letter)	
	if(letter == TEXT[NUM]){
		NUM++;
		if(NUM == TEXT.length){
			alert('Разработано и склепано мужественными трудягами из "World Web Studio":\n\nМаксим Гаев (директор)\n---\nНаталья Будкевич (руководитель отдела по работе с клиентами)\n   Владимир Куртяк\n---\nСергей Мельников (Арт-директор)\n   Дмитрий Силантьев\n---\nСергей Кривошея - мультимедия разработки\n---\nАлексей Пилипенко (начальник IT-отдела)\n   Святослав Маньковский\n   Аркадий Смирнов\n---\n Андрей Бойко (начальник отдела верстки)\n   Константин Назаренко\n   Светлана Морозова\n---\nНаталья Кидюх - копирайтер\n\n---------=======Да прибудет с нами "СИЛА"!!!=======---------\n\n\nКомпания "World Web Studio" благодарит UMC за сотрудничество.');
		}
	}else{
		NUM = 0;
	}
}
/*-----------------------------------------------*/

/*----------ROLLOVER------------------------------*/
/* Example
onMouseOver="MM_swapImage('IMG_NAME','','img/SUBSTITUTE_IMG',1)" onMouseOut="MM_swapImgRestore()"
*/


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*----------ROLLOVER------------------------------*/

function sendsms(){
	wopen('sendsms.php','sendsms',650,720,1);
}


 function DoSubmit(nlog){   if(nlog==1){    document.WebLoginForm.submit();   }else{    document.NonSubViewMsgForm.submit();   }  } 

/*	COOKIE	------------------------------------*/
function get_cookie(Cname){
/* example
get_cookie("COOKIE NAME")

*/
 var result = null;
 var myCookie = " " + document.cookie + ";";
 var searchName = " " + Cname + "=";
 var startOfCookie = myCookie.indexOf(searchName);
 //alert(startOfCookie);
 var endOfCookie;
 if(startOfCookie != -1){
  startOfCookie += searchName.length;
  endOfCookie = myCookie.indexOf(";",startOfCookie);
  result = unescape(myCookie.substring(startOfCookie,endOfCookie));
 }
 return result;
}

function set_cookie(Cname,Cvalue,expires,path,domain,secure){
/* example
 var edate = new Date();
 edate.setTime(edate.getTime() + 365 * 24 * 60 * 60 * 1000);
 set_cookie("COOKIE NAME","VALUE",edate,null,null,null);

*/


 var expString = ((expires == null) ? "" : ("; expires=" + expires.toGMTString()));
 var pathString = ((path == null) ? "" : ("; path=" + path));
 var domainString = ((domain == null) ? "" : ("; domain=" + domain));
 var secureString = ((secure == true) ? "; secure" : "");
 document.cookie = Cname + "=" + escape (Cvalue) + expString + pathString + domainString + secureString;
}

function clear_cookie(Cname){
/*
	 clear_cookie("COOKIE NAME")

*/

 var ThreeDays = 3 * 24 * 60 * 60 *1000;
 var expDate = new Date();
 expDate.setTime (expDate.getTime() - ThreeDays);
 document.cookie = Cname + "=ImOutOfHere; expires=" + expDate.toGMTString();
}
/*	/COOKIE	------------------------------------*/

function rand(id)
      {
          var now=new Date()
          var num=(now.getSeconds())%4
          var num=num+1
		  var lang
		  var ban1_src
		  var ban1_href
		  var ban2_src
		  var ban2_href
			  if(id == 1){lang="ukr"}
			  if(id == 2){lang="rus"}
			  if(id == 3){lang="eng"}
		  if(num == 1){
			  ban1_src="http://www.umc.ua/img/" + lang + "/search_ban.jpg";
			  ban2_src="http://www.umc.ua/img/" + lang + "/calc_ban.jpg";
			  ban1_href="http://www.umc.ua/" + lang + "/search.php";
			  ban2_href="http://www.umc.ua/" + lang + "/calc.php";
		  }
		  if(num == 2){
			  ban1_src="http://www.umc.ua/img/" + lang + "/calc_ban.jpg";
			  ban2_src="http://www.umc.ua/img/" + lang + "/roam_ban.jpg";
			  ban1_href="http://www.umc.ua/" + lang + "/calc.php";
			  ban2_href="http://www.umc.ua/" + lang + "/covermap.php";
		  }
		  if(num == 3){
			  ban1_src="http://www.umc.ua/img/" + lang + "/roam_ban.jpg";
			  ban2_src="http://www.umc.ua/img/ukr/informer_bnr_inner.gif";
			  ban1_href="http://www.umc.ua/" + lang + "/covermap.php";
			  ban2_href="/" + lang + "/informer.php";
		  }
		  if(num == 4){
			  ban1_src="http://www.umc.ua/img/ukr/informer_bnr_inner.gif";
			  ban2_src="http://www.umc.ua/img/" + lang + "/search_ban.jpg";
			  ban1_href="/" + lang + "/informer.php";
			  ban2_href="http://www.umc.ua/" + lang + "/search.php";
		  }
		  window.document.getElementById("ban1").src=ban1_src;
		  window.document.getElementById("ban2").src=ban2_src;
		  window.document.getElementById("href1").href=ban1_href;
		  window.document.getElementById("href2").href=ban2_href;

      }
	  
/*  RENDOM FOOTER */	
function setFirstVisit()
{
 var edate = new Date();
 edate.setTime(edate.getTime() + 365 * 24 * 60 * 60 * 1000);
 set_cookie('first_visit', 'footer'+number ,edate,null,null,null); 
}
 