function send_mail_contact(type) {
	if (type == 'gmail') {
		yuname = document.frmGmail.GName.value;
		ypass =  document.frmGmail.YPass2.value;
		main_ajax_do('/yahoo/contacts.php?type=' + type,'carea','yuname=' + yuname + '&ypass=' + ypass);
	}
	
	if (type == 'yahoo') {
		yuname = document.frmYahoo.YName.value;
		ypass =  document.frmYahoo.YPass.value;
		main_ajax_do('/yahoo/contacts.php?type=' + type,'carea','yuname=' + yuname + '&ypass=' + ypass);
	}
}

function main_ajax_do(url , thisid, post){
	var xmlhttp=false;
 	var my_respons = '';
		url = url + '.php';
        show_id(thisid);
        show_id('wait');        
        show_id('prog');        
        l=0;

		h=document.getElementById(thisid).offsetHeight;
		t= findPosY(document.getElementById(thisid));
//		if (h <= 150) { h =150; }
		w=document.getElementById(thisid).offsetWidth;
		l= findPosX(document.getElementById(thisid));

		document.getElementById('wait').style.height=h+'px';
		document.getElementById('wait').style.top=t+'px';
		document.getElementById('wait').style.width=w + 1 +'px';
		document.getElementById('wait').style.right = (document.body.clientWidth - l - w) +'px';
		
		rig = ( (document.body.clientWidth - l - (w/2)));//+ (document.getElementById('wait').style.width/2)) - 25);
		
		document.getElementById('prog').style.right = rig+'px';
		document.getElementById('prog').style.top=(t+(h/2) - (document.getElementById('prog').offsetHeight/2))+'px';


    if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
		        hide_id('wait');        
		        hide_id('prog');        
             }
        }
}

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 write_in_id(id,note){
 	if(document.getElementById(id)){
  		show_id(id);
 		document.getElementById(id).innerHTML=note;
	}
}

function findPosX(obj){
var curleft = 0;

if (obj.offsetParent){

while(1){
curleft+=obj.offsetLeft;
if (!obj.offsetParent){break}
 obj=obj.offsetParent;
}

}else if(obj.x){curleft+=obj.x}
return curleft;
}

function findPosY(obj){
var curtop = 0;

if (obj.offsetParent){

while(1){
curtop+=obj.offsetTop;
if (!obj.offsetParent){break}
 obj=obj.offsetParent;
        }

}else if(obj.y){curtop+=obj.y}
return curtop;
}


function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
 
         return true;
      }


function main_ajax_do1(url , thisid, post){
	var xmlhttp=false;
 	var my_respons = '';
	url = url + '.php';


if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
             }
        }
}


function main_ajax_do2(url , thisid, post){
 	var xmlhttp=false;
 	var my_respons = '';
	write_in_id(thisid ,'<img src="/images/loading2.gif" border="0">') ;        
    if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
             }
        }
}


function main_ajax_do3(url , thisid, post){
 	var xmlhttp=false;
 	var my_respons = '';
	write_in_id(thisid ,'<img src="../images/loading2.gif" border="0">') ;        
    if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
             }
        }
}

function ShowPopup(url , thisid, post,ID){
	
 	var xmlhttp=false;
 	var my_respons = '';

    show_id(thisid);
l=0;
h=document.getElementById(ID).offsetHeight;

t= findPosY(document.getElementById(ID));

document.getElementById('popup').style.top=t; 

l= findPosX(document.getElementById(ID));


document.getElementById('popup').style.right = document.body.clientWidth - l;


if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
             }
        }
}

function main_ajax_do4(url , thisid, post){
 	var xmlhttp=false;
 	var my_respons = '';
	
	
//	h=document.getElementById(thisid).offsetHeight;
//t= findPosY(document.getElementById(thisid));
//if (h <= 150) { h =150; }
//w=document.getElementById(thisid).offsetWidth;
//l= findPosX(document.getElementById(thisid));
//document.getElementById('wait').style.height=h;
//document.getElementById('wait').style.top=t;
//document.getElementById('wait').style.width=w;
//document.getElementById('wait').style.right = document.body.clientWidth - l - w;

//document.getElementById('prog').style.right = (document.body.clientWidth)/2;
//document.getElementById('prog').style.top=t+(h/2) - (document.getElementById('prog').offsetHeight/2);

var df=document.getElementById("ajax-feedback");

df.style.position = 'absolute' ;

df.style.left =document.body.offsetWidth/2 + document.body.scrollLeft -150;

df.style.top = document.body.offsetHeight/2 + document.body.scrollTop -50;	

//document.getElementById('ajax-feedback').style.top = document.body.clientHeight - 100;
//	document.getElementById('ajax-feedback').style.right = 100;
	show_id('ajax-feedback');	
	
    if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				show_id(thisid);
				document.getElementById(thisid).innerHTML =my_respons;
				hide_id('ajax-feedback');
             }
        }
}


function main_ajax_do_basket(url , thisid, post){
	var xmlhttp=false;
 	var my_respons = '';

        show_id(thisid);
        show_id('wait');        
        show_id('prog');        
        l=0;

		h=document.getElementById(thisid).offsetHeight;
		t= findPosY(document.getElementById(thisid));
		if (h <= 150) { h =150; }
		w=document.getElementById(thisid).offsetWidth;
		l= findPosX(document.getElementById(thisid));

		document.getElementById('wait').style.height=h+'px';
		document.getElementById('wait').style.top=t+'px';
		document.getElementById('wait').style.width=w + 1 +'px';
		document.getElementById('wait').style.right = (document.body.clientWidth - l - w + 15) +'px';

		document.getElementById('prog').style.right = ((document.body.clientWidth)/2)+'px';
		document.getElementById('prog').style.top=(t+(h/2) - (document.getElementById('prog').offsetHeight/2))+'px';


    if(!xmlhttp) { 
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlhttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
	 }
    }
    if(!xmlhttp) { xmlhttp=new XMLHttpRequest();}
     	xmlhttp.open('POST', url, true);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); post=post+'&my_time='+escape(new Date().getTime());
        xmlhttp.send(post); 
        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', '');
				document.getElementById(thisid).innerHTML =my_respons;
		        hide_id('wait');        
		        hide_id('prog');   
				main_ajax_do1('getaccount.php','getaccount','')				
             }
        }
}
