$(document).ready(function() {  

                            $('.cashanime').css('margin-left', '0px');
                            $('.cashanime').css('float', 'left');			
			    $('.cashanime').parent('td').css('width', '1100px');
			    $('.cashanime').parent('td').next('td').css('width', '250px');
			    $('<div class="ourphone" style="width:200px;color:#0000FF; font: 20px Arial;font-weight:bold;padding-left:20px;padding-top:40px;float:left;">тел. (096) 818-87-63</div>').insertAfter('.cashanime');


    $('.hrefFastSearch').live('click', function () {
        if ($(this).attr('href') != '#')
        {
            document.location.href = $(this).attr('href');
        }
        else
        {
            alert('Вы выбрали недавно добавленное слово. Информация по этому ключевому слову будет доступна только завтра!');
        }
    })
    //select all the a tag with name equal to modal
    $('img[name=modal]').click(function() {
		$('#goToRequest').click();
	/*
//  e.preventDefault;
    $("#mydiv").load("/tender/tender.template.php", {'data': $(this).attr('id')}, function(){
        window.scroll(0,0);
        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
    
        //Set heigth and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});
        
        //transition effect     
        $('#mask').fadeIn(1000);    
    
        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();
              
        //Set the popup window to center
        $('#dialog').css('top',  winH/2-$('#dialog').height()/2);
        $('#dialog').css('left', winW/2-$('#dialog').width()/2);
    
        //transition effect
        $('#dialog').fadeIn(2000); 
    //if close button is clicked
    $('.window .close').click(function () {
        //Cancel the link behavior
        $('#mask, .window').hide();
        $('#requirements').val('нет');
        $('#fio').val('');
        $('#tel').val('');
        $('#email').val('');
        $('#max_price').val('0');
    });     
    
    //if mask is clicked
    $('#mask').click(function () {
        $(this).hide();
        $('.window').hide();
        $('#requirements').val('нет');
        $('#fio').val('');
        $('#tel').val('');
        $('#email').val('');    
        $('#max_price').val('0');
    });         

    $('#sendtender').click(function () {        
       var tovar = $('#tovar').val();
       var misto = $('#misto').val();
       var quantity = $('#tovar_quantity').val();
       var delivery = $('#delivery').val();
       var max_price = $('#max_price').val();
       var requirements = $('#requirements').val();
       var fio = $('#fio').val();
       var tel = $('#tel').val();
       var s_vr = $('#s').val();
       var do_vr = $('#do').val();
       var email = $('#email').val();
       var word = $('#word').val();
       var captcha = $('#captcha').val();
       var check = 1;
       var error = '';
       if (tovar.length < 3)
          {
             check = 0;
          }
       if (misto.length <= 3)
          {  
             check = 0;
          }
       if (fio.length < 3)
          {
             check = 0;
          }
       if (tel.length < 3)
          {
             check = 0;
          }
       if (email.length < 3)
          {
             check = 0;
          }
        if (check == 1)
         {
            $.ajax({type: 'POST',
                    url: '/tender/send_mail.php',
                    data: "tovar="+tovar+"&misto="+misto+"&quantity="+quantity+"&delivery="+delivery+"&max_price="+max_price+
			  "&requirements="+requirements+"&fio="+fio+"&tel="+tel+"&s_vr="+s_vr+"&do_vr="+do_vr+"&email="+email+
			  "&word="+word+"&captcha="+captcha,
		    success: function (html)
				{
				    var array = html.split(' ^^^^^ ');
				    if (array[0] == 'OK')
				    {
					alert(array[1]);
		                        $('#mask').hide();
		                        $('.window').hide();
  				    }
				    else
				    {
					alert(array[1]);
				    }
				}
                    });  
         }
         else 
         {
             alert('Внимательно проверьте заполняемые поля!');
         } 
     });
    
     });*/
     });
});


function InsertMailToTag( userName, domainName)
{
var EmailId;
var atSign = "&#64;"
var fullStop = "&#46";

var userName = 'wwwpricelist';
var domainName = 'gmail.com';

EmailId = userName;
EmailId = "" + EmailId + atSign; 
EmailId = EmailId + domainName;

document.write( "<a href='mail" + "to:" + EmailId + "'>" + EmailId
+"</a>" );
}








