function alertit(){
alert("You moved your mouse over me!")
}

	function changeFont( font_zaproszenie )
	{
		window.opener.document.images.font_zaproszenie.src = "photos/_fonts/" + font_zaproszenie;
		window.opener.document.forms.formularz.font_zaproszenie.value = font_zaproszenie;
    window.opener.document.images.font_zaproszenie.style.width = 350 + 'px';
		window.close();
	}
	
	function changeText( text_zaproszenie )
	{
		window.opener.document.images.text_zaproszenie.src = "photos/_text/" + text_zaproszenie;
		window.opener.document.forms.formularz.text_zaproszenie.value = text_zaproszenie;
		window.opener.document.images.text_zaproszenie.style.width = 350 + 'px';
		window.close();
	}	
	
	function changePoem( poem_zaproszenie )
	{
		window.opener.document.images.poem_zaproszenie.src = "photos/_poems/" + poem_zaproszenie;
		window.opener.document.forms.formularz.poem_zaproszenie.value = poem_zaproszenie;
		window.opener.document.images.poem_zaproszenie.style.width = 350 + 'px';
		window.close();
	}		
	
	function changeWedding( wedding_zaproszenie )
	{
		window.opener.document.images.wedding_zaproszenie.src = "photos/_wedding/" + wedding_zaproszenie;
		window.opener.document.forms.formularz.wedding_zaproszenie.value = wedding_zaproszenie;
		window.opener.document.images.wedding_zaproszenie.style.width = 350 + 'px';
		window.close();
	}	
	
	function changeNadruk( nadruk )
	{
		document.getElementById('przelicz').click();
	}		

function setCheckboxColumn(theCheckbox){
    if (document.getElementById(theCheckbox)) {
        document.getElementById(theCheckbox).checked = (document.getElementById(theCheckbox).checked ? false : true);
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = document.getElementById(theCheckbox).checked;
        }
    } else {
        if (document.getElementById(theCheckbox + 'r')) {
            document.getElementById(theCheckbox + 'r').checked = (document.getElementById(theCheckbox +'r').checked ? false : true);
            if (document.getElementById(theCheckbox)) {
                document.getElementById(theCheckbox).checked = document.getElementById(theCheckbox + 'r').checked;
            }
        }
    }
} 


  function setCheckboxes(the_form, do_check)
  {
      var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                    ? document.forms[the_form].elements['selected_db[]']
                    : (typeof(document.forms[the_form].elements['selected_tbl[]']) != 'undefined')
            ? document.forms[the_form].elements['selected_tbl[]']
            : document.forms[the_form].elements['selected_fld[]'];
      var elts_cnt  = (typeof(elts.length) != 'undefined')
                    ? elts.length
                    : 0;
  
      if (elts_cnt) {
          for (var i = 0; i < elts_cnt; i++) {
              elts[i].checked = do_check;
          } 
      } else {
          elts.checked        = do_check;
      } 
  
      return true;
  } 
  

 
var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    if (theAction == "over" || theAction == "click") {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='default';
    }

    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }

    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } 
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;

        }
    }

    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            
        }
    }

    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } 

    if (newColor) {
        var c = null;

        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } 
        }

        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } 

    return true;
}
function validateSearch(formu,msg) 
{ 
   if (!formu.search.value) { 
        alert(msg); 
        document.formu.elements['search'].focus();
        return false; 
    } 
      else 
   { 
        return true; 
        } 
}


function confirmDel(msg)
{
input_box=confirm(msg);
if (input_box==true)
{
return true;
}
else
{
return false;
}
}

function validateLogin(form_login,msg) 
{ 
   if (!form_login.login.value) { 
        alert(msg); 
        document.form_login.elements['login'].focus();
        return false; 
    } 
    else if (!form_login.pass.value)
    {
            alert(msg); 
        document.form_login.elements['pass'].focus();
        return false; 
    }
      else 
   { 
        return true; 
        } 
}

function disableIt(obj)
{
	obj.disabled = true;

}

function enableIt(obj)
{
	obj.disabled = false;
}

function disabledsample(){

   document.getElementById('sample').style.visibility = "hidden";
}

function enabledpay(){

   for(var i=0;i<document.formularz.shipping.length;i++)
   {
   enableIt(document.formularz.shipping[i]);
   }

}
function tooltip(d,E,b,i,a){
  d=document;E=d.documentElement;b=d.body;if(!E)return;
  for(i=0;a=b.getElementsByTagName("a")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
        id="tooltip"
        innerHTML=a.title.replace(/\|/g,"<br />")
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        with(this){title=t.innerHTML.replace(/<br \/>/g,"\|")}
        if(x=d.getElementById("tooltip"))b.removeChild(x)
      }
      a.onmousemove=function(e){
        e=e||event;with(this.t.style){
         left=e.clientX+(E.scrollLeft||b.scrollLeft)+"px"
         top=e.clientY+(E.scrollTop||b.scrollTop)+"px"
        }
      }
    }
  }
    for(i=0;a=b.getElementsByTagName("img")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
        id="tooltip"
        innerHTML=a.title.replace(/\|/g,"<br />")
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        with(this){title=t.innerHTML.replace(/<br \/>/g,"\|")}
        if(x=d.getElementById("tooltip"))b.removeChild(x)
      }
      a.onmousemove=function(e){
        e=e||event;with(this.t.style){
         left=e.clientX+(E.scrollLeft||b.scrollLeft)+"px"
         top=e.clientY+(E.scrollTop||b.scrollTop)+"px"
        }
      }
    }
  }
}
function addEvent(O,E,F,x){
  return(x=O.addEventListener)?x(E,F,1):(x=O.attachEvent)?x('on'+E,F):!1
}
addEvent(window,'load',tooltip);


