var wH = new Array();
wHcc=0; 

function freed_back(){
var val= new Array;
val[0]=document.freed_form.user_name;
// val[1]=document.contact.login;
val[1]=document.freed_form.email;
val[2]=document.freed_form.subject;
val[3]=document.freed_form.additional;
val[4]=document.freed_form.captcha;


for(i=0;i<val.length;i++){

		if( ( val[i].type=='text' || val[i].name=="additional") && val[i].value==""){
		//	val[i].style.backgroundColor=r;
			val[i].focus();
			return;
		}
		
		else if(val[i].options && val[i].selectedIndex==0){
		
			val[i].focus();
			return;
			
		}
		
		
	
}
// alert(document.freed_form.name);
document.freed_form.submit();

}

function open_window(url,multi,size){

	if(multi) {
	// a.parentNode.parentNode.removeChild(a.parentNode);
	wH[wHcc]= window.open(url,"window"+wHcc,'width=509,height=398,resizable=no'); 
	// wH[wHcc].onclose=function(){ alert('x');};
	wHcc++;
	get_chats();
	
	// alert('1');
	}
	else nmw= window.open(url,"window1",'width=508,height=398'); 
	
}

function body_onUnload()
{
   //alert('close');
   if (window.event.clientX < 0)
   {
      //alert("The browser is closing...");
   }
   else
   {
      //alert("The user is refreshing or navigating away...");
   }
}


function set_bg_color(t,col){

 t.style.backgroundColor=col;
 
}


function send_request_443(){
//url= domains+"ajax_ping.php";
url= "ajax_ping.php";

	xmlReq=get_req();
xmlReq.onreadystatechange = function()
{
   if(xmlReq.readyState == 4)
   {
		alert(url+"\n"+xmlReq.responseText);
   }
}

xmlReq.open ('GET',url, true);
xmlReq.send (null);

}




function index2_hh(n){

	for(i=1;i<5;i++){
	
		d = document.getElementById("index2_"+i);
		im = document.getElementById("p_img_"+i);
		nn=(n==i?1:0);
		d.className="index2_fon"+nn;
		im.src="v2/p"+i+(n==i?"s":"")+".png";
		// alert(d.className);	
		
		
	}

}





