
function check_number()
{	window.event.cancelBubble=true;
	if (
	((window.event.keyCode >=48)&&(window.event.keyCode<=57))
	) 
	return true
	else return false;
}
function check_float()
{	window.event.cancelBubble=true;
	if (
	((window.event.keyCode >=48)&&(window.event.keyCode<=57))||(window.event.keyCode==46)
	) 
	return true
	else return false;
}
function goto_url(url)
{
	document.location.href=url; 
}

function select_region(id,type)
{
	if (id=='30546|80')
	{
		if (type=='adv')
		{
			load_select(id,'region_id','street_id');
			$('#trstreet').css("display","");
			$('#street_id').disabled=false;
			$('#trstreet2').css("display","none");
			$('#street').disabled=true;
			$('#trhouse').css("display","");
			$('#house').disabled=false;
		}
		$('#tr_city').css("display","none");
		document.getElementById('city_id').disabled=true;
		$('#tr_subregion').css("display","none");
		document.getElementById('sub_region_id').disabled=true;
	}
	else
	{
		clear_select('sub_region_id','');
		load_select(id,'region_id','city_id');
		if (type=='adv')
		{
			$('#trstreet').css("display","none");
			$('#street_id').disabled=true;
			$('#trstreet2').css("display","");
			$('#street').disabled=false;
			$('#trhouse').css("display","");
			$('#house').disabled=false;
		}
		$('#tr_city').css("display","");
		$('#city_id').disabled=false;
		$('#tr_subregion').css("display","");
		document.getElementById('sub_region_id').disabled=false;
	}
}
function select_region_find(id,type)
{
	if (id=='30546|80')
	{
		if (type=='adv')
		{
			//load_select(id,'region_id','street_id');
			$('#tr_district').css("display","");
			document.getElementById('district_id').disabled=false;
		}
		$('#tr_city').css("display","none");
		document.getElementById('city_id').disabled=true;
		$('#tr_subregion').css("display","none");
		document.getElementById('sub_region_id').disabled=true;
	}
	else
	{
		clear_select('sub_region_id','');
		load_select(id,'region_id','city_id');
		if (type=='adv')
		{
			$('#tr_district').css("display","none");
			$('#district_id').disabled=true;
		}
		$('#tr_city').css("display","");
		$('#city_id').disabled=false;
		$('#tr_subregion').css("display","");
		document.getElementById('sub_region_id').disabled=false;
	}
}

/////////////////  ÔÈËÜÒÐ ////////////////////
function filter(id)
{
$("#filter_"+id).css("display","");
$("#textfilter_"+id).css("display","none");
}
function filtering(obj,table,value)
{
	if (value.length>=2)
	{
		document.getElementById(obj).disabled=true;
		clear_select(obj,'Çàãðóçêà...');
		$.ajax({
		  url: "/jshttprequest/filtering.php?obj="+obj+"&table="+table+"&value="+value,
		  cache: false,
		  success: function(result){
		    document.getElementById(obj).disabled=false;
			result=result.split('&para;');
			var arr_count=result.length;
			for (i=0; i<(arr_count-1); i++) 
			{
				document.getElementById(obj).options[i] = new Option();
				str=result[i].split('#');
				document.getElementById(obj).options[i].value = str[0];
				document.getElementById(obj).options[i].text = str[1];
			}		
		  }
		});
	}
}
/////////////////  ÔÈËÜÒÐ ////////////////////

function reunit(koef)
{
if ($("#param13")) $("#param13").val($("#param13").attr('value')*koef);
if ($("#param13\\[1\\]")) $("#param13\\[1\\]").val($("#param13\\[1\\]").attr('value')*koef);
if ($("#param13\\[2\\]")) $("#param13\\[2\\]").val($("#param13\\[2\\]").attr('value')*koef);
$("#unit_id option[value='1']").attr("selected","selected");
}

var c = new Array();
function show_f(id)
{
$("#mr"+id+" a").animate({color: "#FF0000"}, {queue:false, duration:150 });
$("#mr"+id).animate({color: "#FF0000"}, {queue:false, duration:150 });
if (c[id]) clearTimeout(c[id]);
}
function hide_f(id)
{
	c[id]=setTimeout('$("#mr'+id+' a").animate({color: "#FFFFFF"}, { queue:false, duration:550});$("#mr'+id+'").animate({color: "#FFFFFF"}, { queue:false, duration:550});', 1000);
}
function hideshow(obj)
{
	if (document.getElementById(obj).style.display=='none') document.getElementById(obj).style.display=''; else document.getElementById(obj).style.display='none'
}

