
function tp_edge( obj ) {
	_gaq.push(['_trackEvent','edge_plusone',obj.state]);
}

//different code for STAGE and PROD
var stage = false;

if (document.location.href.search('gipcms.bpweb.bp.com') != -1) {
	stage = true;
}

function init() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	// do your thing
	
	//--> GET all divs
	var allDivs=document.getElementsByTagName("div");
	
	//--> GET right nav div
	var rightDiv = document.getElementById('pnavOuterContainer').parentNode;
	rightDiv.style.display="none";
	
	if(stage){
		//-->test it on stage first
		for(i=0;i<allDivs.length;i++){
			if(allDivs[i].className == 'mContainer'){
				allDivs[i].style.padding='0px';
				allDivs[i].style.margin='0px';
				allDivs[i].style.width='570px';
				allDivs[i].style.height='1110px';
				allDivs[i].style.float='left';
				allDivs[i].style.overflow='hidden';
				allDivs[i].innerHTML = '';
				allDivs[i].innerHTML = "<iframe src='http://www.castrolsyntec.com/edge/edge2.htm' width='570' scrolling='no' frameborder='0' height='1100' style='margin-left:-10px'></iframe>";
			}
		}
	}else{
		//-->if it works on stage copypasta to prod
		for(i=0;i<allDivs.length;i++){
			if(allDivs[i].className == 'mContainer'){
				allDivs[i].style.padding='0px';
				allDivs[i].style.margin='0px';
				allDivs[i].style.width='570px';
				allDivs[i].style.height='1110px';
				allDivs[i].style.float='left';
				allDivs[i].style.overflow='hidden';
				allDivs[i].innerHTML = '';
				allDivs[i].innerHTML = "<iframe src='http://www.castrolsyntec.com/edge/edge2.htm' width='570' scrolling='no' frameborder='0' height='1100' style='margin-left:-10px'></iframe>";
			}
		}
	}
}

if (document.addEventListener) {
	document.addEventListener('DOMContentLoaded', init, false);
}

(function() {
	/*@cc_on
	try {
		document.body.doScroll('up');
		return init();
	} catch(e) {}
	/*@if (false) @*/
	if (/loaded|complete/.test(document.readyState)) return init();
	/*@end @*/
	if (!init.done) setTimeout(arguments.callee, 30);
})();

if (window.addEventListener) {
	window.addEventListener('load', init, false);
} else if (window.attachEvent) {
	window.attachEvent('onload', init);
}

