function InsertHeader(customhdrflag,sizemode,headerwidth, headerheight,bgcolor,seperatorcolor,menucolor,logourl, seperatorheight, autofit, l1url, l1title,l2url, l2title,l3url, l3title,l4url, l4title,l5url, l5title,l6url, l6title,enablehdrbgcolor) {
	if (!customhdrflag) {
		if (sizemode == "pixels") {
			localheaderwidth = headerwidth+"px";
			}
		else {		
			localheaderwidth = headerwidth+"%";

			}
		if (enablehdrbgcolor) hdrbgcolor = 'bgcolor="'+bgcolor+'"';
		else hdrbgcolor="";
		
		document.write('<table align="center" width="'+localheaderwidth+'" height="'+headerheight+'"'+hdrbgcolor+'" style="border-bottom:'+seperatorheight+' solid '+seperatorcolor+';" ID="table1">');
		document.write('<tr> ');
		if (logourl!= "") {
				document.write('<td align="left" width="110" >');
				document.write('	<div id="sitename"><img src="'+logourl+'" border="0"></div>'); 
				document.write('</td>');
	  }
		document.write('<td>');
		document.write('	<table align="center" ID="table2">');
		document.write('		<tr>		');
		if (l1title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l1url+'" title="'+l1title+'"><b>'+l1title+'</b></a></td>');
		if (l2title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l2url+'" title="'+l2title+'"><b>'+l2title+'</b></a></td>');
		if (l3title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l3url+'" title="'+l3title+'"><b>'+l3title+'</b></a></td>');
		if (l4title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l4url+'" title="'+l4title+'"><b>'+l4title+'</b></a></td>');
		if (l5title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l5url+'" title="'+l5title+'"><b>'+l5title+'</b></a></td>');
		if (l6title!= "") document.write('			<td width="80"><a id="headerlinks" style="color:'+menucolor+';" href="'+l6url+'" title="'+l6title+'"><b>'+l6title+'</b></a></td>');
		document.write('		</tr>');
		document.write('	</table>');	
		document.write('</td>');
		document.write('</tr></table>');
	}

	if (autofit == "Y") {
		window.onresize = resizeContent;
		window.onload = resizeContent;	
	}

}

function resizeContent() {
		var contentHeight = window.innerHeight ;
		if (contentHeight == undefined || contentHeight == 0) contentHeight = document.documentElement.clientHeight;
    if (contentHeight == 0) contentHeight = document.body.clientHeight; 
    var content = document.getElementById('content'); 
    contentHeight -= content.offsetTop;
    
    var flashcontent = document.getElementById('flash'); 
    var flashfooter  = document.getElementById('footer');
    
    if (cartenabled==true && contentHeight < 600) contentHeight=600;
	  if (flashfooter!=null) contentHeight -= footerheight;
    if (content.style.height != undefined && contentHeight >" ") content.style.height = contentHeight +"px";
    if (flashcontent != null && flashcontent.style.height != undefined && contentHeight >" ") flashcontent.style.height = contentHeight +"px";
 		
};


