function menuover(param){
	document.getElementById(param).style.backgroundColor='#F4F1E9';
}
function menuout(param){
	document.getElementById(param).style.backgroundColor='';
}
function showhide (elementId) {
	 if( document.getElementById ) {
        //DOM
        var theElement = document.getElementById( elementId );
    } else {
        if( document.all ) {
            //Proprietary DOM
            var theElement = document.all[ elementId ];
        } else {
            //Create an object to prevent errors further on
            var theElement = new Object();
        }
    }
	tbl =  theElement;
	if (tbl.style.display == 'none')
		tbl.style.display = 'inline';
	else 
		tbl.style.display = 'none';
}
function minMax (w) {

	we = document.getElementById(w);

	if (we.style.display == 'none')
		we.style.display = 'inline';
	else 
		we.style.display = 'none';
}
function flash_fix(f) {
	document.write(f); 
}
//--- start open window for gallery -------------------------------------
var newWin = null;
function NewWindow(param){
        // Create and set window option variables.
        var windowBars = 'directories=no,location=no,menubar=no,status=no,toobar=no';
        var windowOptions = 'scrollbars=no,width=600,height=450,resizable=yes,left=200,top=100';
        var windowFeatures = windowBars + ',' + windowOptions;
        var childWindow = '../lib/galerie.php?img='+param;

        // Open the child window
    	newWin = window.open(childWindow, 'contactus', windowFeatures);
	    window.newWin.focus();
}
//--- end open window ----------------------------------------------------
function clear_cauta(e){
		if(e.value=="NEWSLETTER")
			e.value="";
	}
function fill_cauta(e){
		if(e.value=="")
			e.value="NEWSLETTER";
	}
function imgResize(img)
{
	img1 = new Image();
	img1.src = (img);
	imgControll(img);
}
function imgControll(img)
{
	if((img1.width!=0)&&(img1.height!=0))
	{
		viewImage(img);
	}
	else
	{
		controller="imgControll('"+img+"')";
		intervalID=setTimeout(controller, 20);
	}
}

function viewImage(img)
{
	var scroll = "yes";
	var W = img1.width;
	var H = img1.height;
	var AW = screen.availWidth;
	var AH = screen.availHeight;

	if (H > AH && W <= AW)
		W += 17;
	if (W > AW && H <= AH)
		H += 17;

	if (W <= AW && H <= AH)
		scroll = "no";

	var O = "width=" + W + ",height=" + H + ",scrollbars=" + scroll + ",left=0,top=0";
	imgWin=window.open("","",O);
	imgWin.document.write("<html><head><title>Image View</title></head>");
	imgWin.document.write("<body style='margin:0'>");
	imgWin.document.write("<img src='"+img+"' onclick='self.close()' style='cursor:hand;'>");
	imgWin.document.write("</body></html>");
	imgWin.document.close();
}

