﻿function  ShowPopUp(page, code, width, height){window.open(''+page+'','PopUp'+code+'','status=no,scrollbars=no,toolbar=no,menubar=no,location=no ,width='+width+',height='+height+'');}

var ie=document.all
var dom=document.getElementById
var ns4=document.layers

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("newpm").style : ie? document.all.newpm : document.newpm
scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
crossobj.top=scroll_top-250
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("newpm()",50)
}

function newpm(){
scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}



var browser = new Browser();


function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}



function image_loader(image){
        newdiv = document.createElement("div");
        newdiv.className = "i_am_hide";
        newdiv.id = escape(image);
        newdiv.innerHTML = '<img src="'+image+'">'
        document.body.appendChild(newdiv);
}



function get_value_for_ajax(this_id){
	if(! document.getElementById(this_id) ){
		return '';
	}else if(document.getElementById(this_id).type == 'checkbox'){
       return document.getElementById(this_id).checked;
	}else{
       return encodeURIComponent(replace_for_ajax(document.getElementById(this_id).value));
	}
}




function fit_to_win(id){
document.getElementById(id).style.top="0px";
document.getElementById(id).style.left="0px";
document.getElementById(id).style.width= document.body.clientWidth;
document.getElementById(id).style.height=document.body.clientHeight;
}



function change_title(title){
	document.title =title;
}


function change_status(title){
	window.status =title;
}


function my_go(url){
setTimeout('document.location.href="'+url+'"',100 )
}


function send_to_textarea(id,Which) {
  	if (document.getElementById(id).createTextRange) {
  		document.getElementById(id).focus();
  		document.selection.createRange().duplicate().text = Which;
   	} else {
  		document.getElementById(id).value += Which;
   	}
}



function write_in_id(id,note){
 if( document.getElementById(id) ){
  show_id(id);
 document.getElementById(id).innerHTML=note;
 }
}


function hide_id(id){
    if( document.getElementById(id) ){
	document.getElementById(id).style.display ='none';
	}
}


function show_id(id){
    if( document.getElementById(id) ){
    document.getElementById(id).style.display ='';
	}
}


function change_class(id,newclass){
      if( document.getElementById(id) ){
      document.getElementById(id).className =newclass;
	  }
}


function change_alpha(id,newalpha){
	if (browser.isIE) {
    document.getElementById(id).style.filter='alpha(opacity='+newalpha+')';
	}else{
		
	}
}


function change_src(id,newsrc){
document.getElementById(id).src=newsrc;
}


function get_value(id){
return document.getElementById(id).value;
}


function change_src_to(id , pic1 , pic2 ){
	 if(document.getElementById(id).src == pic1){
     document.getElementById(id).src=pic2;
	 }else{
     document.getElementById(id).src=pic1;
	 }
	 alert( document.getElementById(id).src)
}


function change_show(id){
	 if(document.getElementById(id).style.display == 'none'){
     document.getElementById(id).style.display='';
	 }else{
     document.getElementById(id).style.display='none';
	 }
}


function change_disable(id){
	 if(document.getElementById(id).disabled == 'on'){
     document.getElementById(id).disabled='';
	 }else{
     document.getElementById(id).disabled='on';
	 }
}


function change_sec_img(id,where){
main_ajax_do('post', where+'ajax_process/m_2.php' , 'part=mohsen'  ,'' , '' , 'no' , 'nopic','change_src(\''+id+'\', \''+where+'sec_img/codegen.php\')','1')
}


function new_sec_img(id,where){
main_ajax_do('post', where+'ajax_process/m_2.php' , 'new=are'  ,'' , '' , 'no' , 'nopic','change_src(\''+id+'\', \''+where+'sec_img/codegen.php\')','1')
}


function array_search(value, array) {
	var key;
	bb='no'
	for (key in array) {
		if (value === array[key]) {
			bb= key;
		}
		
	}
	return bb;
}


function getscript(str){
let_out=str;
str=str.split('#endofmyscript');
if( str[1] !=null){
doeval(str[0]);
let_out =let_out.replace(str[0]+'#endofmyscript', '');
}

return let_out;
}
//end base with hadi amin zadeh
//start open source javascript
var my_included_js = new Array();


