var pop_0;
var pop_1;
var pop_2;
var pop_3;
var pop_4;
var pop_5;
var pop_6;

function $(obj){return document.getElementById(obj);}

function setHomepage()
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage('http://www.biznet.am/');
 
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
   {  
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
         }  
         catch(e)  
         {  
    alert("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
         }
    } 
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://www.biznet.am/');
 }
}


function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function create(a,c,b){
document.write(a+"@"+b+"."+c);
}

function c_check(){
 un = document.getElementById("un").value;
 ul = document.getElementById("ul").value;

 if(un && ul) document.form.submit();
}

function check_c_name_1(){
aa = document.getElementById("id_c_name").value;
	if(aa == 'Your web site name') document.getElementById("id_c_name").value = "";
	return 0;
}
function check_c_name_2(){
aa = document.getElementById("id_c_name").value;

if(!aa){
document.getElementById('ch_c_name').innerHTML='<img border="0" src="/pics/er.png" style="margin-top:3px;"  align="absmiddle" width="16" height="16">'; 
pop_0=0;
document.getElementById("id_c_name").value = "Your web site name";
}
else{

//$('ch_c_name').innerHTML='<img border="0" src="pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 

JsHttpRequest.query(
      '/ajax.php?x='+Math.random(), 
      {
     
       'cName':  aa
	},
		   function(result, errors) {
		if(errors){
		$('regForm').innerHTML=errors; 
		}
		if(result == 0){
		document.getElementById('ch_c_name').innerHTML='<img border="0" src="/pics/ok.png" align="absmiddle" width="16" height="16">'; //	$('regForm').innerHTML=result; 
			pop_0=1; all_check();
		}
		if(result == 1){
			document.getElementById('ch_c_name').innerHTML='<img border="0" src="/pics/er.png" align="absmiddle" width="16" height="16"> <span style="font-size:10px;">Այս Կայքը զբաղեցված է, մեկ այլ մարդու կողմից</span>'; //	$('regForm').innerHTML=result; 
		 pop_0=0;}
	   }

);

pop_0=1; all_check();
}


	return 0;
}



///////////search 

function check_c_name_11(){
aa = document.getElementById("c_name").value;
	if(aa == 'Your web site name') document.getElementById("c_name").value = "";
	return 0;
}
function check_c_name_22(){
aa = document.getElementById("c_name").value;

if(!aa){
document.getElementById("c_name").value = "Your web site name";
}
else{

//$('ch_c_name').innerHTML='<img border="0" src="/pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 

JsHttpRequest.query(
      'ajax.php?x='+Math.random(), 
      {
     
       'cName':  aa
	},
		   function(result, errors) {
		if(errors){
		//$('regForm').innerHTML=errors; 
		alert(errors);
		}
		if(result == 0){
		document.getElementById('search_text').innerHTML='<img border="0" src="/pics/ok.png" align="absmiddle" width="16" height="16"> Ուրախ ենք հայտնելու, որ Ձեր նախընտրած Վեբ կայքի անունը ազատ է: Եթե ցանկանում եք գրանցել այն, սեղմեք <a href="/վեբ-կայքի-գրանցում/"><font style="font-size:13px;">այստեղ</a>:<br /><br /><br /> <a href="/վեբ-կայքերի-պատրաստում/#s_1" style="margin-right:20px;">Ծանոթանալ Փաթեթներին</a> <a href="/վեբ-կայքերի-պատրաստում/#s_2" style="margin-right:20px;">Ինչ կարժենա այս կայքը?</a> <a href="/հետադարձ-կապ/" style="margin-right:20px;">Կապ Մեզ հետ</a>'; //	$('regForm').innerHTML=result; 
			}
		if(result == 1){
			document.getElementById('search_text').innerHTML='<img border="0" src="/pics/er.png" align="absmiddle" width="16" height="16"> Այս Կայքը զբաղեցված է, մեկ այլ կազմակերպության կողմից: Կայքը` <a href="http://'+aa+'.biznet.am" target="_blnak" style="font-size:14px;">'+aa+'.biznet.am</a>'; //	$('regForm').innerHTML=result; 
		   }
	   }

);


}


	return 0;
}


///////////end search



function next() {
m[0]+=1;
m[1]-=1;

document.getElementById("a1").style.opacity = m[1]/100;
document.getElementById("a1").style.filter="alpha(opacity="+m[0]+")";
document.getElementById("a2").style.opacity = m[0]/100;
document.getElementById("a2").style.filter="alpha(opacity="+m[1]+")";

t[0] = setTimeout("next()",5);
if (m[0]>98) clearTimeout(t[0]);
}


