// JavaScript Document

//*****************//
// TEST FUNCTION
//*****************//
function callAlert(){
	alert("alert test call");
}

//*****************//
//JUMP MENUS
//*****************//
function jumpMenu(url){
	//alert();
	window.location.href = url;	
}

//*****************//
//DELETE RECORD
//*****************//
function deleteRecord(id,name){
	if ( confirm("Are you sure you want to delete the record\n "+name+"?") ){
		document.location.href = "recipes.php?delid="+id+"";
	}else{
		return false;
	}
}

//*****************//
//DELETE ITEM
//*****************//
function deleteItem(url){
	if ( confirm("Are you sure you want to delete this record?") ){
		document.location.href = url; //delete id is passed on the url
	}else{
		return false;
	}
}

//
//*****************//
//PRELOAD IMAGES
//*****************//
// Preload image - in case they are large images.
if(document.images){
  var img_home = new Image(); img_home.src = "../images/navg_Home.jpg";
  var img_prods = new Image(); img_prods.src = "../images/navg_Products.jpg";
  var img_servs = new Image(); img_servs.src = "../images/navg_Services.jpg";
  var img_contc = new Image(); img_contc.src = "../images/navg_Contact.jpg";
}

//
//*****************//
//SWAP IMAGE
//*****************//
function SimpleSwap(obj,which){
        obj.src=obj.getAttribute(which||"origsrc");
}

//
//*****************//
//DATE ENGLISH
//*****************//
var myDate=new Date();
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
var w = weekday[myDate.getDay()] + " ";
var d = myDate.getDate();
var m = monthname[myDate.getMonth()] + " ";
var y = myDate.getFullYear();
var fulldate =  m + d + ", " + y;

//*****************//
//DATE SPANISH
//*****************//
var spa_myDate=new Date();
var spa_weekday=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var spa_monthname=new Array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIEMBRE","DICIEMBRE");
var spa_w = spa_weekday[spa_myDate.getDay()] + " ";
var spa_d = spa_myDate.getDate();
var spa_m = spa_monthname[spa_myDate.getMonth()] + " ";
var spa_y = spa_myDate.getFullYear();
var spa_fulldate =  spa_m + spa_d + ", " + spa_y;

//
//*****************//
//RANDOM BANNER_01
//*****************//
var maxAdNo = 2;
var adNo;
//SPANISH ADS
var myAd_esp = new Array();
//myAd_esp[0] = '<a href="../../../st_mmmdiaries/common/js/esp_index.php?st=hm&pg=recipes"><img src="../../../st_mmmdiaries/common/js/images/banner_01_esp.jpg" width="625" height="195" border="0"></a>';
//myAd_esp[1] = '<a href="../../../st_mmmdiaries/common/js/esp_index.php?st=hm&pg=specials"><img src="../../../st_mmmdiaries/common/js/images/banner_02_esp.jpg" width="625" height="195" border="0"></a>';
//myAd_esp[2] = '<a href="../../../st_mmmdiaries/common/js/esp_index.php?st=hm&pg=recipes"><img src="../../../st_mmmdiaries/common/js/images/banner_02_esp.jpg" width="625" height="195" border="0"></a>';

myAd_esp[3] = '<a href="../../../st_mmmdiaries/common/esp/index.php"><img src="../../../st_mmmdiaries/common/images/banner_thanksgiving_esp.jpg" width="625" height="195" border="0"></a>';
//
//ENGLISH ADS
var myAd_eng = new Array();
//myAd_eng[0] = '<a href="../../../st_mmmdiaries/common/js/eng_index.php?st=hm&pg=recipes"><img src="../../../st_mmmdiaries/common/js/images/banner_01_eng.jpg" width="625" height="195" border="0"></a>';
//myAd_eng[1] = '<a href="../../../st_mmmdiaries/common/js/eng_index.php?st=hm&pg=specials"><img src="../../../st_mmmdiaries/common/js/images/banner_02_eng.jpg" width="625" height="195" border="0"></a>';
//myAd_eng[2] = '<a href="../../../st_mmmdiaries/common/js/eng_index.php?st=hm&pg=recipes"><img src="../../../st_mmmdiaries/common/js/images/banner_02_eng.jpg" width="625" height="195" border="0"></a>';

myAd_eng[3] = '<a href="../../../st_mmmdiaries/common/eng/index.php"><img src="../../../st_mmmdiaries/common/images/banner_thanksgiving_eng.jpg" width="625" height="195" border="0"></a>';
//
//text can be part of the array
//myAd[1] = '<a href="http://javascript.internet.com/">Try The JavaScript Source</a>';
//
//place the following on the page 
//adNo = Math.round(Math.random() * maxAdNo);
//document.write(myAd[adNo]);

//*****************//

