if (document.images) {
	wed_on = new Image();	wed_on.src = view_path + "images/weddings_thm_on.png";
	cup_on = new Image();	cup_on.src = view_path + "images/couples_thm_on.png";
	fam_on = new Image();	fam_on.src = view_path + "images/families_thm_on.png";
}

/***********************************
Use for switching images with captions
************************************/
function switchImage (imageName, displayname, captionTitle, captionText){
	$('#homeImage').attr('src', view_path + 'media/' + displayname + '/Photos/WebMed/' + imageName);
}

/***********************************
Use for switching images with captions for Vendor Gallery
************************************/
function switchVendorImage (imageName, weddingid, captionTitle, captionText){
	$('#homeImage').attr('src', view_path + 'vendors/wedding_' + weddingid + '/Photos/WebMed/' + imageName);
}

/***********************************
Use for switching sample images
************************************/
function switchSampleImage (imageName){
//	var viewer = $('#homeImage');
//	viewer[0].src = view_path + 'images/sample/WebMed/' + imageName;
	$('#homeImage').attr('src', view_path + 'images/sample/WebMed/' + imageName);
}

/***********************************
roll
************************************/
if (document.images) {
	help_on = new Image();	help_on.src = view_path + "images/help_on.gif";
	help_off = new Image();	help_off.src = view_path + "images/help_off.gif";
}

function roll (sname,rname){
    sname.src = rname.src;
}

/***********************************
id2elem
************************************/
function id2elem (id) {
	
	if (typeof(id) != 'string') {
		return id;
	}
	if (document.getElementById) {
		id = document.getElementById(id);
	} else if (document.all) {
		id=document.all[id];
	} else {
		id = null;
	}
	return id;
	
}

/***********************************
popup
************************************/
function popup (url,width,height) {
	
    nw = window.open(url,"newwindow","width="+width+",height="+height+",status=0,toolbar=0,menubar=0,scrollbars=1,resizable=1,location=0");
    nw.focus();
    
}

/***********************************
checkForm
************************************/
function checkForm () {
	
	if (document.subscribeForm.elements['Email Address'].value.length > 0){
	 return true;
	} else{
	 alert('Please enter your email address.');
	 document.subscribeForm.elements['Email Address'].focus();
	 return false;
	}
	
}

/***********************************
showHints
Shows hints on management page
************************************/
function showHints () {
	
	if (document.getElementById('showHint').value == "1") {
		
  	document.getElementById('hint').style.display = "block";
  	document.getElementById('showHint').value = "0";
  	
  } else {
  	
  	document.getElementById('hint').style.display = "none";
  	document.getElementById('showHint').value = "1";
  	
  }
	
}