function f_1(){
document.getElementById("div6_1").style.display="block"; 
document.getElementById("div6_2").style.display="none";
document.getElementById("div6_3").style.display="none";
}
function f_2(){
document.getElementById("div6_1").style.display="none"; 
document.getElementById("div6_2").style.display="block";
document.getElementById("div6_3").style.display="none";
}
function f_3(){
document.getElementById("div6_1").style.display="none"; 
document.getElementById("div6_2").style.display="none";
document.getElementById("div6_3").style.display="block";
}






///log win

var ml = new Array(0,100);
var tl = new Array();

function show_log_win_1() {
ml[0]+=3;
ml[1]-=3;

document.getElementById("win").style.opacity = ml[1]/100;
document.getElementById("win").style.filter="alpha(opacity="+ml[0]+")";

tl[0] = setTimeout("show_log_win_1()",2);
if (ml[0]>98) clearTimeout(tl[0]);
}

function show_log_win() {

aMouseX = event.clientX;  
aMouseY = event.clientY;

MouseX = aMouseX + document.body.scrollLeft; 
MouseY = aMouseY + document.body.scrollTop; 

document.getElementById("win").style.top = MouseY + 10; 
document.getElementById("win").style.left = MouseX; 
document.getElementById("win").style.visibility="visible" ;

show_log_win_1();
}

function hide_log_win(a) { 
	obj = document.getElementById("win");
	if(a==1) setTimeout('obj.style.visibility="hidden"',1000); 
	if(a==2) {document.getElementById("win").style.visibility="hidden" ;
	
	 document.getElementById("win").style.opacity = 0;
     document.getElementById("win").style.filter="alpha(opacity=0)";
	 ml[0] = 0; ml[1] = 0; tl[0] = 0;
	}
} 

///end log win









//// reg start




function check_u_company(){
var u_company=$('id_u_company').value;

if(!u_company){
$('ch_u_company').innerHTML='<img border="0" src="/pics/er.png" style="margin-top:3px;"  align="absmiddle" width="16" height="16">'; 
pop_1=0;
}
else{
$('ch_u_company').innerHTML='<img border="0" src="/pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 
pop_1=1; all_check();
}

}


function check_u_name(){
var u_name=$('id_u_name').value;

if(!u_name){
$('ch_u_name').innerHTML='<img border="0" src="/pics/er.png" style="margin-top:3px;"  align="absmiddle" width="16" height="16">'; 
pop_2=0;
}
else{
$('ch_u_name').innerHTML='<img border="0" src="/pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 
pop_2=1; all_check();
}

}


function check_u_mail(){
var u_mail=$('id_u_mail').value;

var www = u_mail;
var xx=www.split('@');
var xxx=www.split('.');
var tt=xx.length;

if(!xx[1] || !xx[0] || !xxx[0] || !xxx[1]){
$('ch_u_mail').innerHTML='<img border="0" src="/pics/er.png" style="margin-top:3px;"  align="absmiddle" width="16" height="16">'; 
pop_3=0;
}
else{
$('ch_u_mail').innerHTML='<img border="0" src="/pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 
pop_3=1; all_check();
}

}


function check_u_tel(){
var u_tel=$('id_u_tel').value;

var www = u_tel;
var tt=www.length;

if(tt<6 || !u_tel){
$('ch_u_tel').innerHTML='<img border="0" src="/pics/er.png" style="margin-top:3px;"  align="absmiddle" width="16" height="16">'; 
pop_4=0;
}
else{
$('ch_u_tel').innerHTML='<img border="0" src="/pics/ok.png" style="margin-top:3px;" align="absmiddle" width="16" height="16">'; 
pop_4=1; all_check();
}

}

function check_u_num(){
var u_num=$('id_u_num').value;
if(u_num) {pop_5=1;  all_check();} else pop_5=0;

}

function checkLic(){

if($('u_lic').checked == true) {pop_6=1; all_check();} else {pop_6=0;}

}



function all_check(){

if(pop_0 == 1 && pop_1 == 1 && pop_2 == 1 && pop_3 == 1 && pop_4 == 1 && pop_5 == 1 && pop_6 == 1)  $('grancel').disabled = false;
  
  else  $('grancel').disabled = true;

}



function a_check(){

if(pop_0 == 1 && pop_1 == 1 && pop_2 == 1 && pop_3 == 1 && pop_4 == 1 && pop_5 == 1 && pop_6 == 1)
 {
 $('grancel').form.submit();
  }

}

//////////////reg end


///////log start

function log_check(){

if($('id_mail').value && $('id_pass').value)  $('mutq').form.submit();

}