/* Prepopola input
---------------------------------------------*/
function inputs_prepopulate() {
inputs = document.getElementsByTagName('input');
n_inputs = inputs.length;
for (i = 0; i < n_inputs; i++) {
if (inputs[i].type=='text') {
inputs[i].value=inputs[i].title;
}
}
}
function prepopulate() {
inputs_prepopulate();
}
/* Aperura finestre
---------------------------------------------*/
function openWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
function wopen(url,w,h) {
option="top=0,left=0,toolbar=no,scrollbars=auto,location=no,width="+w+",height="+h;
newWindow= window.open("","",option);
newWindow.document.write("");
newWindow.document.write("
");
newWindow.document.write("Image dettail");
newWindow.document.write("");
newWindow.document.write("");
newWindow.document.write("");
newWindow.document.write("
");
newWindow.document.write("");
}
/* jump menu
---------------------------------------------*/
function jumpMenu(targ,selObj,restore) {
eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
if (restore) selObj.selectedIndex=0;
}
/* doom Pop Up apre pop up di altri contenuti ... NON usa ajax
----------------------------------------------------------------*/
DOMinclude={
ifrContainer:null,
currentTrigger:null,
init:function(){
if(!document.getElementById || !document.createTextNode){return;}
var allLinks=document.getElementsByTagName('a');
for(var i=0;i0){
DOMinclude.currentTrigger.isOpen=false;
}
DOMinclude.currentTrigger.innerHTML=DOMinclude.currentTrigger.preset;
DOMinclude.cssjs('remove',DOMinclude.currentTrigger,DOMinccfg.openPopupLinkClass);
DOMinclude.currentTrigger=null;
}
DOMinclude.ifrContainer.parentNode.removeChild(DOMinclude.ifrContainer);
DOMinclude.ifrContainer=null;
DOMinclude.cancelClick(e);
},
getTarget:function(e){
var target = window.event ? window.event.srcElement : e ? e.target : null;
if (!target){return false;}
while(target.nodeType!=1 && target.nodeName.toLowerCase()!='body'){
target=target.parentNode;
}
return target;
},
cancelClick:function(e){
if (window.event && window.event.cancelBubble
&& window.event.returnValue){
window.event.cancelBubble = true;
window.event.returnValue = false;
return;
}
if (e && e.stopPropagation && e.preventDefault){
e.stopPropagation();
e.preventDefault();
}
},
addEvent: function(elm, evType, fn, useCapture){
if (elm.addEventListener){
elm.addEventListener(evType, fn, useCapture);
return true;
} else if (elm.attachEvent) {
var r = elm.attachEvent('on' + evType, fn);
return r;
} else {
elm['on' + evType] = fn;
}
},
cssjs:function(a,o,c1,c2){
switch (a){
case 'swap':
o.className=!DOMinclude.cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
break;
case 'add':
if(!DOMinclude.cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
break;
case 'remove':
var rep=o.className.match(' '+c1)?' '+c1:c1;
o.className=o.className.replace(rep,'');
break;
case 'check':
var found=false;
var temparray=o.className.split(' ');
for(var i=0;i