nav = navigator.appName.indexOf("Microsoft")!= -1 ? 1 : 2; function writeFlash(divid,url,width,height,bgcolor,id,vars,transparent,menu,style){ document.getElementById(divid).innerHTML = ''+''+''+''+''+''+(menu==0 || menu==1 ? '' : '')+(transparent ? '' : '')+''+''; } function popup(url, name, width, height, scroll, modal, resizable) { width=Math.min(screen.availWidth,width); height=Math.min(screen.availHeight-40,height); var poz_x=(screen.availWidth-width)/2; var poz_y=(screen.availHeight-height-30)/2; newwin=window.open(url, name, 'scrollbars='+scroll+', menubar=no, width='+width+', height='+height+', resizable='+(resizable ? 'yes' : 'no')+',toolbar=no, left='+poz_x+', top='+poz_y+', location=no, status=yes'); if(modal){ popInt=setInterval(function(n){ if(typeof(newwin.name)=="string"){ if(newwin.document.body){ openerfocus=function(){ if(typeof(newwin.name)=="string"){ newwin.focus(); }else{ document.body.onfocus=null; } } document.body.onfocus=openerfocus; newwin.window.document.body.onunload=function(){alert(66)} newwin.focus(); /*with(newwin){ self.focus() opener.document.body.onfocus=function(){self.focus();opener.alert(4);} self.document.body.onunload=function(){opener.document.body.onfocus=null} }*/ clearInterval(popInt); } }else{ clearInterval(popInt) } },1) } } function hex2rgb(val) { //hex2rgb convert //created by Sebastian Serban v1.0 (17.06.2005) return [val >> 16, val >> 8 & 0xff, val & 0xff]; }; function backgroundTrans(obj,color,time,prop,callback){ //created by Sebastian Serban //v1.3 (26.10.2005) if(prop == undefined){ prop = "bgColor"; } clearInterval(obj.interval); var endValue = color; color = hex2rgb(Number("0x"+color.substr(1))); var startValue = hex2rgb(Number("0x"+obj[prop].substr(1))); var timePast = 0; obj.stopTrans = function(){ clearInterval(this.interval); } obj.endTrans = function(){ this.stopTrans(); this[prop] = endValue; if(callback!=null){ callback(); } } var callf = function(){ timePast+=50; if(timePast >= time){ obj.endTrans(); }else{ var new_color = (parseInt(startValue[0]+timePast*(color[0]-startValue[0])/time))*0x10000; new_color += (parseInt(startValue[1]+timePast*(color[1]-startValue[1])/time))*0x100; new_color += (parseInt(startValue[2]+timePast*(color[2]-startValue[2])/time)); new_color = new_color.toString(16); obj[prop] = "#"+new_color; } } obj.interval=setInterval(callf,10); callf(); } function bgTrans(obj,start_color,color,time,callback){ //created by Sebastian Serban //v1 (25.01.2006) obj.style.backgroundColor=start_color; clearInterval(obj.interval); var endValue = color; color = hex2rgb(Number("0x"+color.substr(1))); //var startValue = hex2rgb(Number("0x"+obj.style.backgroundColor.substr(1))); var startValue = hex2rgb(Number("0x"+start_color.substr(1))); var timePast = 0; obj.stopTrans = function(){ clearInterval(this.interval); } obj.endTrans = function(){ this.stopTrans(); this.style.backgroundColor = endValue; if(callback!=null){ callback(); } } var callf = function(){ timePast+=50; if(timePast >= time){ obj.endTrans(); }else{ var new_color = (parseInt(startValue[0]+timePast*(color[0]-startValue[0])/time))*0x10000; new_color += (parseInt(startValue[1]+timePast*(color[1]-startValue[1])/time))*0x100; new_color += (parseInt(startValue[2]+timePast*(color[2]-startValue[2])/time)); new_color = new_color.toString(16); obj.style.backgroundColor = "#"+new_color; } } obj.interval=setInterval(callf,10); callf(); } function schimba_opt(list_from,list_to){ if(list_from.selectedIndex!=-1){ var old_opt=list_from.options[list_from.selectedIndex]; var new_opt=new Option(); var props=["text","value"]; for(var i=0;i(list_to.options[i].text) && list_to.options[i].value!=0){ //i++; //} list_from.remove(list_from.selectedIndex); list_to.add(new_opt,i); } } function schimba_all_opt(list_from,list_to){ for(var j=list_from.options.length-1;j>=0;j--){ var old_opt=list_from.options[j]; var new_opt=new Option(); var props=["text","value"]; for(var i=0;i(list_to.options[i].text) && list_to.options[i].value!=0){ //i++; //} list_from.remove(j); list_to.add(new_opt,i); } } Array.prototype.find = function(elem, all) { //function for finding elements in arrays //created by Sebastian Serban, v3.2 (18.10.2004) //this function receives "elem" which may be an number or an array and returns the position or an array of the positions //if param "all" is defined, then function return array with all the positions instead of position of the first element found if (elem.length == undefined || typeof (elem) != "object") { elem = [elem]; single = true; }else{ single = false; } var result = []; if (all == undefined) { for (var k = 0; k