function my_js_load( mt1  , mt2){
	if (array_search(mt1, my_included_js) == 'no'){
	my_included_js.push(mt1);
	newswhere=''+mt2+'p_java/js/'+mt1+'.php';
    main_ajax_do( 'post', newswhere , 'my_code=khodam'  ,'' , '' , 'js' , '' ,'' ,0 );
    }
	
}


function doeval(js){
	if(js!=null){
	var sc = document.createElement('script');
	jsCode = js;
	sc.type = 'text/javascript';
	document.getElementsByTagName('head')[0].appendChild(sc);
	sc.text = 'try{eval(jsCode);}catch(e){}jsCode="";';
	//sc.text = 'try{eval(jsCode);}catch(e){try{alert(e.fileName+" : "+e.lineNumber+"\\n"+e.name+" : "+e.message); alert(e.stack);}catch(e){}}jsCode="";';
	sc.text = "\/\/ :-)";
	}
}




function loading_effect(k){
	ht = document.getElementsByTagName("body");
	if(k==1){
    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";	
	ht[0].style.cursor = 'wait';
	}else{
    ht[0].style.filter = "";
	ht[0].style.cursor = 'auto';
	}
}



function replace_for_ajax(note){
	note= note.replace(/&/g,"**am**");
	note= note.replace(/=/g,"**mosavi**");
	note= note.replace(/\+/g,"**jam**");
	return note;
}


function main_ajax_do( met, url , post  ,idshow , idwait , state_mode , wait_pic ,java_function ,alpha){
 var xmlhttp=false;
 var my_respons='';
 var my_new_fun='';
 //this is note for change in states
var note_1='در حال ارسال اطلاعات ... '; var note_2='در حال بررسی شدن اطلاعات ...'; var note_3='در حال دریافت اطلاعات ...'; var note_4=''; var note_5='غیر قابل دسترسی ...'; 
 my_wait='<table border="0" width="100%" height="80%"><tr><td align="center" ><img src="'+wait_pic+'" border="0"></td></tr></table>';
 if(alpha==1 ){
 loading_effect('1');
 }
 //END
     if (window.navigator.onLine==false){
	 alert('. متاسفانه اشکالی در برقراری ارتباط با سایت وجود دارد');
	 return false;
	 }
     if (window.XMLHttpRequest){
       xmlhttp = new XMLHttpRequest();
       if (xmlhttp.overrideMimeType){
       xmlhttp.overrideMimeType("text/xml");
	   }
	 }
     else 
	 if (window.ActiveXObject){
	 try{
     xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 }
     catch (e){
	 try{
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	 }
     catch(e){
	 xmlhttp=false;
	 }
   }
  }
  if (!xmlhttp){
  alert("CONNECT FAILURE");
  return false;
  }
		if( met =='post' ){
		xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		post=post+'&MY_AJAX_TIME_SEND='+escape(new Date().getTime());
        xmlhttp.send(post);
		}else
		if( met == 'get' ){
		url=url+'&MY_AJAX_TIME_SEND='+escape(new Date().getTime());
	    xmlhttp.open('GET',url, true);
		xmlhttp.send(null);
		}
		if ( state_mode == 'text' ){
		write_in_id(idwait,note_1);
		}else if ( state_mode == 'pic' ){
		write_in_id(idwait,my_wait);
		}
    xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
		my_respons=xmlhttp.responseText;
	    my_respons = my_respons.replace('\n', '');
	    my_respons = my_respons.replace('\r', '');
	    my_respons = getscript(my_respons);
		}
	 if ( state_mode == 'return' && xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
	 eval(java_function+"'"+my_respons+"')");
	 }else if ( state_mode == 'newreturn'  && xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
	  my_new_fun = java_function.replace('#codehayeman#', my_respons);
	  doeval(my_new_fun);
	 }else if ( state_mode == 'js'  && xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
	 doeval(my_respons)
	 }else if ( state_mode == 'input'   && xmlhttp.readyState == 4  && xmlhttp.status == 200  ) {
	 document.getElementById(idshow).value=my_respons;
	 }else	if ( state_mode == 'text' ){
	   if(xmlhttp.readyState==1){
	   write_in_id(idwait,note_1);
	   }
	   if(xmlhttp.readyState==2){
	   write_in_id(idwait,note_2);
	   }
	   if(xmlhttp.readyState==3){
	   write_in_id(idwait,note_3);
	   }
       if (xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
	   write_in_id(idwait,note_4);
	   write_in_id(idshow,my_respons);
	   
	   }
	 }else if ( state_mode == 'pic' &&  xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
     write_in_id(idwait,'');
	 write_in_id(idshow,my_respons);
	 
	 }else if ( state_mode == 'no'   &&  xmlhttp.readyState == 4  && xmlhttp.status == 200 ) {
	 write_in_id(idshow,my_respons);
	 }else if ( xmlhttp.readyState == 4  &&  xmlhttp.status != 200 ) {
		 alert( '. متاسفانه اشکالی در برقراری ارتباط با سایت وجود دارد');
	 }
	 if ( xmlhttp.readyState == 4  &&  xmlhttp.status == 200 ){
	    if(alpha==1){
	    setTimeout("loading_effect('2')",100);
	    }
        if(java_function !=='no' && java_function !=='' &&  state_mode != 'js' && state_mode != 'return'  && state_mode != 'newreturn'  ){
	    setTimeout("eval("+java_function+")",100)
		}
	 }
     }
}




