/* 
* Javascript for BUFFALO.COM  
*
* This file consolidates the following scripts into a single, minified file
* for faster downloading:
*
* http://media.buffalo.com/static/js/scripts.js
* http://media.buffalo.com/static/js/contentslider.js 
* http://media.buffalo.com/static/js/isearch.js 
* http://home.buffalo.com/static/videoassets/swfobject.js 
* http://media.buffalo.com/static/js/basiccalendar.js 
* http://www.buffalo.com/discover2008/componentAssets/js/PubComponent.js 
*
*/

function $(id) {
	return document.getElementById(id);
}

function changeOne(s)
{
$(s).style.fontWeight="bold";
$("two").style.fontWeight="normal";
$("three").style.fontWeight="normal";
$("four").style.fontWeight="normal";
$("five").style.fontWeight="normal";
$("six").style.fontWeight="normal";
document.pdForm.aff.value="";
}
function changeTwo(s)
{
$(s).style.fontWeight="bold";
$("one").style.fontWeight="normal";
$("three").style.fontWeight="normal";
$("four").style.fontWeight="normal";
$("five").style.fontWeight="normal";
$("six").style.fontWeight="normal";
document.pdForm.aff.value="1";
}
function changeThree(s)
{
$(s).style.fontWeight="bold";
$("one").style.fontWeight="normal";
$("two").style.fontWeight="normal";
$("four").style.fontWeight="normal";
$("five").style.fontWeight="normal";
$("six").style.fontWeight="normal";
document.pdForm.aff.value="8";
}
function changeFour(s)
{
$(s).style.fontWeight="bold";
$("one").style.fontWeight="normal";
$("two").style.fontWeight="normal";
$("three").style.fontWeight="normal";
$("five").style.fontWeight="normal";
$("six").style.fontWeight="normal";
document.pdForm.aff.value="3";
}
function changeFive(s)
{
$(s).style.fontWeight="bold";
$("one").style.fontWeight="normal";
$("two").style.fontWeight="normal";
$("three").style.fontWeight="normal";
$("four").style.fontWeight="normal";
$("six").style.fontWeight="normal";
document.pdForm.aff.value="9";
}
function changeSix(s)
{
$(s).style.fontWeight="bold";
$("one").style.fontWeight="normal";
$("two").style.fontWeight="normal";
$("three").style.fontWeight="normal";
$("four").style.fontWeight="normal";
$("five").style.fontWeight="normal";
document.pdForm.aff.value="2";
}
function selectmenu(option){
var tabs=new Array("hot","calendar","tv","movies");
var option_info;
var query;
var query_value;
var previous_query;
var previous_query_value;
for(var i=0;i<tabs.length;i++){
$(tabs[i]).className="searchTab";
option_info=tabs[i]+"_TAB";
$(option_info).className="off";
}
$(option).className="searchTab activeTab";
option_info=option+"_TAB";
$(option_info).className="on";
}
function spottedmenu(option){
var tabs=new Array("featured","upload","galleries","help");
var option_info;
var query;
var query_value;
var previous_query;
var previous_query_value;
for(var i=0;i<tabs.length;i++){
$(tabs[i]).className="searchTab";
option_info=tabs[i]+"_TAB";
$(option_info).className="off";
}
$(option).className="searchTab activeTab";
option_info=option+"_TAB";
$(option_info).className="on";
}
function yourhubmenu(option){
var tabs=new Array("stories","blogs","events");
var option_info;
var query;
var query_value;
var previous_query;
var previous_query_value;
for(var i=0;i<tabs.length;i++){
$(tabs[i]).className="searchTab";
option_info=tabs[i]+"_TAB";
$(option_info).className="off";
}
$(option).className="searchTab activeTab";
option_info=option+"_TAB";
$(option_info).className="on";
}
function blogsmenu(option){
var tabs=new Array("newsb","yourb","buffalob");
var option_info;
var query;
var query_value;
var previous_query;
var previous_query_value;
for(var i=0;i<tabs.length;i++){
$(tabs[i]).className="searchTab";
option_info=tabs[i]+"_TAB";
$(option_info).className="off";
}
$(option).className="searchTab activeTab";
option_info=option+"_TAB";
$(option_info).className="on";
}
var csbustcachevar=0
var csloadstatustext="<img src='loading.gif' /> Requesting content..."
var csexternalfiles=[]
var enablepersist=true
var slidernodes=new Object()
var csloadedobjects=""
function ContentSlider(sliderid,autorun,customPaginateText,customNextText){
var slider=$(sliderid)
if(typeof customPaginateText!="undefined"&&customPaginateText!="")
slider.paginateText=customPaginateText
if(typeof customNextText!="undefined"&&customNextText!="")
slider.nextText=customNextText
slidernodes[sliderid]=[]
ContentSlider.loadobjects(csexternalfiles)
var alldivs=slider.getElementsByTagName("div")
for(var i=0;i<alldivs.length;i++){
if(alldivs[i].className=="contentdiv"){
slidernodes[sliderid].push(alldivs[i])
if(typeof alldivs[i].getAttribute("rel")=="string")
ContentSlider.ajaxpage(alldivs[i].getAttribute("rel"),alldivs[i])
}
}
ContentSlider.buildpagination(sliderid)
var loadfirstcontent=true
if(enablepersist&&getCookie(sliderid)!=""){
var cookieval=getCookie(sliderid).split(":")
if($(cookieval[0])!=null&&typeof slidernodes[sliderid][cookieval[1]]!="undefined"){
ContentSlider.turnpage(cookieval[0],parseInt(cookieval[1]))
loadfirstcontent=false
}
}
if(loadfirstcontent==true)
ContentSlider.turnpage(sliderid,0)
if(typeof autorun=="number"&&autorun>0)
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid,autorun)},autorun)
}
ContentSlider.buildpagination=function(sliderid){
var slider=$(sliderid)
var paginatediv=$("paginate-"+sliderid)
var pcontent=""
for(var i=0;i<slidernodes[sliderid].length;i++)
pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+(slider.paginateText?slider.paginateText[i]:i+1)+'</a> '
pcontent+='<a href="#" style="font-weight: bold;" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">'+(slider.nextText||"Next")+'</a>'
paginatediv.innerHTML=pcontent
paginatediv.onclick=function(){
if(typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}
}
ContentSlider.turnpage=function(sliderid,thepage){
var paginatelinks=$("paginate-"+sliderid).getElementsByTagName("a")
for(var i=0;i<slidernodes[sliderid].length;i++){
paginatelinks[i].className=""
slidernodes[sliderid][i].style.display="none"
}
paginatelinks[thepage].className="selected"
slidernodes[sliderid][thepage].style.display="block"
paginatelinks[paginatelinks.length-1].setAttribute("rel",thenextpage=(thepage<paginatelinks.length-2)?thepage+1:0)
if(enablepersist)
setCookie(sliderid,sliderid+":"+thepage)
}
ContentSlider.autoturnpage=function(sliderid,autorunperiod){
var paginatelinks=$("paginate-"+sliderid).getElementsByTagName("a")
var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel"))
ContentSlider.turnpage(sliderid,nextpagenumber)
window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid,autorunperiod)},autorunperiod)
}
function getCookie(Name){
var re=new RegExp(Name+"=[^;]+","i");
if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return""
}
function setCookie(name,value){
document.cookie=name+"="+value
}
ContentSlider.ajaxpage=function(url,thediv){
var page_request=false
var bustcacheparameter=""
if(window.XMLHttpRequest)
page_request=new XMLHttpRequest()
else if(window.ActiveXObject){
try{
page_request=new ActiveXObject("Msxml2.XMLHTTP")
}
catch(e){
try{
page_request=new ActiveXObject("Microsoft.XMLHTTP")
}
catch(e){}
}
}
else
return false
thediv.innerHTML=csloadstatustext
page_request.onreadystatechange=function(){
ContentSlider.loadpage(page_request,thediv)
}
if(csbustcachevar)
bustcacheparameter=(url.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime()
page_request.open('GET',url+bustcacheparameter,true)
page_request.send(null)
}
ContentSlider.loadpage=function(page_request,thediv){
if(page_request.readyState==4&&(page_request.status==200||window.location.href.indexOf("http")==-1))
thediv.innerHTML=page_request.responseText
}
ContentSlider.loadobjects=function(externalfiles){
for(var i=0;i<externalfiles.length;i++){
var file=externalfiles[i]
var fileref=""
if(csloadedobjects.indexOf(file)==-1){
if(file.indexOf(".js")!=-1){
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src",file);
}
else if(file.indexOf(".css")!=-1){
fileref=document.createElement("link")
fileref.setAttribute("rel","stylesheet");
fileref.setAttribute("type","text/css");
fileref.setAttribute("href",file);
}
}
if(fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
csloadedobjects+=file+" "
}
}
}
var SEARCHBAR={
formName:"iSearch",
chkBoxsName:"fl",
defaultText:"-- search --",
srcFldId:"searchfield",
srcFldObj:null,
init:function(){
this.schFldObj=$(this.srcFldId);
this.schFldObj.value=this.defaultText;
},
focusSearch:function(){
if(this.schFldObj.value==this.defaultText){
this.schFldObj.value="";
}
},
submit:function(){
var s=false;
var fl="";
var obj=document.forms[this.formName][this.chkBoxsName];
for(var i=0;i<obj.length;i++){
if(obj[i].checked){
s=true;
fl+=obj[i].value;
if(i!=obj.length-1){
fl+=",";
}
}
}
if($(this.srcFldId).value==this.defaultText||
$(this.srcFldId).value==""){
alert("Please enter a search term.");
}else if(s==false){
alert("Please select at least one site to search.");
}else if(s==true){
top.location.href=document.forms[this.formName].action+
"?aff=&keywords="+$(this.srcFldId).value+
"&fl="+fl.toUpperCase();
}
return false;
}
}
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!$){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?$(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!$&&document.all){$=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
var themonths=['January','February','March','April','May','June','July','August','September','October','November','December']
var todaydate=new Date()
var curmonth=todaydate.getMonth()+1;
var curyear=todaydate.getFullYear();
var eventAff=9;
function getURLParam(strParamName){
var strReturn="";
var strHref=window.location.href;
if(strHref.indexOf("?")>-1){
var strQueryString=strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString=strQueryString.split("&");
for(var iParam=0;iParam<aQueryString.length;iParam++){
if(aQueryString[iParam].indexOf(strParamName+"=")>-1){
var aParam=aQueryString[iParam].split("=");
strReturn=aParam[1];
break;
}
}
}
return strReturn;
}
var selectedDate=new String();
var tempArray=[];
var thismonth=todaydate.getMonth()+1;
selectedDate=getURLParam("date");
tempArray=selectedDate.split("/");
if(tempArray.length==3){
var selectedDay=tempArray[1];
selected_month=tempArray[0];
selected_year=tempArray[2];
}else{
var selected_year=curyear;
var selected_month=curmonth;
}
function buildCal(m,y,cM,cH,cDW,cD,brdr,eventAff){
var mn=['Jan','Feb','March','April','May','June','July','Aug','Sept','Oct','Nov','Dec'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
var date;
var count=1;
var oD=new Date(y,m-1,1);
oD.od=oD.getDay()+1;
var todaydate=new Date();
var scanfortoday=(y==todaydate.getFullYear()&&m==todaydate.getMonth()+1)?todaydate.getDate():0;
dim[1]=(((oD.getFullYear()%100!==0)&&(oD.getFullYear()%4===0))||(oD.getFullYear()%400===0))?29:28;
var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center" style="width:100%; border-bottom: 1px solid black;">';
t+='<td colspan="1" align="center" class="'+cH+' month_colors">';
if(m==thismonth){
t+='';
}else{t+='<span class="month_colors"><a href="javascript:void(0);" onClick="skip(\'-\',\''+eventAff+'\');">&lt;</a></span>';}
t+='<td colspan="5" align="center" class="'+cH+' month_colors">'+mn[m-1]+' '+y+'</td>';
t+='<td colspan="1" align="center" class="'+cH+' month_colors"><span class="month_colors">&nbsp;</td></tr><tr align="center">';
for(var s=0;s<7;s++){
t+='<td class="'+cDW+' daysofweek_colors"';
if(s==6){
t+='style="border-right-width: 0px;"';
}
t+='>'+"SMTWTFS".substr(s,1)+'</td>';
}
t+='</tr><tr align="center" valign="top">';
for(var i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))?i-oD.od+1:'&nbsp;';
date=x;
if(x=='&nbsp;'){
if((count==1)||(count==7)){
t+='<td class="weekends weekends_colors">'+x+'</td>';
}else{
t+='<td class="'+cD+' days_colors">'+x+'</td>';
}
}
else{
if(x==scanfortoday){
x='<span class="today today_colors">'+x+'</span>';
}
if(x==selectedDay&&selected_month==thismonth+1){
if((count==1)||(count==7)){
x='<span class="selected_day today_colors">'+x+'</span>';
}else{
x='<span class="selected_day today_colors">'+x+'</span>';
}
}
if(x<scanfortoday){
if((count==1)||(count==7)){
t+='<td class="weekends weekends_colors">'+x+'</td>';
}else{
t+='<td class="'+cD+' days_colors">'+x+'</td>';
}
}else{
if((count==1)||(count==7)){
t+='<td class="weekends weekends_colors"><a href="http://buffalo.planetdiscover.com/sp?cal=true&aff='+eventAff+'&date='+m+'/'+date+'/'+y+'&keywords='+m+'/'+date+'/'+y+'">'+x+'</a></td>';
}else{
t+='<td class="'+cD+' days_colors"><a href="http://buffalo.planetdiscover.com/sp?cal=true&aff='+eventAff+'&date='+m+'/'+date+'/'+y+'&keywords='+m+'/'+date+'/'+y+'">'+x+'</a></td>';
}
}
}
count++;
if(((i)%7===0)&&(i<36)){
t+='</tr><tr align="center">';
count=1;
}
}
t+='</tr></table></div>';
return t;
}
function updatecalendar(theselection,eventAff){
var themonth=parseInt(theselection[theselection.selectedIndex].value,10)+1;
var calendarstr=buildCal(themonth,curyear,"calendar","month","daysofweek","days",0,eventAff);
if($){
$("calendar").innerHTML=calendarstr;
}
}
function skip(Direction,eventAff){
if(Direction=='+'){
if(selected_month==12){
selected_month=1;
selected_year++;
}
else{
selected_month++;
}
}
else{
if(selected_month==1){
selected_month=12;
selected_year--;
}
else{
selected_month--;
}
}
var calendarstr=buildCal(selected_month,selected_year,"calendar","month","daysofweek","days",0,eventAff);
if($){
$("calendar").innerHTML=calendarstr;
}
}
function PubComponent(wrapperId,tabId,slideClass)
{
this.wrapperId=wrapperId;
this.tabId=tabId;
this.slideClass=slideClass;
this.slides=null;
this.divs=null;
this.navLinks=null;
this.init=function(tabNum)
{
divs=$(wrapperId).getElementsByTagName("div");
navLinks=$(tabId).getElementsByTagName("a");
slides=new Array();
for(var i=0;i<divs.length;i++)
{
if(divs[i].className==slideClass)
{
slides.push(divs[i]);
}
}
for(var i=0;i<$(tabId).getElementsByTagName("a").length;i++)
{
this.addEvent($(tabId).getElementsByTagName("a")[i],"mouseup",this.showSlide,false)
}
if(tabNum)
this.clickTab(tabNum);
}
this.clickTab=function(num){
fireEvent($(this.tabId).getElementsByTagName("a")[num-1],"mouseup");
}
this.showSlide=function(e)
{
for(var i=0;i<navLinks.length;i++)
{
navLinks[i].className="";
}
if(e.srcElement)
e.srcElement.className="active";
else if(e.target)
e.target.className="active";
for(var i=0;i<navLinks.length;i++)
{
if(navLinks[i].className=="active")
{
for(var j=0;j<slides.length;j++)
{
slides[j].style.display="none";
}
slides[i].style.display="block"
}
}
}
this.addEvent=function(obj,evType,fn,useCapture)
{
if(obj.addEventListener)
{
obj.addEventListener(evType,fn,useCapture);
return true;
}else if(obj.attachEvent)
{
var r=obj.attachEvent("on"+evType,fn);
return r;
}else
{
alert("Handler could not be attached");
}
}
function fireEvent(obj,evt){
var fireOnThis=obj;
if(document.createEvent)
{
var evObj=document.createEvent("MouseEvents");
evObj.initEvent(evt,true,false);
fireOnThis.dispatchEvent(evObj);
}else if(document.createEventObject)
{
fireOnThis.fireEvent("on"+evt);
}
}
}
