function confirmLink(theLink,theSqlQuery)
{var confirmMsg='this is stll in testing ';var is_confirmed=confirm(confirmMsg+' :\n'+theSqlQuery);if(is_confirmed){theLink.href+='&delete_set_list=y';}
return is_confirmed;}
function putFocus(formInst,elementInst){if(document.forms.length>0){document.forms[formInst].elements[elementInst].focus();}}
var win=null;function NewWindow(mypage,myname,w,h,scroll,pos){if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center"&&pos!="random")||pos==null){LeftPosition=0;TopPosition=20;}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',titlebar=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';win=window.open(mypage,myname,settings);}
function setCheckboxes(the_form,do_check)
{var elts=(typeof(document.forms[the_form].elements['userInfos[]'])!='undefined')?document.forms[the_form].elements['userInfos[]']:(typeof(document.forms[the_form].elements['userInfos[]'])!='undefined')?document.forms[the_form].elements['userInfos[]']:document.forms[the_form].elements['userInfos[]'];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;}
function autoComplete(field,select,property,forcematch){var found=false;for(var i=0;i<select.options.length;i++){if(select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase())==0){found=true;break;}}
if(found){select.selectedIndex=i;}else{select.selectedIndex=-1;}
if(field.createTextRange){if(forcematch&&!found){field.value=field.value.substring(0,field.value.length-1);return;}
var cursorKeys="8;46;37;38;39;40;33;34;35;36;45;";if(cursorKeys.indexOf(event.keyCode+";")==-1){var r1=field.createTextRange();var oldValue=r1.text;var newValue=found?select.options[i][property]:oldValue;if(newValue!=field.value){field.value=newValue;var rNew=field.createTextRange();rNew.moveStart('character',oldValue.length);rNew.select();}}}}
function verifyPassword(form){missinginfo1="";missinginfo2="";if((document.passwords.oldpass.value=="")||(document.passwords.oldpass.value=="old password")){missinginfo1="you need to fill in the old password\n\n";mm="f";}
if(document.passwords.newpass1.value!=document.passwords.newpass2.value){missinginfo2="the two new passwords must match\n\n";nn="f";}
if((mm=="f")||(nn="f")){alert(missinginfo1+missinginfo2);return false;}
else return true;}
function moveOver(){var boxLength=document.choiceForm.choiceBox.length;var selectedItem=document.choiceForm.available.selectedIndex;var selectedText=document.choiceForm.available.options[selectedItem].text;var selectedValue=document.choiceForm.available.options[selectedItem].value;var i;var isNew=true;if(boxLength!=0){for(i=0;i<boxLength;i++){thisitem=document.choiceForm.choiceBox.options[i].text;if(thisitem==selectedText){isNew=false;break;}}}
if(isNew){newoption=new Option(selectedText,selectedValue,false,false);document.choiceForm.choiceBox.options[boxLength]=newoption;}
document.choiceForm.available.selectedIndex=-1;}
function removeMe(){var boxLength=document.choiceForm.choiceBox.length;arrSelected=new Array();var count=0;for(i=0;i<boxLength;i++){if(document.choiceForm.choiceBox.options[i].selected){arrSelected[count]=document.choiceForm.choiceBox.options[i].value;}
count++;}
var x;for(i=0;i<boxLength;i++){for(x=0;x<arrSelected.length;x++){if(document.choiceForm.choiceBox.options[i].value==arrSelected[x]){document.choiceForm.choiceBox.options[i]=null;}}
boxLength=document.choiceForm.choiceBox.length;}}
function saveMe(){var strValues="";var boxLength=document.choiceForm.choiceBox.length;var count=0;if(boxLength!=0){for(i=0;i<boxLength;i++){if(count==0){strValues=document.choiceForm.choiceBox.options[i].value;}
else{strValues=strValues+","+document.choiceForm.choiceBox.options[i].value;}
count++;}}
if(strValues.length==0){alert("You have not made any selections");}
else{alert("Here are the values you've selected:\r\n"+strValues);}}
function load(file,target){if(target!='')
target.window.location.href=file;else
window.location.href=file;}
function newWindow(file,window){msgWindow=open(file,window,'resizable=no,width=450,height=350');if(msgWindow.opener==null)msgWindow.opener=self;}
function nw(url,name){window.open(url,(name?name:'_blank'),'');}
function bookmark(url,title){if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4)){window.external.AddFavorite(url,title);}else if(navigator.appName=="Netscape"){window.sidebar.addPanel(title,url,"");}else{alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");}}
function include(filename)
{var head=document.getElementsByTagName('head')[0];script=document.createElement('script');script.src=filename;script.type='text/javascript';head.appendChild(script)}
startColor="#0000ff";endColor="#FE3A01";stepIn=20;stepOut=25;autoFade=true;sloppyClass=true;hexa=new makearray(16);for(var i=0;i<10;i++)
hexa[i]=i;hexa[10]="a";hexa[11]="b";hexa[12]="c";hexa[13]="d";hexa[14]="e";hexa[15]="f";document.onmouseover=domouseover;document.onmouseout=domouseout;startColor=dehexize(startColor.toLowerCase());endColor=dehexize(endColor.toLowerCase());var fadeId=new Array();function dehexize(Color){var colorArr=new makearray(3);for(i=1;i<7;i++){for(j=0;j<16;j++){if(Color.charAt(i)==hexa[j]){if(i%2!=0)
colorArr[Math.floor((i-1)/2)]=eval(j)*16;else
colorArr[Math.floor((i-1)/2)]+=eval(j);}}}
return colorArr;}
function domouseover(){if(document.all){var srcElement=event.srcElement;if((srcElement.tagName=="A"&&autoFade)||(srcElement.tagName=="a"&&autoFade)||srcElement.className=="fade"||(sloppyClass&&srcElement.className.indexOf("fade")!=-1))
fade(startColor,endColor,srcElement.uniqueID,stepIn);}}
function domouseout(){if(document.all){var srcElement=event.srcElement;if((srcElement.tagName=="A"&&autoFade)||(srcElement.tagName=="a"&&autoFade)||srcElement.className=="fade"||(sloppyClass&&srcElement.className.indexOf("fade")!=-1))
fade(endColor,startColor,srcElement.uniqueID,stepOut);}}
function makearray(n){this.length=n;for(var i=1;i<=n;i++)
this[i]=0;return this;}
function hex(i){if(i<0)
return"00";else if(i>255)
return"ff";else
return""+hexa[Math.floor(i/16)]+hexa[i%16];}
function setColor(r,g,b,element){var hr=hex(r);var hg=hex(g);var hb=hex(b);element.style.color="#"+hr+hg+hb;}
function fade(s,e,element,step){var sr=s[0];var sg=s[1];var sb=s[2];var er=e[0];var eg=e[1];var eb=e[2];if(fadeId[0]!=null&&fade[0]!=element){setColor(sr,sg,sb,eval(fadeId[0]));var i=1;while(i<fadeId.length){clearTimeout(fadeId[i]);i++;}}
for(var i=0;i<=step;i++){fadeId[i+1]=setTimeout("setColor(Math.floor("+sr+" *(( "+step+" - "+i+" )/ "+step+" ) + "+er+" * ("+i+"/"+
step+")),Math.floor("+sg+" * (( "+step+" - "+i+" )/ "+step+" ) + "+eg+" * ("+i+"/"+step+")),Math.floor("+sb+" * (("+step+"-"+i+")/"+step+") + "+eb+" * ("+i+"/"+step+")),"+element+");",i*step);}
fadeId[0]=element;}
var Spry;if(!Spry)
{Spry={};}
if(!Spry.Widget)
{Spry.Widget={};}
Spry.Widget.MenuBar=function(element,opts)
{this.init(element,opts);};Spry.Widget.MenuBar.prototype.init=function(element,opts)
{this.element=this.getElement(element);this.currMenu=null;var isie=(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE');if(typeof document.getElementById=='undefined'||(navigator.vendor=='Apple Computer, Inc.'&&typeof window.XMLHttpRequest=='undefined')||(isie&&typeof document.uniqueID=='undefined'))
{return;}
if(opts)
{for(var k in opts)
{var rollover=new Image;rollover.src=opts[k];}}
if(this.element)
{this.currMenu=this.element;var items=this.element.getElementsByTagName('li');for(var i=0;i<items.length;i++)
{this.initialize(items[i],element,isie);if(isie)
{this.addClassName(items[i],"MenuBarItemIE");items[i].style.position="static";}}
if(isie)
{if(this.hasClassName(this.element,"MenuBarVertical"))
{this.element.style.position="relative";}
var linkitems=this.element.getElementsByTagName('a');for(var i=0;i<linkitems.length;i++)
{linkitems[i].style.position="relative";}}}};Spry.Widget.MenuBar.prototype.getElement=function(ele)
{if(ele&&typeof ele=="string")
return document.getElementById(ele);return ele;};Spry.Widget.MenuBar.prototype.hasClassName=function(ele,className)
{if(!ele||!className||!ele.className||ele.className.search(new RegExp("\\b"+className+"\\b"))==-1)
{return false;}
return true;};Spry.Widget.MenuBar.prototype.addClassName=function(ele,className)
{if(!ele||!className||this.hasClassName(ele,className))
return;ele.className+=(ele.className?" ":"")+className;};Spry.Widget.MenuBar.prototype.removeClassName=function(ele,className)
{if(!ele||!className||!this.hasClassName(ele,className))
return;ele.className=ele.className.replace(new RegExp("\\s*\\b"+className+"\\b","g"),"");};Spry.Widget.MenuBar.prototype.addEventListener=function(element,eventType,handler,capture)
{try
{if(element.addEventListener)
{element.addEventListener(eventType,handler,capture);}
else if(element.attachEvent)
{element.attachEvent('on'+eventType,handler);}}
catch(e){}};Spry.Widget.MenuBar.prototype.createIframeLayer=function(menu)
{var layer=document.createElement('iframe');layer.tabIndex='-1';layer.src='javascript:false;';menu.parentNode.appendChild(layer);layer.style.left=menu.offsetLeft+'px';layer.style.top=menu.offsetTop+'px';layer.style.width=menu.offsetWidth+'px';layer.style.height=menu.offsetHeight+'px';};Spry.Widget.MenuBar.prototype.removeIframeLayer=function(menu)
{var layers=menu.parentNode.getElementsByTagName('iframe');while(layers.length>0)
{layers[0].parentNode.removeChild(layers[0]);}};Spry.Widget.MenuBar.prototype.clearMenus=function(root)
{var menus=root.getElementsByTagName('ul');for(var i=0;i<menus.length;i++)
{this.hideSubmenu(menus[i]);}
this.removeClassName(this.element,"MenuBarActive");};Spry.Widget.MenuBar.prototype.bubbledTextEvent=function()
{return(navigator.vendor=='Apple Computer, Inc.'&&(event.target==event.relatedTarget.parentNode||(event.eventPhase==3&&event.target.parentNode==event.relatedTarget)));};Spry.Widget.MenuBar.prototype.showSubmenu=function(menu)
{if(this.currMenu)
{this.clearMenus(this.currMenu);this.currMenu=null;}
if(menu)
{this.addClassName(menu,"MenuBarSubmenuVisible");if(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE')
{if(!this.hasClassName(this.element,"MenuBarHorizontal")||menu.parentNode.parentNode!=this.element)
{menu.style.top=menu.parentNode.offsetTop+'px';}}
if(typeof document.uniqueID!="undefined")
{this.createIframeLayer(menu);}}
this.addClassName(this.element,"MenuBarActive");};Spry.Widget.MenuBar.prototype.hideSubmenu=function(menu)
{if(menu)
{this.removeClassName(menu,"MenuBarSubmenuVisible");if(typeof document.all!='undefined'&&typeof window.opera=='undefined'&&navigator.vendor!='KDE')
{menu.style.top='';menu.style.left='';}
this.removeIframeLayer(menu);}};Spry.Widget.MenuBar.prototype.initialize=function(listitem,element,isie)
{var opentime,closetime;var link=listitem.getElementsByTagName('a')[0];var submenus=listitem.getElementsByTagName('ul');var menu=(submenus.length>0?submenus[0]:null);var hasSubMenu=false;if(menu)
{this.addClassName(link,"MenuBarItemSubmenu");hasSubMenu=true;}
if(!isie)
{listitem.contains=function(testNode)
{if(testNode==null)
{return false;}
if(testNode==this)
{return true;}
else
{return this.contains(testNode.parentNode);}};}
var self=this;this.addEventListener(listitem,'mouseover',function(e)
{if(self.bubbledTextEvent())
{return;}
clearTimeout(closetime);if(self.currMenu==listitem)
{self.currMenu=null;}
self.addClassName(link,hasSubMenu?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(menu&&!self.hasClassName(menu,"MenuBarSubmenuVisible"))
{opentime=window.setTimeout(function(){self.showSubmenu(menu);},100);}},false);this.addEventListener(listitem,'mouseout',function(e)
{if(self.bubbledTextEvent())
{return;}
var related=(typeof e.relatedTarget!='undefined'?e.relatedTarget:e.toElement);if(!listitem.contains(related))
{clearTimeout(opentime);self.currMenu=listitem;self.removeClassName(link,hasSubMenu?"MenuBarItemSubmenuHover":"MenuBarItemHover");if(menu)
{closetime=window.setTimeout(function(){self.hideSubmenu(menu);},500);}}},false);};