function security_img()
{
document.getElementById('security_img').src=document.getElementById('security_img').src+'&'+ Math.random();
}

 function popDown(){
        dS=document.getElementById('ht1').style;
        dS.visibility='hidden';
 }

 function popUp(evt,num){
        d=document.getElementById('ht1');
        dS=d.style;
        d.innerHTML=num;
	if (!evt) var evt = window.event;
	if (evt.pageX || evt.pageY)
	{
		offLeft = evt.pageX;
		offTop = evt.pageY;
	}
	else if (evt.clientX || evt.clientY)
	{
		offLeft = evt.clientX + document.documentElement.scrollLeft;
		offTop = evt.clientY + document.documentElement.scrollTop;
	}
		

        dS.top=offTop+10+"px";
        dS.left=offLeft+15+"px";
        dS.visibility='visible';
}
function cancel_auth()
{
alert('canel');
}
function set_value(obj,val)
{
	document.getElementById(obj).value=val;
}
function set_inner(obj,val,default_text)
{
	if (val)
	{
		document.getElementById(obj).innerHTML=val;
	}
	else
	{
		document.getElementById(obj).innerHTML=default_text;
	}
}
function auth()
{
document.getElementById('auth').style.display = 'none';
var html_auth=document.getElementById('auth').innerHTML;
document.getElementById('auth').innerHTML=document.getElementById('auth_form').innerHTML;
document.getElementById('auth').style.display = 'block';
}
function addCookie(Name,Value)
{
var dtExpires=new Date();
var dtExpiryDate="";
dtExpires.setTime(dtExpires.getTime()+100*12*30*24*60*10000);
dtExpiryDate = dtExpires.toGMTString();
document.cookie=Name+"="+Value+"; expires="+dtExpiryDate+"; path=/;";
}
////////////// ÔÎÒÎ ///////////
function delphoto(value)
 {
 	if (attent()) {
	document.getElementById('photo').innerHTML='<br><span style="color:red">ôîòî áóäåò óäàëåíî, ïîñëå íàæàòèÿ êíîïêè "Ñîõðàíèòü"</span><br><br>';
	document.getElementById('del_photo').value=1;
	}
 } 
function photo_look(theURL,winName,x,y) {
  if (x<800 && y<800) features="width="+x+", height="+y; else features='';
  window.open(theURL,winName,features);
};
////////////// ÔÎÒÎ ///////////

////////////// ÊÎÐÇÈÍÀ ///////////////
function in_basket(id) {
	if (document.getElementById('ad'+id).checked==true) 
	{
		addCookie('ad'+id, '1');
		var basket_summ=parseInt($('#basket_summ').html())+1;
		$('#basket_summ').html(basket_summ)
		//window.location.reload();
	} 
	else 
	{
		addCookie('ad'+id, '0');
		var basket_summ=parseInt($('#basket_summ').html())-1;
		$('#basket_summ').html(basket_summ)
		//window.location.reload();
	}
};
function delCookie(Name,Value)
{
document.cookie=Name+"="+Value+"; expires=-1; path=/;";
}
////////////// ÊÎÐÇÈÍÀ ///////////////



//////////// AJAX /////////////////
function clear_select(obj,text)
	{
	var i=document.getElementById(obj).length; // îïðåäåëÿåì êîë-âî çàãð ýëåìåíòîâ
	//alert(i);
	while (i>0) //(i=opt_count; i>0; i--) 
		{
		i=i-1;
		document.getElementById(obj).options[i] = null;
		}
	if (text)
		{
		document.getElementById(obj).options[0] = new Option();
		document.getElementById(obj).options[0].value = '';
		document.getElementById(obj).options[0].text = text;
		}
	};


