// JavaScript Document
//function menuitem(id) {
	//this.id=id;
	//if(document.getElementById(id).style.backgroundColor='#3F6'){
//		document.getElementById(id).style.backgroundColor='#03C';
	//}else{
	//	document.getElementById(id).style.backgroundColor='#3F6';
	//}
//}ß
function moveupload(){
	var adress = document.getElementById("preview").src;
	adress="upload.php?id="+adress;
	makeRequest(adress, 'preview');
}
function menuitem(id) {
	this.id=id;
	document.getElementById(id).style.backgroundColor='#969696';
}
function menuitemout(id) {
	this.id=id;
	document.getElementById(id).style.backgroundColor='#DDDDDD';
}
function galleryshow() {
	document.getElementById('ajaximg').style.visibility='visible';
}
function galleryhide() {
	document.getElementById('ajaximg').style.visibility='hidden';
}
function link(adress){
	window.location=adress;
}
function openpopup(popurl){
	var winpops=window.open(popurl,"","width=847,height=,status,resizable")
}
function changepreview(url){
	document.getElementById('preview').src=url;	
}
startList = function() {
	if (document.all&&document.getElementById) {
		cssdropdownRoot = document.getElementById("cssdropdown");
		for (x=0; x<cssdropdownRoot.childNodes.length; x++) {
			node = cssdropdownRoot.childNodes[x];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

if (window.attachEvent)
window.attachEvent("onload", startList)
else
window.onload=startList;



function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}




function ajaxpost(user,pass,ip){
  getCookie("login")
  var user=this.user;
  var pass=this.pass;
  var ip=this.ip;
  var passData = 'user='+escape(user)+'&pass='+escape(pass)+'&ip='+escape(ip);
  var AJAX = null;
  if (window.XMLHttpRequest) {
	 AJAX=new XMLHttpRequest();
  } else {
	 AJAX=new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (AJAX==null) {
	 alert("Your browser doesn't support AJAX.");                                         
	 return false
  } else {
	 AJAX.open("POST", "http://www.somedomain.com/somecgi.php", true);
	 AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	 AJAX.onreadystatechange = function() {                      
		if (AJAX.readyState==4 || AJAX.readyState=="complete") { 
		   callback(AJAX.responseText, AJAX.status); 
		}                               
	 }                                  
	 AJAX.send(passData);
  }
}

