function addEvent(obj, evType, fn){
  /* adds an eventListener for browsers which support it
     Written by Scott Andrew: nice one, Scott */
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
	return false;
  }
}

function toggleMenu(id) {
	if(!window.document.getElementById) {
		return;
	}
	
	var display = window.document.getElementById(id).style.display;
	
	if(display == "none") {
		display = "block";
	} else {
		display = "none";
	}
	
	window.document.getElementById(id).style.display = display;
}

function popitup(url) {
		newwindow=window.open(url,'name','height=550,width=620, resizable=yes, scrollbars=yes');
		if (window.focus) {newwindow.focus()}
}

/*
//With Background Color on Div
function toggleMenu(id) {
	if(!window.document.getElementById) {
		return;
	}
	
	var display = window.document.getElementById(id).style.display;
	
	if(display == "none") {
		display = "block";
		
		document.getElementById("searchBox").style.background = "#d6d9c6";
		document.getElementById("searchBox").style.padding = "10px 10px 4px 10px";
		document.getElementById("searchItem").style.background = "#d6d9c6";
		document.getElementById("searchItem").style.padding = "0px 4px 3px 4px";
		document.getElementById("searchItem").style.color = "#ffffff";
		document.getElementById("searchItem").style.textDecoration = "none";
	} else {
		display = "none";
		document.getElementById("searchItem").style.background = "none";
		document.getElementById("searchItem").style.padding = "0px";
		document.getElementById("searchItem").style.color = "#7f7e7b";
		document.getElementById("searchItem").style.textDecoration = "underline";
	}
	
	window.document.getElementById(id).style.display = display;
}*/

function faq() {
	if($('accordionDiv')) {
		$('accordionDiv').style.display='';
		var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
		var toggles = document.getElementsByClassName('display'); //h3s where I click on

		//accordion effect
		var myAccordion = new fx.Accordion(toggles, stretchers, {opacity: true, duration: 400}
		);
	}
}

function slideshow() {
	var slideshow = new SWFObject("/flash/banner.swf", "slideshow", "827", "206", "8", "d6d9c6");
	slideshow.write("slideshow");
}

function sifr() {
	
	sIFR.prefetch({ src: '/flash/trajan.swf' });
	sIFR.compatMode = true;
	sIFR.activate();	
	sIFR.initialize();	
	sIFR.replace({ selector: 'h1', src: '/flash/trajan.swf', css:{'.sIFR-root':{ 'color': '#4b4a4a', 'leading': -4, 'background-color': '#fafaf1', 'font-weight': 'bold' }}});
	
	sIFR.prefetch({ src: '/flash/trajan.swf' });
	sIFR.compatMode = true;
	sIFR.activate();	
	sIFR.initialize();	
	sIFR.fitExactly = true;
	sIFR.replace({ 
		selector: 'h2, h4', 
		src: '/flash/trajan.swf', 
		css:{'.sIFR-root':{ 'color': '#4b4a4a', 'leading': -4, 'background-color': '#fafaf1', 'font-weight': 'bold' }},
		wmode: "transparent"
		
	});
	
	sIFR.prefetch({ src: '/flash/trajan.swf' });
	sIFR.compatMode = true;
	sIFR.activate();	
	sIFR.initialize();	
	sIFR.fitExactly = true;
	sIFR.replace({ 
		selector: 'h6', 
		src: '/flash/trajan.swf', 
		css:{'.sIFR-root':{ 'color': '#d65710', 'leading': -4, 'background-color': '#fafaf1', 'font-weight': 'bold' }},
		wmode: "transparent"
		
	});
}

addEvent(window, "load", sifr);