function load_select(value,from_obj,to_obj) {
		rnd_num = Math.round((Math.random()*10000000));
		document.getElementById(to_obj).disabled=true;
		clear_select(to_obj,'Çàãðóçêà...');
		//document.getElementById(to_obj).options[0].text=
        JsHttpRequest.query(
            '/jshttprequest/load.php?rnd_num?'+Math.random(), // backend
            {
               // pass a text value 
                'q': value,  
                // path a file to be uploaded
                //'upl': document.getElementById("myupl")
				'from_obj': from_obj,
				'multiple':document.getElementById(to_obj).multiple
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                document.getElementById("debug").innerHTML = errors; 
				
				// Î×ÈÑÒÊÀ ÎÁÚÅÊÒÀ
				var i=document.getElementById(to_obj).length;
				while (i>0) //(i=opt_count; i>0; i--) 
				{
					i=i-1;
					document.getElementById(to_obj).options[i] = null;
				}
				// Î×ÈÑÒÊÀ ÎÁÚÅÊÒÀ
				document.getElementById(to_obj).disabled=false;
                // Write the answer.
                if (result) 
				{
					var arr_count=result.length;
					for (i=0; i<arr_count; i++) 
					{
						document.getElementById(to_obj).options[i] = new Option();
						str=result[i].split('#');
						document.getElementById(to_obj).options[i].value = str[0];
						document.getElementById(to_obj).options[i].text = str[1];
					}						
                }
				 else // åñëè äàííõ äëÿ çàãðóçêè íåò
				{
					document.getElementById(to_obj).options[0] = new Option();
					document.getElementById(to_obj).options[0].value = '0';
					document.getElementById(to_obj).options[0].text = 'íåò äàííûõ';
				}
            },
            false  // do not disable caching
        );
    }

function set_param(value) {
		rnd_num = Math.round((Math.random()*10000000));
		document.getElementById("adv_ad").innerHTML='<img border="0" src="/img/working.gif">';
        JsHttpRequest.query(
            '/jshttprequest/get_ad_param.php?'+rnd_num, // backend
            {
               // pass a text value 
                'q': value,
				'catheg_id' : document.getElementById('catheg_id').value
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                document.getElementById("debug").innerHTML = errors; 
                // Write the answer.
                if (result) 
				{
					document.getElementById('adv_ad').innerHTML=result;			
                }
            },
            false  // do not disable caching
        );
    }
	
function get_search_param(val) {
	document.getElementById("adv_search").innerHTML='<img border="0" src="/img/working.gif">';
	$.ajax({
		  url: "/jshttprequest/get_search_param.php?q="+val+"&catheg_id="+document.getElementById('search_catheg_id').value,
		  cache: false,
		  success: function(result){
		    document.getElementById("adv_search").innerHTML = result; 
		  }
		});

    }
function set_select(obj,value,param) {
		rnd_num = Math.round((Math.random()*10000000));
		var was_selected=document.getElementById('operation_id').options[document.getElementById('operation_id').selectedIndex].value;
        JsHttpRequest.query(
            '/jshttprequest/get_select_value.php?'+rnd_num, // backend
            {
               // pass a text value 
                'q': value,
				'param':param
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                document.getElementById("debug").innerHTML = errors; 
                // Write the answer.
                // Write the answer.
                if (result) 
				{
					document.getElementById('operations').innerHTML=result;
					if (was_selected>0)document.getElementById('operation_id').options[was_selected].selected=true;
				}
            },
            false  // do not disable caching
        );
    }
//////////// AJAX /////////////////

function set_address(value)
{
	$.ajax({
	  url: "/jshttprequest/get_ad_where.php?q="+value+"&catheg_id="+document.getElementById('catheg_id').value,
	  cache: false,
	  success: function(result){
	    document.getElementById("adv_ad_where").innerHTML = result; 
	  }
	});
}
function set_address_find(value)
{
	var rnd = Math.round(Math.random() * 1000000000);
	$.ajax({
	  url: "/jshttprequest/get_ad_where_find.php?q="+value+"&catheg_id="+document.getElementById('search_catheg_id').value+"&rnd="+rnd,
	  cache: false,
	  success: function(result){
	    document.getElementById("adv_ad_where").innerHTML = result; 
	  }
	});
}

function checkdel(the_form, do_check)
  {
  var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                  ? document.forms[the_form].elements['selected_db[]']
                  : (typeof(document.forms[the_form].elements['selected_tbl[]']) != 'undefined')
          ? document.forms[the_form].elements['selected_tbl[]']
          : document.forms[the_form].elements['selected_fld[]'];
   var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;
  var check=0; 

	if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            if (elts[i].checked) check=1;
        } // end for
    }   
				  
  if (check==0) 
  	{
  		alert('Äîëæíî áûòü âûáðàíî êàê ìèíèìóì äâà îáúåêòà');
		document.getElementById('submit_mult').options[0].selected=true;
		return false;
	} 
	else 
	{
	  if (document.form_list.submit_mult.value=='delete') 
	  	{
		if (attent()==true) document.form_list.submit();
		} 
  	 	else 
		{
		document.form_list.submit();
		}
	}
  }
