

function getLayer(layerID){
	if (document.getElementById(layerID)) {

		return document.getElementById(layerID);

	} else if (document.all(layerID)) {
		return document.all(layerID);
	}
}
function downloadFile(f,idm){
	//window.location.href="<? echo $urlsito ?>download.php?f="+f;
	str_link="download_pop.php?f="+f+"&id_marca="+idm;
	MM_openBrWindow(str_link,'filedownload','scrollbars=yes,width=550,height=350');
}
function setFormFieldValue(form,field,valore){
	document.forms[form][field].value = valore;
}
function getFormFieldValue(form,field){
	return document.forms[form][field].value;
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function  sendSearch (){
	document.ftsearch.submit();
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
 
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
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;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


<!-- Original:  Ed Churnside -->
<!-- Web Site:  http://www.dragonquest.com/inddpl.htm -->

<!-- Additional documention available online at -->
<!-- http://www.dragonquest.com/dplsspic.htm -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
if (src == null) return;
var iw, ih; // Set inner width and height
if (window.innerWidth == null) {
	iw = document.body.clientWidth;
	ih=document.body.clientHeight; 
}
else {
	iw = window.innerWidth;
	ih = window.innerHeight;
}

if(tipo_w==0){// pagina in percentuale 
	corpo_w=iw;
}

var spazio_utile 
spazio_utile=(iw-dx_w)-sx_w - (100);
h_space=5;
if(spazio_utile < w){// se l'imagine è + grande dello spazio utile 
	Tprop=w-spazio_utile;
	prop=Math.round((spazio_utile/w)*100); // percentuale 
	if (w == null) w = iw;
	if(h == null)  h = ih;
	if(alt == null) alt = "Picture";
	if(aln == null) aln = "left";
	if(pw == null) pw = prop;
	if(ph == null) ph = prop;
	if(bw == null) bw = 24;
	if(bh == null) bh = 24;
	var sw = Math.round((iw - bw) * pw / 100);
	var sh = Math.round((ih - bh) * ph / 100);
	if ((w * sh) / (h * sw) < 1) sw = Math.round(w * sh / h);
	else sh = Math.round(h * sw / w);
	document.write('<img src="'+src+'" alt="'+alt+'" width="'+sw+'" height="'+sh+'" align="'+aln+'" hspace="'+h_space+'" class="catalogo-img">');
}else{
	document.write('<img src="'+src+'" alt="'+alt+'" width="'+w+'" height="'+h+'" align="'+aln+'" class="catalogo-img">');
}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 1.1 Sets the mouse pointer to pointer on mouseover and back to normal otherwise.
    if (theAction == "over" || theAction == "click") {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='default';
    }
    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    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);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
	
    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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    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;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

 function Swap(cName,tag) {
  for(var x=0;x<document.getElementsByTagName(tag).length;x++)
   document.getElementsByTagName(tag)[x].className=cName;
 } //Swap
 
 <!-- Begin
function setupDescriptions() {
	var x = navigator.appVersion;
	y = x.substring(0,4);
	if (y>=4) setVariables();
}
var x,y,a,b;
function setVariables(){
	if (navigator.appName == "Netscape") {
		h=".left=";
		v=".top=";
		dS="document.";
		sD="";
	}else {
		h=".pixelLeft=";
		v=".pixelTop=";
		dS="";
		sD=".style";
   }
}
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function popLayer(a){
	var isNav = (navigator.appName.indexOf("Netscape") !=-1);
	desc = "<table cellpadding=3 border=0  class=tbl-layer><td class=prodotto-descrizione>";
	/*
	if (a==1) desc += "The JavaScript Source Home Page!";
	if (a==2) desc += "Updates on all the latest scripts added to the site!";
	if (a==3) desc += "Browser our Table of Contents page!";
	if (a==4) desc += "Get JavaScript assistance in our JS forum!";
	if (a==5) desc += "Get the answers to our commonly asked JS questions!";
	*/
	desc +=a;
	desc += "</td></table>";

	if(a!=""){
		if(isNav) {
			document.object1.document.write(desc);
			document.object1.document.close();
			document.object1.left=x+25;
			document.object1.top=y;
		}else {
			object1.innerHTML=desc;
			eval(dS+"object1"+sD+h+(x+25));
			eval(dS+"object1"+sD+v+y);
		  }
	  }
}
function hideLayer(a){
	if(isNav) {
	eval(document.object1.top=a);
	}
	else object1.innerHTML="";
	}
function handlerMM(e){
	x = (isNav) ? e.pageX : event.clientX;
	y = (isNav) ? e.pageY : event.clientY;
}
if (isNav){
	document.captureEvents(Event.MOUSEMOVE);
}
	document.onmousemove = handlerMM;
//  End -->