//function alertThis() {
	//alert('have been alerted');
//}

//#########################SEAOS: FORM VALIDATION#############################
	//CHECKS FOR NUMERIC VALUE. USED ON ROYALTY_YEAR AND MAYBE ELSEWHERE
	function isNumeric(elem, helperMsg){
		var numericExpression = /^[0-9]+$/;
		if(elem.value.match(numericExpression)){
			return true;
		}else{
			alert(helperMsg);
			elem.value = '';
			elem.focus();
			return false;
		}
	}

//#########################SEAOS: RECEIPTS PAGE#############################
	//MOVES RADIO BUTTONS TO MAKE FORM INTELLIGENT
	function toggleSet(rad) { 
	  var currency = rad.value; 
	  //alert (currency);
	  if (currency == 'dollars' || currency == 'pesos') {
		  document.receipt.bank[1].checked = true;	  
	  }
	  else {
		  document.receipt.bank[0].checked = true;	  
	  }
	} 
	//CLEARS CHECK NUMBER IF OTHER MODE SELECTED
	function clearCheck () {
		document.receipt.check.value = '';	  		
	}
	//CLEARS MODE RADIOS IF CHECK NUMBER WRITTEN
	function clearModeRadios () {
		document.receipt.mode[0].checked = false;
		document.receipt.mode[1].checked = false;
		document.receipt.mode[2].checked = false;		
	}


//#########################TITLE SEARCH BOX#############################
	//CLEARS TITLE SEARCH TEXTBOX
		function clickclear(thisfield, defaulttext) {
			if (thisfield.value == defaulttext) {
				thisfield.value = "";
			}			
		}
	
	//RESETS TITLE SEARCH BOX
		function clickrecall(thisfield, defaulttext) {
			if (thisfield.value == "") {
				thisfield.value = defaulttext;
			}
		}
	
	//TRIGGERS LAST 50 SEARCH
		function triggerLast50() {
			window.location.href="list.php?last50=yes&list=yes";
		}
	
	//RESETS DROPDOWN LIST
		function removeAllOptions(selectbox)
		{
			var i;
			for(i=selectbox.options.length-1;i>=0;i--)
			{
				//selectbox.options.remove(i);
				selectbox.remove(i);
			}
		}
		
	//ADDS AN OPTION TO A DROPDOWN LIST
		function addOption(selectbox, value, text ) {
			var optn = document.createElement("OPTION");
			optn.text = text;
			optn.value = value;
		
			selectbox.options.add(optn);
		}

//############################END OF TITLE SEARCH #####################
function pop_album(id) { 
	//alert('this is a new feature');	
	var w = 720, h = 500;
	if (window.screen) {
		aw = window.screen.availWidth;
		ah = window.screen.availHeight;
		var left = (aw-w)/3, top = (ah-h)/3;		
	}	
	var fen = window.open('http://www.editionsalternatives.com/voir/index.php?ouvrage='+id,'ibi','width=' + w + ',height=' + h + ',top=' + top + ',left=' + left, 'scrollbars=no');
}	


function swapImg(imagename,objectsrc){
if (document.images) 
document.images[imagename].src=eval(objectsrc+".src")
}

function openWin(URL){
  NewWin=window.open(URL,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=no,status=no');
}


a1=new Image(125,24)
a1.src="../images/button_our_list_r.gif"
a2=new Image(125,24)
a2.src="../images/button_our_list.gif"
a3=new Image(125,24)
a3.src="../images/button_houses_r.gif"
a4=new Image(125,24)
a4.src="../images/button_houses.gif"
a5=new Image(125,24)
a5.src="../images/button_services_r.gif"
a6=new Image(125,24)
a6.src="../images/button_services.gif"
a7=new Image(125,24)
a7.src="../images/button_in_the_news_r.gif"
a8=new Image(125,24)
a8.src="../images/button_in_the_news.gif"
a9=new Image(82,16)
a9.src="../images/arrow_up_r.gif"
a10=new Image(82,16)
a10.src="../images/arrow_up.gif"
a11=new Image(16,16)
a11.src="../images/arrow_previous_r.gif"
a12=new Image(16,16)
a12.src="../images/arrow_previous.gif"
a13=new Image(16,16)
a13.src="../images/arrow_next_r.gif"
a14=new Image(16,16)
a14.src="../images/arrow_next.gif"
a15=new Image(125,24)
a15.src="../images/button_about_us_r.gif"
a16=new Image(125,24)
a16.src="../images/button_about_us.gif"



function swapImg(imagename,objectsrc){
if (document.images) 
document.images[imagename].src=eval(objectsrc+".src")
}

function openWin(URL){
  NewWin=window.open(URL,'NewWin','location=no,menubar=no,directories=no,scrollbars=no,resizable=no,status=no');
}

function confirmAction(msg) {
	confirm ("msg");
}

function sumInvoice(id) {  /* BANK ACCOUNT PAGE*/
	var e = document.getElementById(id);
	alert (e);
}

function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
}