function change_ads(num,where, page, makan){
main_ajax_do('post', where+'index/'+page+'.php' , 'n='+num+'&part=mohsen'  ,makan , makan , 'pic' , 'images/wait.gif','no' ,'2')
setTimeout('change_ads("'+num+'","'+where+'","'+page+'","'+makan+'")', 60000)
}


function mouseX(evt) {
  if (evt.pageX){ 
  return evt.pageX;
  }else if (evt.clientX){
  return evt.clientX + (document.documentElement.scrollLeft);
  }else {
  return null;
  }
}


function mouseY(evt) {
  if (evt.pageY){
  return evt.pageY;
  }else if (evt.clientY){
  return evt.clientY + (document.documentElement.scrollTop);
  }else { 
  return null;
  }
}
//start hadi amin zadeh function


var DivY= 500;
var DivY0 = DivY/6;
var PoseActive=0;
var DoDown=0;
var DownTime;



function my_div_mover( my_y , go_down , down_time , move_down  , ajax_url , ajax_parametr, ajax_div , ajax_time ,write_note ,write_div){

go_up_id='my_div_to_move';
newleft=document.body.clientWidth/2 - parseInt(document.getElementById(go_up_id).style.width)/2;
document.getElementById(go_up_id).style.top = "0px";//Py;
document.getElementById(go_up_id).style.left = newleft+"px";

	DivY = document.body.clientHeight;	//Start position of Div
    DivY0 = DivY/my_y;						//end position
	PoseActive = move_down;						//move width scroll
	DoDown = go_down;							//Down after
	DownTime = down_time;					//Down time 
	Pos();
	DivUp();
	document.getElementById(go_up_id).style.display="";
	if(ajax_url !==''){
		  if (  ajax_time ==''){
		  ajax_time=100;
		  }
	setTimeout('main_ajax_do("post", "'+ajax_url+'" , "'+ajax_parametr+'"  ,"'+ajax_div+'" , "'+ajax_div+'"  , "text" , "" ,"no" ,"1")', ajax_time);
    }
	if(write_note !==''){
		write_in_id( write_div , write_note)
	}
}


function my_div_mover_only( my_y , go_down , down_time , move_down  , thid ){
	go_up_id=thid;
newleft=document.body.clientWidth/2 - parseInt(document.getElementById(go_up_id).style.width)/2;
document.getElementById(go_up_id).style.top = "0px";//Py;
document.getElementById(go_up_id).style.left = newleft+"px";

	DivY = document.body.clientHeight;	//Start position of Div
    DivY0 = DivY/my_y;						//end position
	PoseActive = move_down;						//move width scroll
	DoDown = go_down;							//Down after
	DownTime = down_time;					//Down time 
	Pos();
	DivUp();
	document.getElementById(go_up_id).style.display="";
}