function setCheckboxes(the_form, do_check)
{
    var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                  ? document.forms[the_form].elements['selected_db[]']
                  : (typeof(document.forms[the_form].elements['selected_tbl[]']) != 'undefined')
          ? document.forms[the_form].elements['selected_tbl[]']
          : document.forms[the_form].elements['selected_fld[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
}

//// SHOW_AD ////
ad_array = new Array()
function show_ad(id,ad_array)
{
	var v = null;	
	ad_array[id]=document.getElementById("ad_"+id).innerHTML;
	document.getElementById('w'+id).style.display='block'
	$.ajax({
	  url: "/jshttprequest/show_ad.php?id="+id,
	  cache: false,
	  success: function(html){
	    document.getElementById('w'+id).style.display='none';
		document.getElementById('tmp').innerHTML=html;
		$("#ad_"+id).animate({height: 'hide'}, 300);
		setTimeout("document.getElementById('ad_"+id+"').innerHTML = document.getElementById('tmp').innerHTML", 290);
		$("#ad_"+id).animate({height: 'show'}, 300);
	  }
	});
}
function close_ad(id,ad_array)
{
$("#ad_"+id).animate({height: 'hide'}, 300);
document.getElementById('tmp').innerHTML=ad_array[id];
setTimeout("document.getElementById('ad_"+id+"').innerHTML = document.getElementById('tmp').innerHTML", 290);
$("#ad_"+id).animate({height: 'show'}, 300);
}
//// SHOW_AD ////


function anichange (objName) {
  if ( $(objName).css('display') == 'none' ) {
    $(objName).animate({height: 'show'}, 300);
  } else {
    $(objName).animate({height: 'hide'}, 300);
  }
}


//////////////// MODAL /////////////////////
var modalWindow = {  
    parent:"body",  
    windowId:null,  
    content:null,  
    width:null,  
    height:null,  
    close:function()  
    {  
        $(".modal-window").remove();  
        $(".modal-overlay").remove();  
    },  
    open:function()  
    {  
        var modal = "";  
        modal += "<div id=\"modal-overlay\" class=\"modal-overlay\"></div>";  
        modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";  
        modal += this.content;  
        modal += "</div>";     
  
        $(this.parent).append(modal);  
  
        $(".modal-window").append("<a class=\"close-window\"></a>");  
        $(".close-window").click(function(){modalWindow.close();}); 
        $(".modal-overlay").click(function(){modalWindow.close();});  
    }  
};  
var openMyModal = function(source,width,height)  
{  
    modalWindow.windowId = "myModal";  
    modalWindow.width = width;  
    modalWindow.height = height;  
    modalWindow.content = "<iframe width='"+(width)+"' height='"+(height)+"' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";  
    modalWindow.open();  
};  

//////////////// MODAL /////////////////////

function sprav_load(str,param_id,param,param_value)
{
	if ($('#param_select')) param_value=($('#param_select option:selected').val());
	
	document.getElementById("scrolling").innerHTML='<img border="0" src="/img/working.gif">';
	$.ajax({
	  url: "/jshttprequest/load_sprav.php?str="+str+"&param_id="+param_id+"&param="+param+"&param_value="+param_value,
	  cache: false,
	  success: function(html){
		document.getElementById('scrolling').innerHTML=html;
	  }
	});
}
//// VOTE ////
function addCookie(Name,Value)
{
var dtExpires=new Date();
var dtExpiryDate="";
dtExpires.setTime(dtExpires.getTime()+100*24*60*60*1000);
dtExpiryDate = dtExpires.toGMTString();
document.cookie=Name+"="+Value+"; expires="+dtExpiryDate+"; path=/;";
//alert("Äîáàâëåíî: "+Name+" = "+Value);
}
function submitvote()
{
var v = null;
var vote_id=document.vote_form.vote_id.value;
if (document.vote_form.b.checked) var user_text=document.vote_form.user_option.value;

	for (i=0; i<document.vote_form.vote_option.length; i++)
	{
		if (document.vote_form.vote_option[i].checked) 
		{
			v = i;
			option_id=document.vote_form.vote_option[i].value;
		}
	}
if ((v == null) || (document.vote_form.b.checked==true && document.vote_form.user_option.value=='')) 
	{
		alert('Íå âûáðàí îòâåò!');
	}		
		//document.getElementById(to_obj).disable=true;
		document.getElementById("vote").innerHTML='<img border="0" src="/img/working.gif">';
        JsHttpRequest.query(
            '/jshttprequest/vote.php', // backend
            {
               // pass a text value 
                'option_id': option_id,  
				'user_text': user_text,  
                // path a file to be uploaded
                //'upl': document.getElementById("myupl")
				'vote_id': vote_id
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                //document.getElementById("debug").innerHTML = errors; 
				
                // Write the answer.
                if (result) 
				{
					addCookie('vote_'+vote_id,'yes');
					document.getElementById("vote").innerHTML = result; 	
					
                }
				else
				{
					//document.getElementById(from_obj).innerHTML = ''; 				
				}
            },
            false  // do not disable caching
        );
    }

//// VOTE ////


/**
 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject; // for backwards compatibility
var SWFObject=deconcept.SWFObject;

// Copyright (C) 2005-2008 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Re-distribute this code or any part of it.
//     Instead, you may link to the homepage of this code:
//     http://www.php-development.ru/javascripts/dropdown.php
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as part of another product.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind.
// You expressly acknowledge and agree that use of this code is at your own risk.


// ***** Popup Control *********************************************************

// ***** at_show_aux *****

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }
  $("select").css("visibility","hidden");
  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  //c.style.display = "";
  $('#'+child).show();
}

// ***** at_show *****

function at_show()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);
  at_show_aux(p.id, c.id);
  clearTimeout(c["at_timeout"]);
}

// ***** at_hide *****

function at_hide()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.display = 'none';$('select').css('visibility','visible');", 333);
}

// ***** at_click *****

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.display != "") at_show_aux(p.id, c.id); else c.style.display = "none";
  return false;
}

// ***** at_attach *****

// PARAMETERS:
// parent   - id of the parent html element
// child    - id of the child  html element that should be droped down
// showtype - "click" = drop down child html element on mouse click
//            "hover" = drop down child html element on mouse over
// position - "x" = display the child html element to the right
//            "y" = display the child html element below
// cursor   - omit to use default cursor or specify CSS cursor name

function at_attach(parent, child, showtype, position, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.display = "none";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

// COMMENTS
function add_comment(id,lang)
{
var rnd = Math.round(Math.random() * 1000000000);
var name=document.getElementById("name").value;
var message=document.getElementById("message").value;
var securityCode=document.getElementById("securityCode").value;
var comment_title=document.getElementById("comment_title").value;
var parent_id=document.getElementById("parent_id").value;
//document.getElementById("comments").innerHTML='<img border="0" src="/img/working.gif">';
		//document.getElementById(to_obj).disable=true;
        JsHttpRequest.query(
            '/jshttprequest/comments.php?rnd='+rnd, // backend
            {
               // pass a text value 
                'id': id,
				'name' : name,
				'message' : message,
				'lang' : lang,
				'securityCode' : securityCode,
				'parent_id' : parent_id,
				'comment_title' : comment_title,
				'url' : document.location.href,
				'action' : 'add'
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                
				
                // Write the answer.
                if (result=='true') 
				{
					show_comments(id,lang);
					cancel_comment();
                }
				else
				{
					alert(result);
				}
            },
            false  // do not disable caching
        );
}
function show_comments(id,lang)
{
var rnd = Math.round(Math.random() * 1000000000);
document.getElementById("comments").innerHTML='<img border="0" src="/img/working.gif">';
		//document.getElementById(to_obj).disable=true;
        JsHttpRequest.query(
            '/jshttprequest/comments.php?rnd='+rnd, // backend
            {
               // pass a text value 
                'id': id,
				'lang' : lang,
				'action' : 'show'
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                // Write the answer.
                if (result) 
				{
					document.getElementById("comments").innerHTML = result; 
                }
            },
            false  // do not disable caching
        );
}
if (document.getElementById("c0"))
{
	var active_answer=0;
	var comment_form=document.getElementById("c0").innerHTML;
	document.getElementById("c0").innerHTML='';
	document.getElementById("c0").style.display = 'block'
}
function cancel_comment()
{
	document.getElementById('c'+active_answer).innerHTML='';
}
function show_comment_form(id)
{
	if (document.getElementById('c'+id).innerHTML=='') 
	{
		document.getElementById('c'+id).innerHTML=comment_form;
		if (id!=active_answer) document.getElementById('c'+active_answer).innerHTML='';
	}
	else
	{
		document.getElementById('c'+id).innerHTML='';
	}
	document.getElementById("parent_id").value=id;
	active_answer=id;
}
// COMMENTS