//javascript file
/*******************************************************************************************************|
|																										|
|	Made by Juhani																						|
|	- Made because in IE hr-elements doesn't always work the way how you would like 					|
|	- Changes all hr-elements to divs with class="hr", copies all manually set styles to element		|
|	- Put the changeHRtoDIV() to the last thing of body element to get this work best					|
|																										|
|	- Last make your own hr class for example:															|
|		.hr{																							|
|			display:block;  					# this one is important 						#		|
|			height:1px;							# must have height otherwise nothing is shown 	#		|
|			width:100%;							# this makes it act like normal hr 				#		|
|			background:url("hr.png") repeat-x;	# background image or color what ever you like 	#		|
|		}																								|
|																										|
********************************************************************************************************/

var divClassName = "hr"; 	// if you want use another class name change this

//-----------------------------------------------------------------------------------------------------//
function changeHRtoDIV()
{
	if(!document.getElementsByTagName('hr')) return;
	var newDiv, oldHr=document.getElementsByTagName('hr');
	while(oldHr.length)
	{
		newDiv = document.createElement('div');
		newDiv.className = divClassName;
		var takeStyles;
		if(takeStyles=getStyle(oldHr[0]))	
			setStyle(newDiv, takeStyles);
		oldHr[0].parentNode.replaceChild(newDiv,oldHr[0]);
	}
}
function setStyle(element, styleText){
	if(element.style.setAttribute) element.style.setAttribute("cssText", styleText );
	else element.setAttribute("style", styleText );
}
function getStyle(element){
	if(element.getAttribute('style'))
	{
		var styleText = element.getAttribute('style');
		if(styleText==null) return "";
		if (typeof styleText == 'string') return styleText; // !IE
		else return styleText.cssText;  // IE
	}
	return false;
}
