if(typeof(vrossii)=="undefined"){
  vrossii=function(){};
}
////////////////////////////////////////////////////////
// ������� ����div
///////////////////////////////////////////////////////

vrossii.bilddiv=function(div){
   this.idDiv=div;
   this.div_obj= new Object;
   this.check=false;

   this.create=function(){
    if (this.check){
	return true;
	}

	 var obj=document.getElementById(this.idDiv);
     if (!obj){
	  alert('not Found '+ this.idDiv);
	  return false;
	 }
	 this.div_obj=obj;
	 this.check=true;
   }

   //
   this.insertcode=function(txt){
  	 if (!this.check){
   	 	 this.create();
		 return false;
  	 }
   this.div_obj.innerHTML=txt //myorel.buffer;
   }

    this.doLoad = function(ar, obj, script){
	var req = new JsHttpRequest();
         // Code automatically called on load finishing.
          req.onreadystatechange = function(o) {
        if (req.readyState == 4) {
          if (req.responseJS.code==0) {

	  }
	  if (obj!=null)  obj.insertcode(req.responseJS.code);
	  if (req.responseText==''){
	    document.getElementById('debug').innerHTML = req.responseText;

		  }

        }
    }
    // Prepare request object (automatically choose GET or POST).
    req.open(null, script, true);
    // Send data to backend.
	req.send (ar);

    }
}


vrossii.mainpage = function(){}

vrossii.mainpage.vote=function(div, vote) {
    var o_vote =new vrossii.bilddiv(div);
    o_vote.create();
    o_vote.doLoad({'cmd':'vote', 'oid':vote}, o_vote, '/load_ajax.php')
}




