/**
 * NeroMorte Site Wide Script List
 * <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 */
/**
 * Bookmark this Page Script
 */  

function AddtoFavourites() {
var newT = document.createTextNode('Add to Favorites');
var s = document.getElementById('fav');
if (window.sidebar) {
s.appendChild(newT);
s.style.cursor = 'pointer';
s.onclick = function() {window.sidebar.addPanel(document.title,self.location,'')};
} else if (window.external) {
s.appendChild(newT);
s.style.cursor = 'pointer';
s.onclick = function() {window.external.AddFavorite(self.location,document.title)};
} else if (window.opera) {
s.appendChild(newT);
s.style.cursor = 'pointer';
s.onclick = function() {
     var e = document.createElement('a');
     e.setAttribute('href',self.location);
     e.setAttribute('title',document.title);
     e.setAttribute('rel','sidebar');
	 e.click();
  }
}
}


var pageLoaded = 0;
window.onload = function() {pageLoaded = 1;}
function loaded(i,f) {
if (document.getElementById && document.getElementById(i) != null) f();
else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100);
}
loaded('fav',AddtoFavourites);
/*END*/

/**
 * Virtual Scrolling Ticker
 */ 
/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
var timeout=100 //Timeout before calling scrollmarguee to scoll up by "Marqueespeed" px.

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",timeout)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
/*END*/



/**
 * Calculate the Total, Force Numbers, Decimals only.
 */ 
function calculate(f)
{
var f = document.forms[0]
var nums = f.num;
var nprice = f.price;
var nitem = f.itemname;
var result = 0;
var items = '';
var pricing = '';
var Symbol = '$';
for(var i=0;i<nums.length;i++)
{

//Checkbox checked Add Pricing, Itemname, ItemPrice with $
if(nums[i].checked)
{
result+=parseFloat(nprice[i].value);
items+=nitem[i].value+ ", "+'\n';
pricing+="" + "$" + nprice[i].value+ ""+'\n';
}

//Check hidden inputs for id=Total for "totals" inputbox.
if(document._xclick.num[i].id == "Total") { result+=parseFloat(nprice[i].value); }
}

/*
Display Total Amount in input(s): Amount, Amount2 fields

To Show just Number Inserted without Decimals
f.amount.value=result;
*/

f.amount.value=(Symbol)+Number(result).toFixed(2);
f.amount2.value=(Symbol)+Number(result).toFixed(2);

/*
Display all Service(s) names in allitems inputbox
&
Add all Checked Service(s) to PayPal Hidden item_name Field
*/
f.allitems.value=items.replace(/\,/g, '');
f.item_name.value="A1 Home Helper, L.L.C Services: " + items;

//Display Each item Price in "allitems" List
//f.totals.value=pricing;

}

function forceNumbers( iRef ) {
iRef.value = iRef.value.replace( /[^0-9.]/, '');
}
/*END*/
