/* a dom image rollover script is needed still */

//PUT YOUR EXTRAS HERE... CUT THEM FROM DW or IR GENERATED CODE AND PASTE HERE.

function openBrWindow(myURL,myName,myFeatures) { 
  window.open(myURL,myName,myFeatures);
}


 
 
 /* grab Elements from the DOM by className */
 
 function getElementsByClass(searchClass,node,tag) {
 
 	var classElements = new Array();
 
 	if ( node == null )
 
 		node = document;
 
 	if ( tag == null )
 
 		tag = '*';
 
 	var els = node.getElementsByTagName(tag);
 
 	var elsLen = els.length;
 
 	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
 
 	
 
 	//AAARGH ORROR i && j are defined global!!
 
 	//THIS SLOW DOWN the code and would cause weird behaviour !!(think in a Multithreading program!!)
 
 	
 
 	/*for (i = 0, j = 0; i < elsLen; i++) {
 
 		if ( pattern.test(els.className) ) {
 
 			classElements[j] = els;
 
 			j++;
 
 		}
 
 	}
 
 	*/
 
 	var i = 0;
 
 	var j = 0;
 
 	
 
 	do{
 
 	
 
 		if ( pattern.test(els.className) ) {
 
 			classElements[j] = els;
 
 			j++;
 
 		}
 
 		
 
 	}while(++i<elsLen)
 
 	
 
 	return classElements;
 
 }
 
 
 
 /* toggle an element's display */
 
 function toggle(obj) {
 
 	var el = document.getElementById(obj);
 
 	//alert(el);
 
 	if(el){
 
 		el=el.style;
 
 		//alert(']'+el+'[')
 
 //you would use switch for more optimization, but i think is ininfluent due to the shorten dom trick already used. <kenta>		
 
 		if ( el.display != 'none' ) {
 
 			//alert('ok');
 
 			el.display = 'none';
 
 		}
 
 		else {
 
 			el.display = '';
 
 		}
 
 	}
 
 }
 
 
 
 /* insert an element after a particular node */
 
 /*function insertAfter(parent, node, referenceNode) {
 
 	parent.insertBefore(node, referenceNode.nextSibling);
 
 }*/
 
 function insertAfter(parent, node, referenceNode){ 
 
 
 
 if(referenceNode.nextSibling)
 
 	{ 
 
 		parent.insertBefore(node, referenceNode.nextSibling); 
 
 	} 
 
 else 
 
 	{ 
 
 		parent.appendChild(node); 
 
 	} 
 
 }
 
 /*
 
 I prefer the following form ;) however this function throw an error when node.parentNode don't exist (eg.when you don't pass a DOM-Node ;)
 
 
 
 function insertAfter2(node, referenceNode){ 
 
 
 
 if(referenceNode.nextSibling)
 
 	{ 
 
 		referenceNode.parentNode.insertBefore(node, referenceNode.nextSibling); 
 
 	} 
 
 else 
 
 	{ 
 
 		referenceNode.parentNode.appendChild(node); 
 
 	} 
 
 }
 
 */
 
 /* Array prototype, matches value in array: returns bool */
 
 Array.prototype.inArray = function (value) {	
 
 
 
 	var i=this.length-1;
 
 	if(i>-1)
 
 		do
 
 		{
 
 			//alert('i'+i+')'+this)
 
 			if (this === value) {
 
 				return true;
 
 			}
 
 		}
 
 		while(--i>-1);		
 
 		
 
 	return false;
 
 };
 
 
 
 /* get, set, and delete cookies */
 
 function getCookie( name ) {
 
 	var cook=document.cookie
 
 	var start = cook.indexOf( name + "=" );
 
 	var len = start + name.length + 1;
 
 	if ( ( !start ) && ( name != cook.substring( 0, name.length ) ) ) {
 
 		return null;
 
 	}
 
 	if ( start == -1 ) return null;
 
 	var end = cook.indexOf( ";", len );
 
 	if ( end == -1 ) end = cook.length;
 
 	return unescape( cook.substring( len, end ) );
 
 }
 
 	
 
 function setCookie( name, value, expires, path, domain, secure ) {
 
 	var today = new Date();
 
 	today.setTime( today.getTime() );
 
 	if ( expires ) {
 
 		//expires = expires * 1000 * 60 * 60 * 24;
 
 		expires*=86400000;
 
 	}
 
 	var expires_date = new Date( today.getTime() + (expires) );
 
 	document.cookie = name+"="+escape( value ) +
 
 		( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
 
 		( ( path ) ? ";path=" + path : "" ) +
 
 		( ( domain ) ? ";domain=" + domain : "" ) +
 
 		( ( secure ) ? ";secure" : "" );
 
 }
 
 	
 
 function deleteCookie( name, path, domain ) {
 
 	if ( getCookie( name ) ) document.cookie = name + "=" +
 
 			( ( path ) ? ";path=" + path : "") +
 
 			( ( domain ) ? ";domain=" + domain : "" ) +
 
 			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
 
 }
 
 
 
 /* quick getElement reference */
 
 function $() {
 
 	var elements = new Array();
 
 	
 
 	var endloop=arguments.length;
 
 	var i=0;
 
 	
 
 	switch (endloop){
 
 	
 
 		case 0: return null;break;// this is just done in default branch but you wouldn't expected a empty array,so i leave it<kenta>
 
 		case 1: 
 
 		var element = arguments[0];
 
 		
 
 			if (typeof element == 'string')
 
 				return document.getElementById(element)
 
 			else return element;
 
 			
 
 		break;
 
 		default:
 
 		var element;
 
 			while(i<endloop)
 
 			{
 
 	
 
 				element = arguments;
 
 				if (typeof element == 'string')
 
 					element = document.getElementById(element);
 
 			
 
 				elements.push(element);
 
 				
 
 				++i;
 
 			}			
 
 		break;
 
 	}	
 
 	
 
 	return elements;
 
 }
