
function go_ax(cid,pid)
{
if(document.getElementById('ProductInfo')) {prod=1;}else{prod=0;}

ajax = new sack();
                ajax.requestFile = "http://fas.su/catAjax.php";
                ajax.setVar("cid",cid);
                ajax.setVar("pid",pid);
                ajax.onLoading = whenLoading;
		ajax.onLoaded = whenLoaded;
                ajax.onCompletion = function(){document.getElementById('ax_body').innerHTML=ajax.response; 

	if(pid!=0) {
		 window.scrollTo(0, offsetPosition(document.getElementById('ProductInfo')));
              }else{
		 window.scrollTo(0, offsetPosition(document.getElementById('ax_body')));
		}
if(prod==0 && pid!=0){
    }

// setTimeout(go_flash,100);
	}; 
                ajax.onError = function(){window.location.href='http://fas.su/error.php'}; 
                ajax.runAJAX();        

}


function whenLoading(){
            var e = document.getElementById('loading');
            e.innerHTML = "<div class='loading2' ></div><div class='loading3'>Загрузка...<img src='img/load.gif'/></div>";
        }
function whenLoaded(){
            var e = document.getElementById('loading');
              e.innerHTML = " ";

        }
function offsetPosition(element) {
	    var offsetLeft = 0, offsetTop = 0;
	    do {
	        offsetLeft += element.offsetLeft;
	        offsetTop  += element.offsetTop;
	    } while (element = element.offsetParent);
	    return  offsetTop;
	}
function go_flash() {
featuredcontentslider.init({
	id: "slider", 
	contentsource: ["inline", ""], 
	toc: "markup",  
	nextprev: ["", "Next"],  //labels for "prev" and "next" links. Set to "" to hide.
	revealtype: "mouseover", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
	enablefade: [true, 0.1],  //[true/false, fadedegree]
	autorotate: [true, 3000],  //[true/false, pausetime]
	onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
	}
});
	}

function ax()
{
	ajax = new sack();
                ajax.requestFile = "http://fas.su/send.php";

        var obj = document.getElementById('formsend');
        var obj2 = document.getElementById('divsend');

	if(obj.nodeName.toLowerCase()=='form'){
	  for (var i = 0; i < obj.length; i++) {
                var temp_el = obj[i];
               if(temp_el.type=='radio'){
                if(temp_el.checked){
	               ajax.setVar(temp_el.name,temp_el.title+" ");
	               }
		}else
               ajax.setVar(temp_el.name,temp_el.title+" "+temp_el.value);
          }
	}
                ajax.onCompletion = function(){obj2.innerHTML=ajax.response;}; 
                ajax.onError = function(){window.location.href='http://fas.su/error.php'}; 
                ajax.runAJAX();        

}

function ax_price()
{
	ajax = new sack();
                ajax.requestFile = "http://fas.su/price.php";

        var obj = document.getElementById('priceform');

	if(obj.nodeName.toLowerCase()=='form'){
	  for (var i = 0; i < obj.length; i++) {
                var temp_el = obj[i];

               if(temp_el.type=='radio'){
                if(temp_el.checked){
	               ajax.setVar(temp_el.name,temp_el.value);
	               }
		} 
		if(temp_el.type=='checkbox' && temp_el.checked){
	               ajax.setVar(temp_el.name,temp_el.value);
		}
	if(temp_el.name=='poluch') ajax.setVar(temp_el.name,temp_el.value); 	
          }
	}
                ajax.onCompletion = function(){eval(ajax.response)}; 
                ajax.onError = function(){window.location.href='http://fas.su/error.php'}; 
                ajax.runAJAX();        

}
function ax_pd4()
{
	ajax = new sack();
                ajax.requestFile = "http://fas.su/pd4.php";

        var obj = document.getElementById('priceform');

	if(obj.nodeName.toLowerCase()=='form'){
	  for (var i = 0; i < obj.length; i++) {
                var temp_el = obj[i];

               if(temp_el.type=='radio'){
                if(temp_el.checked){
	               ajax.setVar(temp_el.name,temp_el.value);
	               }
		} 
		if(temp_el.type=='checkbox' && temp_el.checked){
	               ajax.setVar(temp_el.name,temp_el.value);
		}
	if(temp_el.name=='poluch') ajax.setVar(temp_el.name,temp_el.value); 	
          }
	}
                ajax.onCompletion = function(){eval(ajax.response)}; 
                ajax.onError = function(){window.location.href='http://fas.su/error.php'}; 
                ajax.runAJAX();        

}


