// JavaScript Document
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = "assets/" + args[i];
  }
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = "assets/" + imgSrc;
    }
  }
}

function ShowHideObj(objName, newVisibility) {
	document.getElementById(objName).style.visibility = newVisibility;
}
function SetDisplayObj(objName, newDisplay) {
	document.getElementById(objName).style.display = newDisplay;
}

function sendForm(frmName, setAction, setMethod) {
	var frm = document.getElementById(frmName);
	if(setAction != "x") frm.action = setAction;
	if(setMethod != "x") frm.method = setMethod;
	frm.submit();
}

// azt a hármat felulirjuk az album_show.php ben
function SC_ViewCart() {
	location = "shopping_cart.php";
}
function SC_RemovePhoto(sc_index) {
	location = "shopping_cart.php?delfromalbum_index="+sc_index;
}
function SC_AddPhoto(photo_id, price_type) {
	location = "shopping_cart.php?addproduct_id="+photo_id+"&price_type="+price_type;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
