// JavaScript Document

function bookmarksite(title,url) {
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else 
		if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else 
		if(document.all)// ie
			window.external.AddFavorite(url, title);
}



$(document).ready(function() {
			$("#uploadify").uploadify( {
				'uploader'       : 'scripts/uploadify.swf',
				'script'         : 'scripts/uploadify.php',
				'cancelImg'      : 'images/cancel.png',
				'folder'         : 'uploads',
				'queueID'        : 'fileQueue',
				'auto'           : true,
				'multi'          : true
			});
		});


 function IsNotNumeric(test)
{ nr1=test;
  flg=0;
  str="";
  spc=""
  arw="";
  for (var i=0;i<nr1.length;i++){
   cmp=".0123456789"
   tst=nr1.substring(i,i+1)
   if (cmp.indexOf(tst)<0){
    flg++;
    str+=" "+tst;
    spc+=tst;
    arw+="^";
   }
   else{arw+="_";}
  }
  if (flg!=0){
   if (spc.indexOf(" ")>-1) {
    str+=" and a space";
    }
   return true;
  }
  return false;
 }


function doMath()
{ 
 if (IsNotNumeric(document.forms[0].pages.value))
  {
  	alert("Please Enter Numbers for the page field");
  	document.forms[0].pages.focus();
  	return false;
  }
 	else 
  { 
  	var prod = '$' + (document.forms[0].pages.value * document.forms[0].days.value);
  	//document.forms[0].ordertotal.value=prod;
	document.getElementById('ordertotal').innerHTML = prod;
	document.forms[0].price.value=prod;
	//document.forms[0].time.value = getElementById('days').time;

  }
}


function getDays() {
	var timeDays = 3;
	var selectedIndex = document.order.days.selectedIndex;
	if (selectedIndex == 0) {
		timeDays = 1;
	}
	else if (selectedIndex == 1) {
		timeDays = 2;
	}
	else if (selectedIndex == 3) {
		timeDays = 4;
	}
	else if (selectedIndex == 4) {
		timeDays = 5;
	}
	else {
		timeDays = 3;
	}
	
	document.order.time_frame.value = timeDays;
	//alert(timeDays);
}


