/*
  ------------------------------------------------
  PVII Equal CSS Columns scripts -Version 2
  Copyright (c) 2005 Project Seven Development
  www.projectseven.com
  Version: 2.1.0
  ------------------------------------------------
*/
function P7_colH3()
{	 //v1.0.0 by whirl developed for whirl wordpress template equal content.
	// SideMenu contains div7eq1 DIV
	// Sidebar contains div7eq2 DIV
	// Content contains div7eq3 DIV

	// Get the containers' height.
	var divSideMenuHeight = Number(document.getElementById('sidemenu').offsetHeight);
	var divContentHeight = Number(document.getElementById('content').offsetHeight);
	var divSidebarHeight = Number(document.getElementById('sidebar').offsetHeight)-242;
	//alert(divSideMenuHeight+", "+divContentHeight+", "+divSidebarHeight);
	var diff1 = 0;
	var diff2 = 0;
	//check browser version
	var browser = 'MSIE 6.0';
	var ie6 = strpos(navigator.appVersion, browser, 0);
	//alert(ie6);
	if(ie6 != false){
		//Select the highest container and set the DIVs' padding-bottom style propeties.
		if(divSideMenuHeight >= (divContentHeight && divSidebarHeight))
		{
			divSideMenuHeight += 50;
			diff1 = divSideMenuHeight - divContentHeight;
			diff2 = divSideMenuHeight - divSidebarHeight;
			//alert(diff1+" divSideMenuHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = 50 +"px";
			document.getElementById('p7eq2').style.paddingBottom = diff2+"px";
			document.getElementById('p7eq3').style.paddingBottom = diff1+"px";
		}
		if(divContentHeight >= (divSideMenuHeight && divSidebarHeight))
		{

			diff1 = divContentHeight - divSideMenuHeight;
			diff2 = divContentHeight - divSidebarHeight;
			//alert(diff1+" divContentHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = diff1+10+"px";
			document.getElementById('p7eq2').style.paddingBottom = diff2+10+"px";
			document.getElementById('p7eq3').style.paddingBottom = 0+"px";
		}
		if(divSidebarHeight >= (divSideMenuHeight && divContentHeight))
		{
			diff1 = divSidebarHeight - divSideMenuHeight;
			diff2 = divSidebarHeight - divContentHeight;
			//alert(diff1+" divSidebarHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = diff1+"px";
			document.getElementById('p7eq2').style.paddingBottom = 0+"px";
			document.getElementById('p7eq3').style.paddingBottom = diff2-10+"px";
		}
	}
	else
	{
		if(divSideMenuHeight >= (divContentHeight && divSidebarHeight))
		{
			divSideMenuHeight += 480;
			diff1 = divSideMenuHeight - divContentHeight;
			diff2 = divSideMenuHeight - divSidebarHeight;
			//alert(diff1+" divSideMenuHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = 0+"px";
			document.getElementById('p7eq2').style.paddingBottom = diff2+"px";
			document.getElementById('p7eq3').style.paddingBottom = diff1+"px";
		}
		if(divContentHeight >= (divSideMenuHeight && divSidebarHeight))
		{
			var a = divContentHeight;
			if((divContentHeight - divSideMenuHeight)<480)
			{
				divContentHeight = divContentHeight + (480- (divContentHeight - divSideMenuHeight));
			}
			a = divContentHeight - a;
			diff1 = divContentHeight - divSideMenuHeight;
			diff2 = divContentHeight - divSidebarHeight;
			//alert(diff1+" divContentHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = diff1+10+"px";
			document.getElementById('p7eq2').style.paddingBottom = diff2+10+"px";
			document.getElementById('p7eq3').style.paddingBottom = a +"px";
		}
		if(divSidebarHeight >= (divSideMenuHeight && divContentHeight))
		{
			var a = divSidebarHeight;
			if((divSidebarHeight - divSideMenuHeight)<480)
			{
				divSidebarHeight = divSidebarHeight + (480 - (divSidebarHeight - divSideMenuHeight));
			}
			a = divSidebarHeight - a;
			diff1 = divSidebarHeight - divSideMenuHeight;
			diff2 = divSidebarHeight - divContentHeight;
			//alert(diff1+" divSidebarHeight "+diff2);
			document.getElementById('p7eq1').style.paddingBottom = diff1+"px";
			document.getElementById('p7eq2').style.paddingBottom = a+"px";
			document.getElementById('p7eq3').style.paddingBottom = diff2-10+"px";
		}
	}

	document.p7eqa=1;
	document.p7eqth=document.body.offsetHeight;
	document.p7eqtw=document.body.offsetWidth;
}


function P7_eqT2()
{ //v2.1.0 by PVII-www.projectseven.com
	if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth)
	{
		P7_colH3();
	}
}

function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com
	 var c,e,el;
	 if(document.getElementById)
	 {
	 	document.p7eqc=new Array();
	 	document.p7eqc[0]=arguments[0];
	 	for(i=1;i<arguments.length;i+=2)
	 	{
	 		el=null;
	 		c=document.getElementById(arguments[i]);
	 		if(c)
	 		{
	 			e=c.getElementsByTagName(arguments[i+1]);
	 			if(e)
	 			{
	 				el=e[e.length-1];
	 				if(!el.id){
	 					el.id="p7eq"+i;
	 				}
	 			}
	 		}
	 		if(c&&el)
	 		{
	 			document.p7eqc[document.p7eqc.length]=c;
	 			document.p7eqc[document.p7eqc.length]=el
	 		}
	 	}
	 	setInterval("P7_eqT2()",10);}
}

function P7_eqA2(el,p,pt)
{ //v2.1.0 by PVII-www.projectseven.com
	var sp=10,inc=20,g=document.getElementById(el);
	np=(p>=pt)?pt:p;
	g.style.paddingBottom=np+"px";
	if(np<pt)
	{
		np+=inc;
		setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);
	}
}

function strpos (haystack, needle, offset) {
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}