function Pos()
{
	if (window.innerHeight)
	{
		  pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		  pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop
	}
	if (PoseActive)
	{
		document.getElementById(go_up_id).style.top = DivY + pos+"px";
		temp = setTimeout('Pos()',300);
	}
}



function DivUp()
{
	if (Math.abs(DivY- DivY0)>.1){
		DivY = (DivY0 - DivY) * .2  + DivY;
		document.getElementById(go_up_id).style.top = DivY + pos+"px";
		setTimeout("DivUp()", 50);
	}
	else
	{
		if(DoDown) setTimeout("DivDown()", DownTime);	
		else PoseActive = 0;
	}
}


function DivDown()
{
	if ((document.body.clientHeight - DivY)>0){
		DivY = (DivY - DivY0) * .2  + DivY;
		document.getElementById(go_up_id).style.top = DivY + pos+"px";
		setTimeout("DivDown()", 50);
	}
	else
	{
		document.getElementById(go_up_id).style.display="none";
		PoseActive = 0;
	}

}

// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 0;



function dragStart(event,id) {

  var el;
  var x, y;

  
  // If an element id was given, find it. Otherwise use the element being
  // clicked on.

  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    // If this is a text node, use its parent element.

    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }


  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

  // Update element's z-index.

  dragObj.elNode.style.zIndex = ++dragObj.zIndex;

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}



function dragGo(event) {

  var x, y;

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Move drag element by the same amount the cursor has moved.

  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}



function dragStop(event) {

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }

}


_uacct = "UA-256190-3";
if ( window.urchinTracker ) {urchinTracker();}
function MDF01( m01 ,  m02 , m03 ) {
	for(i=1;i<6;i++)   { 
	change_class('tab_'+m01+'_'+i ,'n_4');
	}
	change_class('tab_'+m01+'_'+m02 ,'n_5');
	main_ajax_do('post', 'index/'+m01+'_'+m02+'.php' , ''  ,'tab_'+m01+'_0' , 'tab_'+m01+'_0' , 'pic' , 'images/wait.gif' ,'no' ,'1')
}

function MDF02(m01 ,  m02,  m03){
	show_id('my_div_to_move');
	if( m01 == 2 || m01 == 3 ){
		document.getElementById('my_div_to_move').style.width="400px";
	} 

	if( m01 != 3 && m01 != 2 ){
		document.getElementById('my_div_to_move').style.width="300px";
	}
	my_div_mover(6 , 0 , 0 , 0 ,'', '' , '' , '', '','');
	write_in_id('ajax_windows_title' , m02 );
	main_ajax_do('post', 'index/win_'+m01+'.php?'+m03+'' , ''  ,'ajax_windows_note' , 'ajax_windows_note' , 'pic' , 'images/wait.gif' ,'no' ,'1')
}

function MDF03(m01 ,  m02,  m03,  m04){
	main_ajax_do('post', 'index/'+m01+'' , ''  ,m02 , m02 , 'pic' , 'images/wait.gif' ,'no' ,'1')
	write_in_id(m03, m04)
}

function Templates(m01,  m02 , m03){
	show_id('my_div_to_move');
	my_div_mover(6 , 0 , 0 , 0 ,'', '' , '' , '', '','');
	write_in_id('ajax_windows_title' , m02 );
	main_ajax_do('post', 'show_temps.php?'+m03+'' , ''  ,'ajax_windows_note' , 'ajax_windows_note' , 'pic' , '../images/wait.gif' ,'no' ,'1')
}


function MDF04(tempid, picurl){
	main_ajax_do('post', 'show_temppics.php?id='+tempid+'&picurl='+picurl+'' , ''  ,'ajax_windows_note' , 'ajax_windows_note' , 'pic' , '../images/wait.gif' ,'no' ,'1')
}

function MDF05(xx){
	main_ajax_do('post', 'show_temps.php?id='+xx+'' , ''  ,'ajax_windows_note' , 'ajax_windows_note' , 'pic' , '../images/wait.gif' ,'no' ,'1')
}

function setnewpassword() {
	document.getElementById('password').style.width="400px";
	show_id('password');
	my_div_mover_only(4 , 0 , 0 , 0 ,'password');
	write_in_id('password_title','مشخصات كاربري');
}


