// powerworx newsscope
// copyright 2009 by IIr Associates
// http://iirassoc.com
// tjallen

//initialize
var mynewsscope = "";

function buildnewsscope(){
//define three wordboxes
wordbox1 = "<span style='font-size:20px;line-height:28px;'>Clean Power!<br /></span>";
wordbox1 += "- Use fewer kW<br />";
wordbox1 += "- More efficient<br />";
wordbox1 += "- Motors run cooler<br />";
wordbox1 += "- Less line noise<br />";
wordbox1 += "- Less static<br />";
wordbox1 += "- Less interference<br />";
wordbox1 += "- Safe!<br />";
wordbox1 += "- Guaranteed.";

wordbox2 = "<span style='font-size:20px;line-height:28px;'>Protection!<br /></span>";
wordbox2 += "- Surges suppressed<br />";
wordbox2 += "- Lightning arrested<br />";
wordbox2 += "- Line noise quieted<br />";
wordbox2 += "- Phase corrected<br />";
wordbox2 += "- Power factor raised<br />";
wordbox2 += "- Interference cut<br />";
wordbox2 += "- Safe!<br />";
wordbox2 += "- Guaranteed.";

wordbox3 = "<span style='font-size:20px;line-height:28px;'>Save Money!<br /></span>";
wordbox3 += "- Use fewer kW<br />";
wordbox3 += "- Protects electronics<br />";
wordbox3 += "- Protects appliances<br />";
wordbox3 += "- Pays off faster<br />";
wordbox3 += "&nbsp;&nbsp;&nbsp;than solar<br />";
wordbox3 += "- Greener!<br />";
wordbox3 += "- Safe!<br />";
wordbox3 += "- Guaranteed.";

//re-initialize
mynewsscope="";

//stylesheet
mynewsscope += "<style>\n";
mynewsscope += "#lowerbox A:link {color:#FFF200;text-decoration:none;}\n";
mynewsscope += "#lowerbox A:visited {color:#FFF200;text-decoration:none;}\n";
mynewsscope += "#lowerbox A:active {color:#FFF200;text-decoration:none;}\n";
mynewsscope += "#lowerbox A:hover {color:#FFF200;text-decoration:underline;}\n";
mynewsscope += "</style>\n";

//begin main container
mynewsscope += "<div id='newsscope_container' style='width:655px;margin:0px auto 0px auto;font-family:arial,sans-serif;position:relative;'>\n";

mynewsscope += "<div id='upperbox' style='background-color:#00A651;padding-top:10px;padding-bottom:10px;'>\n";	// upper box
	mynewsscope += "<div id='upperrightbox' style='background-color:#C4DF9B;margin:0px 10px 0px 0px;width:390px;height:67px;float:right;'>\n";	// upper right box
		mynewsscope += "<div style='color:#00A651;font-size:16px;font-weight:bold;margin:5px 5px 0px 5px;text-align:left;'>";
		mynewsscope += "Clean your power.";
		mynewsscope += "</div>\n";	// end of upper right inner box 1
		mynewsscope += "<div style='color:#00A651;font-size:16px;font-weight:bold;margin:0px 5px 0px 5px;text-align:center;'>";
		mynewsscope += "Protect your electronics.";
		mynewsscope += "</div>\n";	// end of upper right inner box 2
		mynewsscope += "<div style='color:#00A651;font-size:16px;font-weight:bold;margin:0px 5px 5px 5px;text-align:right;'>";
		mynewsscope += "Lower your electric bills.";
		mynewsscope += "</div>\n";	// end of upper right inner box 3
	mynewsscope += "</div>\n";	// end of upper right box

	mynewsscope += "<div id='upperleftbox' style='float:left;margin:0px 0px 0px 10px;width:234px;height:67px;background-color:#39B54A;'>\n";	// upper left box
		mynewsscope += "<img src='http://iirassoc.biz/powerworx/powerworx_logo.gif' width='234' height='60' alt='powerworx' border='0' />\n";
	mynewsscope += "</div>\n";	// end of upper left box

	mynewsscope += "<div style='clear:both;margin:0;padding:0;'></div>\n";
mynewsscope += "</div>\n";	// end of upper box

mynewsscope += "<div id='midbox' style='background-color:#C4DF9B;padding-top:10px;padding-bottom:10px;height:250px;'>\n";	// mid box
	
	mynewsscope += "<div id='midinnerbox1' style='width:310px;margin:0px 10px 0px 10px;height:230px;background-color:#b4b4b4;float:left;text-align:center;'>\n";
		mynewsscope += "<img name='rollimg' src='http://iirassoc.biz/powerworx/pw_graph.jpg' width='280' height='210' alt='' border='0' style='margin:10px auto 0px auto;' />";
	mynewsscope += "</div>\n";	// end of midinnerbox1
	
	mynewsscope += "<div id='midinnerbox2' style='width:160px;margin:0px;height:230px;background-color:#39B54A;float:left;'>\n";
		mynewsscope += "<div id='midinnerbox2a' style='margin:10px 0px 10px 10px;color:#FFFFFF;font-size:15px;font-weight:normal;line-height:21px;'>\n";
			mynewsscope += wordbox1;
		mynewsscope += "</div>\n";	// end of midinnerbox2a
	mynewsscope += "</div>\n";	// end of midinnerbox2
	
	mynewsscope += "<div id='preloadzone' style='width:100px;margin:0px;height:230px;background-color:#C4DF9B;float:right;'>\n";
		mynewsscope += "<div id='preloadzonea' style='margin-right:10px;'>\n";
			mynewsscope += "<img src='http://iirassoc.biz/powerworx/pw_lightning.jpg' width='10' height='10' alt='' border='0' /><br />\n";
			mynewsscope += "<img src='http://iirassoc.biz/powerworx/pw_money.jpg' width='10' height='10' alt='' border='0' /><br />\n";
		mynewsscope += "</div>\n";	// end of preloadzonea
	mynewsscope += "</div>\n";	// end of preloadzone
	
	mynewsscope += "<div style='clear:both;margin:0;padding:0;'></div>\n";
	
mynewsscope += "</div>\n";	// end of mid box

mynewsscope += "<div id='lowerbox' style='background-color:#005826;padding-top:10px;padding-bottom:10px;'>\n";	// lower box
	mynewsscope += "<div id='lowerinnerbox' style='margin:0px 10px 0px 10px;background-color:#39B54A;border:solid 1px #39B54A;'>\n";
		
		mynewsscope += "<div id='lowerinnerinnerboxright' style='float:right;margin:55px 0px 0px 0px;width:234px;'>\n";
		mynewsscope += "<img src='http://iirassoc.biz/powerworx/powerworx_logo.gif' width='234' height='60' alt='powerworx' border='0' />";
		mynewsscope += "</div>\n";	// end of lowerinnerinnerboxright
		
		mynewsscope += "<div id='lowerinnerinnerboxleft' style='float:left;margin:10px 0px 10px 10px;width:350px;color:#FFF200;font-size:15px;font-weight:bold;line-height:25px;'>\n";
		mynewsscope += "Click these links to find out more...<br />";
		mynewsscope += "- <a href='http://proactive-info.com/contact_us.html'>Where can I get one?</a><br />";
		mynewsscope += "- <a href='http://proactive-info.com/resources/PowerWorx-HowItWorks.pdf'>How does it work?</a><br />";
		mynewsscope += "- <a href='http://proactive-info.com/resources/PowerWoRx-WhatIsIt.pdf'>How much can I save?</a>";
		mynewsscope += "</div>\n";	// end of lowerinnerinnerboxleft
	
		mynewsscope += "<div style='clear:both;'></div>\n";
	mynewsscope += "</div>\n";	// end of lowerinnerbox
mynewsscope += "</div>\n";	// end of lower box

mynewsscope += "<div id='posabs' style='position:absolute;right:10px;top:75px;z-index:25;'>\n";	// lower box
mynewsscope += "<img src='http://iirassoc.biz/powerworx/pwe3.gif' width='150' height='365' alt='Powerworx e3' border='0' />";
mynewsscope += "</div>\n";	// end of pos abs

mynewsscope += "</div>\n";	// end of main container
}

