var changelangv=false;
function validate(emailStr){if(emailStr!=''){var emailPat=/^(.+)@(.+)\.(.+)$/;var matchArray=emailStr.match(emailPat);if(matchArray==null){alert('Wrong e-mail');return false;}
return true;}else{alert('?-mail is not inputed');return false;}}
function select_promo(num){document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#E6F7FC';}
function unselect_promo(num){document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#FFFFFF';}
function change_type(){if(!document.getElementById('bus_type').checked){document.getElementById('company').disabled=true;document.getElementById('position').disabled=true;document.getElementById('company').style.backgroundColor="#F7F6F9";document.getElementById('position').style.backgroundColor="#F7F6F9";}else{document.getElementById('company').disabled=false;document.getElementById('position').disabled=false;document.getElementById('company').style.backgroundColor="#FFFFFF";document.getElementById('position').style.backgroundColor="#FFFFFF";}}
function subscribe(){var email=document.getElementById('submail').value;if(email!='Enter your e-mail'&&email!=''&&validate(email)){ajax_get_data('/getdata.php?operation=subscribe&email='+email,'');document.getElementById('subscribebox').innerHTML='Your email saved';}}
function cargo_subscribe(){var email=document.getElementById('submail').value;if(email!='Enter your e-mail'&&email!=''&&validate(email)){ajax_get_data('/getdata.php?operation=cargo_subscribe&email='+email,'');document.getElementById('subscribebox').innerHTML='<p align="center" class="title_text">Your email subscribed.</p>';}}
function SetCookie(name,value){var argv=SetCookie.arguments;var argc=SetCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=name+"="+escape(value)+
((expires==null)?"":("; expires="+
expires.toGMTString()))+
((path==null)?"":("; path=/"+path))+
((domain==null)?"":("; domain="+domain))+
((secure==true)?"; secure":"");}
function changelang(){if(changelangv){if(document.getElementById('lang').value==''){SetCookie("language",'',null,'');location.href='/index.php?id=1';}else{SetCookie("language",document.getElementById('lang').value,null,'');location.href='/index.php?id='+document.getElementById('lang').value;}}
else changelangv=true;}
var timeID=null;var timer=false;function show()
{if(timer)clearTimeout(timeID);setTimeout("document.getElementById('attention').src='/img/excl1.PNG'",800);setTimeout("document.getElementById('attention').src='/img/excl.png'",1600);timeID=setTimeout("show()",2000);timer=true;}
function print(){window.open('/print.php','MAU','width=753,height=512');}
function pos_i(evnt,field,num){var x;var y;var txt;var obj=document.getElementById(field+"");document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#E6F7FC';if(navigator.appName=="Microsoft Internet Explorer"){x=evnt.clientX+document.body.scrollLeft;y=evnt.clientY+document.body.scrollTop;}else{x=evnt.pageX;y=evnt.pageY;}
txt=document.getElementById(field+"").innerHTML;if(txt){obj.style.left=(x+12)+"px";obj.style.top=(y+12)+"px";obj.style.display="block";}
return true;}
function hide_i(field,num){var obj=document.getElementById(field+"");document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#FFFFFF';obj.style.display="none";return true;}
function pos_i(evnt,field,num){var x;var y;var txt;var obj=document.getElementById(field+"");document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#E6F7FC';if(navigator.appName=="Microsoft Internet Explorer"){x=evnt.clientX+document.body.scrollLeft;y=evnt.clientY+document.body.scrollTop;}else{x=evnt.pageX;y=evnt.pageY;}
txt=document.getElementById(field+"").innerHTML;if(txt){obj.style.left=(x+12)+"px";obj.style.top=(y+12)+"px";obj.style.display="block";}
return true;}
function hide_i(field,num){var obj=document.getElementById(field+"");document.getElementById('hl'+num+'1').style.backgroundColor=document.getElementById('hl'+num+'2').style.backgroundColor=document.getElementById('hl'+num+'3').style.backgroundColor='#FFFFFF';obj.style.display="none";return true;}
/*
$(document).ready(function(){
    $(".fare").mouseover(function(){
$(".fc[rel="+this.id+"]").show();
        //$(this).after("<div rel='"+this.id+"' class='fc'>Please wait...</div>");
        //$(".fc").css("position","absolute").css("z-index","20").css("padding","5");        
        var ver=$(this).attr("rel");
        $(".fc[rel="+this.id+"]").load("/getdata.php?operation=conditions&id="+this.id+"&lang="+ver).show();
        
    });
    $(".fare").mouseout(function(){
        $(".fc").fadeOut("slow");
    });
});
*/