function my_main_menu(thisid,thisurl,thisparametr){
main_ajax_do('post', thisurl , thisparametr  ,'this_is_main_div' , 'this_is_main_div' , 'pic' , 'images/wait.gif','no' ,'1')
	  change_class('menu_0' ,'');
	  change_class('menu_1' ,'');
	  change_class('menu_2' ,'');
	  change_class('menu_3' ,'');
	  change_class('menu_4' ,'');
	  change_class('menu_5' ,'');
	  change_class('menu_6' ,'');
	  setTimeout('change_class("'+thisid+'","my_0");',100)
}

function my_delete(id , note){
	show_id('delete_error');
	my_div_mover_only(3 , 0 , 0 , 0 ,'delete_error');
	write_in_id('delete_note',note);
	write_in_id('delete_yes','<a href="?Delete='+id+'"><img src="images/b_6.gif" border="0"></a>');
}

function do_support() {
 this1=document.getElementById('sup_1').value;
 this2=document.getElementById('sup_2').value;
 this3=document.getElementById('sup_3').value;
 this4=document.getElementById('sup_4').value;
 hide_id('my_form');
 main_ajax_do('post', 'index/php_panel_4.php' , 'sup_1='+encodeURIComponent(replace_for_ajax(this1))+'&sup_2='+encodeURIComponent(replace_for_ajax(this2))+'&sup_3='+encodeURIComponent(replace_for_ajax(this3))+'&sup_4='+encodeURIComponent(replace_for_ajax(this4))+''  ,'my_error' , 'my_error' , 'pic' , 'images/wait.gif' ,'no','1')
}



function change_my_tab(id , parametr){
   for(i=0;i<6;i++)   { change_class('my_tab_'+i+'' ,'');}
   change_class('my_tab_'+id+'' ,'my_tab_2x');
   switch (id) {
   case("1"):
   url_ajax='1';
   break;
   case("2"):
   url_ajax='2';
   break;
   case("3"):
   url_ajax='3';
   break;
   case("4"):
   url_ajax='4';
   break;
   case("5"):
   url_ajax='5';
   break;
   }
	   main_ajax_do('post', 'index/profile_'+url_ajax+'.php' , ''+parametr+''  ,'my_message' , 'my_message' , 'pic' , 'images/wait.gif' ,'no' ,'1')
}

function doo_support() {
	main_ajax_do('post', 'index/php_support.php' , 'p1='+encodeURIComponent(replace_for_ajax(document.getElementById('p1').value))+'&p2='+encodeURIComponent(replace_for_ajax(document.getElementById('p2').value))+'&p3='+encodeURIComponent(replace_for_ajax(document.getElementById('p3').value))+'&p4='+encodeURIComponent(replace_for_ajax(document.getElementById('p4').value))+''  ,'my_error' , 'my_error' , 'pic' , 'images/wait.gif' ,'no' ,'1');
	hide_id('my_form')
}

function add_expire() {
 websites_expire=document.getElementById('websites_expire').value;
 websites_expire=websites_expire - (-366*24*60*60);
 document.getElementById('websites_expire').value=websites_expire;
}

function remove_messege(id){
 this1=document.getElementById('show').value;
 hide_id('newpm')
 main_ajax_do('post', 'index/php_remove_messege.php' , 'show='+encodeURIComponent(replace_for_ajax(this1))+'&id='+encodeURIComponent(id)+''  ,'newpmtext' , 'newpmtext' , 'pic' , 'images/wait.gif' ,'no','1');
}

function show_rate_on( id , rate){
	for( i = 1; i <= rate; i++) {
		document.getElementById('my_rate_'+id+'_'+i+'').src = "../images/rate_2_on.gif";
	}
}

function show_rate_off( id , rate){
	for( i = 1; i <= rate; i++) {
		document.getElementById('my_rate_'+id+'_'+i+'').src ="../images/rate_2_off.gif";
	}
}

function rate_send( id , rate ){
	main_ajax_do('post', '../index/news_rate.php' , 'p1='+id+'&p2='+rate+''  ,'rate_'+id+'' , 'rate_'+id+'' , 'text' , '','no' ,'1');
}

function noerror(){return true}
window.onerror=noerror;
