function openvvideo(url,id,width,height,preview){
//alert('w='+width+' h='+height);
var h=height;
window.open("/player/index.php?path="+url+"&preview="+preview,id,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+width+",height="+420);}

function openPhoto2(url,id,width,height)
{
	window.open("/photo.php?file="+url,id,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+width+",height="+height)
}

function showsubmit(l,p){
  if((p!='')&&(l!='Логин')&&(l!='')){
    document.all['logincaption'].style.display='none';
    document.all['loginform'].submit.style.pixelWidth=45;
    document.all['submit_img'].style.display='';
  }else{
    document.all['logincaption'].style.display='';
    
    document.all['loginform'].submit.style.pixelWidth=0;
    document.all['submit_img'].style.display='none';
  }
}

window.onload = function(){
  if (document.getElementsByTagName) {
    // Get all the tags of type object in the page.
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        // Get the HTML content of each object tag
        // and replace it with itself.
        objs[i].outerHTML = objs[i].outerHTML;
      }
   }
}
// When the page unloads:
window.onunload = function() {
  if (document.getElementsByTagName) {
    //Get all the tags of type object in the page.
    var objs = document.getElementsByTagName("object");
    for (i=0; i<objs.length; i++) {
      // Clear out the HTML content of each object tag
      // to prevent an IE memory leak issue.
      objs[i].outerHTML = "";
    }
  }
}

function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}


function aut() {
	var req = getXmlHttp();
	var statusElem = document.getElementById('window_aut') 
	req.onreadystatechange = function() {  
		if (req.readyState == 4) { 
			statusElem.innerHTML = req.statusText
			if(req.status == 200) {
				statusElem.innerHTML = req.responseText;
			}
		}
	}
	req.open('GET', '/ajax/aut.php', true);  
	req.send(null);
	statusElem.innerHTML = ''; 
}

function show_cabinet() {
	var req = getXmlHttp();
	var statusElem = document.getElementById('my_cabinet') 
	req.onreadystatechange = function() {  
		if (req.readyState == 4) {
			if(req.status == 200) {
				statusElem.innerHTML = req.responseText;
			}
		}
	}
	req.open('GET', '/ajax/cabinet.php', true);  
	req.send(null);
	statusElem.innerHTML = ''; 
}
function reg(){
	var req = getXmlHttp();
	var statusElem = document.getElementById('my_cabinet') 
	req.onreadystatechange = function() {  
		if (req.readyState == 4) { 
			if(req.status == 200) {
				window.location="/?module=auth&action=registerForm";
			}
		}
	}
	req.open('GET', '/ajax/cabinet.php', true);  
	req.send(null);
}

function EventHandler(id,div_id){
	  document.getElementById(div_id).style.display="none";
    }
function stub(event){    
      var e = ("undefined"==typeof(event))?window.event:event;
      e.cancelBubble=true;
      return false;
}

