
if(typeof VS=="undefined")
var VS={};VS.util={};VS.util.isNetscape=function(){return(navigator.appName=="Netscape");}
VS.util.isIE=function(){return(navigator.userAgent.indexOf("MSIE")!=-1);}
VS.util.isMac=function(){return(navigator.userAgent.indexOf("Mac")!=-1);}
VS.util.PopupOpen=function(url,name,features)
{name=name.replace(/\s+/g,'');var win=window.open(url,name,features);if(win==null)
alert("Your browser or popup-blocker appears to have blocked a popup that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this application.");else
win.focus();return win;}
VS.util.PopupClose=function(win)
{if(win)
{try
{win.openerValid=false;win.close();}
catch(e){}}}
VS.util.PopupHelp=function(url)
{VS.util.PopupOpen(url,"help","width=800,height=600,status,toolbar,scrollbars,resizable=yes");}
VS.util.FindFrame=function(name,w)
{if(arguments.length<2||w==null)
w=window.top;if(w.name==name)
return w;if(w.frames!=null)
{for(var i=0;i<w.frames.length;i++)
{var result=VS.util.FindFrame(name,w.frames[i]);if(result)
return result;}}
return null;}
VS.util.SetCookie=function(name,value,expires,path,domain,secure)
{var argc=VS.util.SetCookie.arguments.length;if(argc<3)expires=null;if(argc<4)path="/";if(argc<5)domain=null;if(argc<6)secure=false;document.cookie=name+"="+escape(value)+
((expires==null)?"":("; expires="+expires.toGMTString()))+
((path==null)?"":("; path="+path))+
((domain==null)?"":("; domain="+domain))+
((secure==true)?"; secure":"");}
VS.util.GetCookie=function(name)
{var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)
{var j=i+alen;if(document.cookie.substring(i,j)==arg)
{var endstr=document.cookie.indexOf(";",j);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(j,endstr));}
i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;}
VS.util.ExpireCookie=function(name)
{var exp=new Date();exp.setTime(exp.getTime()-1000);var cval=GetCookie(name);document.cookie=name+"="+cval+"; expires="+exp.toGMTString();}
VS.util.GetQueryArg=function(name,defval)
{name=name.replace('-','_');name=name.replace('_','[-_]');var result=window.location.search.match(new RegExp('[?&]'+name+'=([^&]*)'));return(result!=null)?result[1]:(typeof(defval)!='undefined')?defval:"";}
VS.util.InitToggleAll=function()
{for(var a=0;a<arguments.length;a++)
{var id=arguments[a];var obj=document.getElementById(id);if(obj)
{var re=new RegExp("^"+id+"[0-9]+$");var doCheck=false;for(var i=0;i<obj.form.elements.length;i++)
{var el=obj.form.elements[i];if(el!=obj&&el.type=="checkbox"&&re.test(el.name))
{doCheck=true;if(!el.checked)
{doCheck=false;break;}}}
obj.checked=doCheck;}}}
VS.util.ToggleAll=function(obj)
{if(obj&&obj.form)
{var re=new RegExp("^"+obj.id+"[0-9]+$");for(var i=0;i<obj.form.elements.length;i++)
{var el=obj.form.elements[i];if(el!=obj&&el.type=="checkbox"&&re.test(el.name))
el.checked=obj.checked;}}}
VS.util.ToggleAllEnabled=function(obj)
{if(obj&&obj.form)
{var re=new RegExp("^"+obj.id+"[0-9]+$");for(var i=0;i<obj.form.elements.length;i++)
{var el=obj.form.elements[i];if(VS.util.isIE())
{if(el!=obj&&el.type=="checkbox"&&re.test(el.name)&&(el.getAttribute("DISABLED")==false))
el.checked=obj.checked;}
else
{if(el!=obj&&el.type=="checkbox"&&re.test(el.name)&&(el.disabled==false))
el.checked=obj.checked;}}}}
VS.util.Toggle=function(obj)
{if(obj&&obj.form)
{var id=obj.name.match(/^[^0-9]+/);if(id)
VS.util.InitToggleAll(id);}}
VS.util.AnyChecked=function(formId,namePrefix)
{var form=document.getElementById(formId);if(form)
{var re=new RegExp("^"+namePrefix+"[0-9]+$");for(var i=0;i<form.elements.length;i++)
{var el=form.elements[i];if(el.type=="checkbox"&&re.test(el.name)&&el.checked)
return true;}}
return false;}
VS.util.GetRadioValue=function(radioGroup)
{if(radioGroup)
{for(var i=0;i<radioGroup.length;i++)
{var el=radioGroup[i];if(el.checked)
return el.value;}}
return false;}
VS.util.CheckOnContent=function(content,check)
{check.checked=(content.value.length!=0);}
VS.util.CheckOnCheck=function(src,dst)
{if(src.checked)dst.checked=true;}
VS.util.EnableAutoStatusMessages=function()
{for(var i=0;i<document.links.length;i++)
{var link=document.links[i];if(!link.onmouseover&&!link.onmouseout)
{link.onmouseover=VS.util._AutoStatusMouseOver;link.onmouseout=VS.util._AutoStatusMouseOut;}}}
VS.util._AutoStatusMouseOver=function(e)
{var link=(arguments.length==0)?window.event.srcElement:e.target;if(link.title&&link.title!="")
{window.status=link.title;return true;}
return false;}
VS.util._AutoStatusMouseOut=function(e)
{var link=(arguments.length==0)?window.event.srcElement:e.target;if(link.title&&link.title!="")
{window.status='';return true;}
return false;}
VS.util.GetWindowHeight=function(theWindow)
{var result=0;var w=theWindow?theWindow:window;if(w.innerHeight)
{result=w.innerHeight;}
else if(w.document.documentElement==null||typeof(w.document.documentElement.clientHeight)=="undefined"||(w.document.documentElement.clientWidth==0&&w.document.documentElement.clientHeight==0))
{result=w.document.body.clientHeight;}
else
{result=w.document.documentElement.clientHeight;}
return result;}
VS.util.GetWindowWidth=function(theWindow)
{var result=0;var w=theWindow?theWindow:window;if(w.innerWidth)
{result=w.innerWidth;}
else if(w.document.documentElement==null||typeof(w.document.documentElement.clientWidth)=="undefined"||(w.document.documentElement.clientWidth==0&&w.document.documentElement.clientHeight==0))
{result=w.document.body.clientWidth;}
else
{result=w.document.documentElement.clientWidth;}
return result;}
VS.util.CenterWindowAttrs=function(attrs)
{var width=-1,height=-1;var result=attrs.match(/width=(\d+)/);if(result&&result.length>1)
width=result[1];var result=attrs.match(/height=(\d+)/);if(result&&result.length>1)
height=result[1];if(width!=-1&&height!=-1)
{if(width>window.screen.availWidth)width=window.screen.availWidth;if(height>window.screen.availHeight)height=window.screen.availHeight;var left=Math.round((window.screen.availWidth-width)/2);attrs+=",left="+left;var top=Math.round((window.screen.availHeight-height)/3);attrs+=",top="+top;}
return attrs;}
VS.util.Debug=function(msg)
{var w=VS.util.Debug.console;if(w==null||w.closed)
{w=window.open("","console","width=600,height=300,resizable,scrollbars");w.document.open("text/plain");VS.util.Debug.console=w;}
w.focus();w.document.writeln(msg);}
if(typeof console=='undefined')
var console={log:VS.util.Debug};VS.util.GetCTime=function(date)
{if(typeof date=="undefined")
date=new Date;return Math.floor(date.getTime()/1000);}
VS.util.CopyProps=function(obj)
{for(prop in obj)
this[prop]=obj[prop];}
VS.util.EnableButton=function(el)
{YAHOO.util.Dom.batch(el,function(e){if(e)
{e.disabled=false;YAHOO.util.Dom.replaceClass(e,"button-disabled","button");}});}
VS.util.DisableButton=function(el)
{YAHOO.util.Dom.batch(el,function(e){e.disabled=true;YAHOO.util.Dom.replaceClass(e,"button","button-disabled");});}
VS.util.RestartGIFs=function()
{for(var i=0;i<document.images.length;i++)
{var img=document.images[i];var imgName=img.src.toUpperCase();if(imgName.substring(imgName.length-3,imgName.length)=="GIF")
{img.src=img.src;}}}