<!--
function eaddr (name, srv, param){
	var eml = "mailto:" + name +  "\@" + srv;
	if (param){
		eml+="?"+param;
	}
	window.location.href=eml;
}

function SetURLParam(newkey, newvalue){
	newkey = newkey.toLowerCase();
	var URL = newurl;
	if (!URL) URL = location.href;

	var paramadded = false;
	var newparamstr = '';

	var leftpartofURL = URL.split("?")[0];
	var oldparamstr = URL.split("?")[1];
	if (oldparamstr){
		var params = oldparamstr.split("&");
		for (var i=0; i<params.length; i++){
			var pair = params[i].split("=");
			var key=pair[0];
			var value=pair[1];
			
			if (key.toLowerCase() == newkey) {	//   
				value = newvalue;
				paramadded = true;
			}

			if (newparamstr == ''){
				newparamstr += key + "=" + value;
			} else {
				newparamstr += "&" + key + "=" + value;
			}
		}
	} else {								//    /news,     /news/,    ?dfsf=sdfsd
		if (leftpartofURL.substring(leftpartofURL.length-1, 1) != "/"){
			leftpartofURL += "/";
		}
	}

	if (!paramadded){						//        URL
		if (newparamstr == ''){
			newparamstr += newkey + "=" + newvalue;
		} else {
			newparamstr += "&" + newkey + "=" + newvalue;
		}
	}
	location.href = leftpartofURL + "?" + newparamstr;
}

function getCookie(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function setCookie(name, value, expires) {
	if (expires == 'permanent'){
		expires = 'Fri, 25 Dec 2099 23:59:59 GMT';
	} else {
		((expires) ? "; expires=" + expires.toGMTString() : "");
	}
	var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + "; path=/";
	document.cookie = curCookie;
}

function delCookie(name)
{
	document.cookie = name + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT; path=/";
}
/*	------------	BANNERS		---------------		*/
function createDomElem(name, attrs, text) {	
		var e = document.createElement(name);
		if (attrs) {
			for (key in attrs) {
				if (key == 'class') {
					e.className = attrs[key];
				} else if (key == 'id') {
					e.id = attrs[key];
				} else {
					e.setAttribute(key, attrs[key]);
				}
			}
		}
		if (text) {
			e.appendChild(document.createTextNode(text));
		}
		return e;
	}
	
//BANNER PROCESSING
function bannerProcessing ( banners )	{

	this.banners = banners;

	// CREATES DOM ELEMENT
	this.createDomElem = function(name, attrs, text) {
		var e = document.createElement(name);
		if (attrs) {
			for (key in attrs) {
				if (key == 'class') {
					e.className = attrs[key];
				} else if (key == 'id') {
					e.id = attrs[key];
				} else {
					e.setAttribute(key, attrs[key]);
				}
			}
		}
		if (text) {
			try {
				e.appendChild(document.createTextNode(text));
			}	catch (e)	{ }
		}
		return e;
	}
	
	// RETURNS RANDOM ELEMENT FROM THIS>BANNERS
	this.getRandomElement = function( arr )	{
	
		var max_random = arr.length;
		var n = Math.floor(Math.random()*max_random);
		return arr[n];
	}
	
	// RETURNS ARR WITH GIVEN NUM OF RANDOM BANNERS FROM GIVEN BANNER ARR
	this.getRandomBanners = function ( bannerNum, banners )	{	
	
		var resultBs = new Array();
	
		// IF TOTAL BANNERS LESS THAN NEED, THEN DISPLAY THEM ALL WITHOUT ANY ALGHORITMS
		if ( banners.length == bannerNum)	{
		
			return banners;
		}
		else if ( banners.length < bannerNum)	{
		
			for ( var e = 0; e < bannerNum; e++	)	{
			
				resultBs.push(this.getRandomElement(banners ));
			}
			return resultBs;
		}
		
		// GO GO GO
		for ( var i = 0; i < bannerNum; i++)	{

			// IF WE HAVE SOME ADDED BANNERS. NO DUBLICATES
			if (resultBs.length > 0)	{
				
				var dulicateFlag = false;
				
				do {
					
					var re = this.getRandomElement( banners );
					for ( var z in resultBs)	{
						
						if (resultBs[z] == re)	dulicateFlag = true;
						else dulicateFlag = false;
					}

				}	while ( dulicateFlag )
					
				resultBs.push(re);
				
			}	else	{

				var re = this.getRandomElement( banners );
				resultBs.push(re);
			}
		}
		return resultBs;
	}
	
	// HERE ARE BANNER PROCESSING ALGORITHMS
	this.work = function( bannerWriter )	{
	
		var bannerNum = 2;
		var priorBs = new Array();
		var notPriorBs = new Array();
		var resultBs = new Array();
		
		// IF TOTAL BANNERS LESS THAN NEED, THEN DISPLAY THEM ALL WITHOUT ANY ALGHORITMS
		if ( this.banners.length == bannerNum || this.banners.length < bannerNum)	{
		
			bannerWriter.bnWrite(this.banners);
			
			return true;
		}
		
		// GETTING PRIOR AND NOT PRIOR BANNERS
		for (b in this.banners)	{
		
			if (banners[b].priority == 'on')	priorBs.push(banners[b]);
			else notPriorBs.push(banners[b]);
		}
		
		// NONE PRIOR BANNERS
		if (!priorBs.length)	{
		
			resultBs = this.getRandomBanners(bannerNum, this.banners);
		}
		// PRIOR BANNERS SUM LESS THAN WE NEED
		else if ( priorBs.length < bannerNum ) {
		
			var rb = this.getRandomBanners(bannerNum-priorBs.length, notPriorBs);
			for ( var u in priorBs)	{
				resultBs.push(priorBs[u]);
			}
			for ( var z in rb)	{
				resultBs.push(rb[z]);
			}
			
		}
		// PRIOR BANNERS SUM EXACT THAT WE NEED
		else if ( priorBs.length == bannerNum ) {
			resultBs = priorBs;
		}
		// PRIOR BANNERS SUM MORE THAN WE NEED
		else if ( priorBs.length > bannerNum ) {
		
			resultBs = this.getRandomBanners(bannerNum, priorBs);
		}
		
		
		// WRITE
		bannerWriter.bnWrite( resultBs );
	}
}
/*	----------------------		RAMKI VOKRUG FLASH					*/
// When the page loads:
window.onload = function(){
  if (document.getElementsByTagName) {
    // Get all the tags of type object in the page.
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        // Get the HTML content of each object tag
        // and replace it with itself.
        objs[i].outerHTML = objs[i].outerHTML;
      }
   }
}
// When the page unloads:
window.onunload = function() {
  if (document.getElementsByTagName) {
    //Get all the tags of type object in the page.
    var objs = document.getElementsByTagName("object");
    for (i=0; i<objs.length; i++) {
      // Clear out the HTML content of each object tag
      // to prevent an IE memory leak issue.
      objs[i].outerHTML = "";
    }
  }
}
// -->
function resizeImage(imges, size)	{
	
	for (var img in imges)	{
		
		var img_o = document.getElementById(imges[img]);
		
		if (img_o)	{

			if (img_o.width > size)	{
				
				var sizeCoefficient = img_o.width/size;
				img_o.width = img_o.width/sizeCoefficient;
				img_o.height = img_o.height/sizeCoefficient;
			}
		}
	}	
}