//set images for imageroll
roll = new Array()
roll[0]="http://iirassoc.biz/powerworx/pw_graph.jpg";
roll[1]="http://iirassoc.biz/powerworx/pw_lightning.jpg";
roll[2]="http://iirassoc.biz/powerworx/pw_money.jpg";

// writer function
function newsscopeWriter(){
document.write(mynewsscope);
}

// build and write the newsscope
buildnewsscope();
newsscopeWriter();

//---------------------------------------------------
// image roll copyright 2009 Thomas James Allen / iirassoc.com

//test for IE
var browsertype = "none"
if (navigator.appName == "Microsoft Internet Explorer"){
	browsertype = "IE"}else{}

//load the right filter for IE
function filtImg(){
if (browsertype=="IE"){
	rollimg.style.filter += "progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=6)";}else{}
}

//change the words in the wordbox
function wordSwitch(){
if (rollimgstatus == 0){document.getElementById("midinnerbox2a").innerHTML = wordbox1;}
if (rollimgstatus == 1){document.getElementById("midinnerbox2a").innerHTML = wordbox2;}
if (rollimgstatus == 2){document.getElementById("midinnerbox2a").innerHTML = wordbox3;}
}

//image roll starting places
var speed = 7000;
var rollimgstatus = 1;
var lastone =  roll.length-1;

//main function
function imageview(){

if(rollimgstatus > (lastone)){rollimgstatus = 0}

if (browsertype=="IE"){
	
	// ie - pixellate
	rollimg.filters[0].apply();
	document.images.rollimg.src = roll[rollimgstatus];
	rollimg.filters[0].play();
	
	wordSwitch();
	
	rollimgstatus = rollimgstatus + 1;
	
	}else{
	// all other browsers - javascript css opacity change
	timer1 = setTimeout('document.images.rollimg.style.opacity=.8;',1);
	timer2 = setTimeout('document.images.rollimg.style.opacity=.6;',100);
	timer3 = setTimeout('document.images.rollimg.style.opacity=.4;',200);
	timer4 = setTimeout('document.images.rollimg.style.opacity=.2;',300);
	timer5 = setTimeout('document.images.rollimg.style.opacity=0;',400);
	
	timer6 = setTimeout('document.images.rollimg.src = roll[rollimgstatus];',450);
	
	timer7a = setTimeout('wordSwitch();',460);
	
	timer7 = setTimeout('document.images.rollimg.style.opacity=.2;',500);
	timer8 = setTimeout('document.images.rollimg.style.opacity=.4;',600);
	timer9 = setTimeout('document.images.rollimg.style.opacity=.6;',700);
	timer10 = setTimeout('document.images.rollimg.style.opacity=.8;',800);
	timer11 = setTimeout('document.images.rollimg.style.opacity=1.0;',900);
	
	timer12 = setTimeout('rollimgstatus = rollimgstatus + 1;',1000);

}

myTimer2 = setTimeout("imageview()",speed);
}

// start the imageroll
myTimer2 = setTimeout('filtImg(); imageview()',5000);

// all done except the accounting


