// javascript file


function img_change(img_name,img_index){
  document.images[img_name].src = loaded[img_index].src;
}


function loginswitch(target,action,text)
{
  if( action == "unset" ) {
    if( target.value == text ) {  target.value = "";  }
    target.className = "loginActive";
  }
  else if( action == "set" ) {
    if( target.value == "" ) {  target.value = text;  }
    target.className = "login";
  }
}


function conf()
{
  if(!confirm('Wirklich löschen?'))
  {
    return false;
  }
}


function userProfile(userid, rootFolder)
{
  if((rootFolder==null) || (typeof(rootFolder) == "undefined")) { rootFolder = './user/'; }

  var windowWidth = 880;
  var windowHeight = 650;

  if(document.layers) {
    var left = (screen.width - windowWidth) / 2;
    var top = (screen.height - windowHeight) / 2;
  } else {
    var left = (screen.width - windowWidth) / 2; 
    var top = ((screen.height - windowHeight) / 2) - 20;
  }

  newWindow = window.open(rootFolder + 'profil.php?id=' + userid, '_blank', 'toolbar=no,location=no,scrollbars=yes,menubar=no,statusbar=no,resizable=yes,width=' + windowWidth + ',height=' + windowHeight + ',left=' + left + ',top=' + top);
  newWindow.focus();
  return false;
}


function setBoxes(status)
{
  for(i=0;i<document.frm.elements.length;i++)
  {
    if(document.frm.elements[i].type=='checkbox') document.frm.elements[i].disabled = status;
  }
}


function selectAll()
{
  for(i=0;i<document.frm.elements.length;i++)
  {
    document.frm.elements[i].checked=true;
  }
  return false;
}


function logout()
{
	ht = document.getElementsByTagName("table");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1, xray=0, mirror=0, invert=0, opacity=1, rotation=0)";
	if (confirm('Wirklich ausloggen?'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}


function CheckAll(users)
{

	if(document.frm.elements[users].checked == 1)
	{
		for (i=0; i < users; i++) 
		{
      document.frm.elements[i].checked = 1;
      document.all("label").innerText = 'Alle entfernen';
		}
	}
	else
	{
		for (i=0; i < users; i++) 
		{
      document.frm.elements[i].checked = 0;
      document.all("label").innerText = 'Alle auswählen';
		}
	}
}

function doubleflip( span_id )
{
  displayOne = ( document.getElementById( span_id + "1" ).style.display == 'none' ) ? 'block' : 'none';
  displayTwo = ( document.getElementById( span_id + "2" ).style.display == 'none' ) ? 'block' : 'none';
  document.getElementById( span_id + "1" ).style.display = displayOne;
  document.getElementById( span_id + "2" ).style.display = displayTwo;
  return false;
}

function flip( span_id )
{
  display = ( document.getElementById( span_id ).style.display == 'none' ) ? 'block' : 'none';
  document.getElementById( span_id ).style.display = display;
  return false;
}

function galPic( id )
{
  var windowWidth = 280;
  var windowHeight = 80;

  if(document.layers) {
    var left = (screen.width - windowWidth) / 2;
    var top = (screen.height - windowHeight) / 2;
  } else {
    var left = (screen.width - windowWidth) / 2; 
    var top = ((screen.height - windowHeight) / 2) - 20;
  }

  newWindow = window.open('gallery_picture.php?id=' + id, 'galPic', 'toolbar=no,location=no,scrollbars=yes,menubar=no,statusbar=no,resizable=yes,width=' + windowWidth + ',height=' + windowHeight + ',left=' + left + ',top=' + top);
  newWindow.focus();
  return false;
}

function postTools()
{
  var windowWidth = 750;
  var windowHeight = 650;

  if(document.layers) {
    var left = (screen.width - windowWidth) / 2;
    var top = (screen.height - windowHeight) / 2;
  } else {
    var left = (screen.width - windowWidth) / 2; 
    var top = ((screen.height - windowHeight) / 2) - 20;
  }

  newWindow = window.open('http://www.asianclub.at/posttools.html', 'postTools', 'toolbar=no,location=no,scrollbars=no,menubar=no,statusbar=no,resizable=no,width=' + windowWidth + ',height=' + windowHeight + ',left=' + left + ',top=' + top);
  newWindow.focus();
  return false;
}

function profilPic( url, rootFolder )
{
  if((rootFolder==null) || (typeof(rootFolder) == "undefined")) { rootFolder = ''; }
  var windowWidth = 280;
  var windowHeight = 80;

  if(document.layers) {
    var left = (screen.width - windowWidth) / 2;
    var top = (screen.height - windowHeight) / 2;
  } else {
    var left = (screen.width - windowWidth) / 2; 
    var top = ((screen.height - windowHeight) / 2) - 20;
  }

  newWindow = window.open(rootFolder + 'picture.php?url=' + url, 'profilPic', 'toolbar=no,location=no,scrollbars=yes,menubar=no,statusbar=no,resizable=yes,width=' + windowWidth + ',height=' + windowHeight + ',left=' + left + ',top=' + top);
  newWindow.focus();
  return false;
}

//