
	function changefavorite(file){
		document.getElementById('mainimage').src=file;
		//document.getElementById('mainimage').style.height='322px';
	}
	function restore_main(){ 
		document.getElementById('mainimage').src=document.getElementById('mainimage').getAttribute('original');
	}
    
      function raspunsform(string){
        string=unescape(string);
        temp=string.split('|');
        ge('submitul').disabled=false;
        if(temp[0]=='0'){
                alert(temp[1]);
                 reload_captch()
        }else{
                window.location.href='email_sended.html';
        }
    }
    function ge(id){
        return document.getElementById(id);
    }
    
    function rip_fields(formid)
    {
    var theform=ge(formid);
    var args=new Array();
    for(i=0; i<theform.length; i++)
        {
            if(theform.elements[i].type!="file")
            {
                if((theform.elements[i].type=="radio" && theform.elements[i].checked) || (theform.elements[i].type=="checkbox" && theform.elements[i].checked) || (theform.elements[i].type!="radio" && theform.elements[i].type!="checkbox"))
                args.push(theform.elements[i].name+"="+theform.elements[i].value);
            }
        }
        
        return args.join("&");
    }
    
    function ajaxSubmit(file,func,formid){
        var xmlhttp;
        /*@cc_on @*/
        /*@if (@_jscript_version >= 5)
          try {
          xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
         } catch (e) {
          try {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
          } catch (E) {
           xmlhttp=false
          }
         }
        @else
         xmlhttp=false
        @end @*/
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
            try {
                    xmlhttp = new XMLHttpRequest();
                } catch (e) {
                    xmlhttp=false
                }
        }
        
        var qs=rip_fields(formid);
        
        xmlhttp.open("POST", file,true);
           xmlhttp.setRequestHeader("Content-Type",
                "application/x-www-form-urlencoded");
     
        xmlhttp.onreadystatechange=function() {
            if (xmlhttp.readyState==4) {
            xxx=escape(xmlhttp.responseText);
            setTimeout(func+"('"+xxx+"')",1);
        }
     }
      xmlhttp.send(qs)
    }
    