// slideshow

function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}


// thumbnail popup

function resizePhoto(img){
  photo1= new Image();
  photo1.src=(img);
  controller(img);
}
function controller(img){
  if((photo1.width!=0)&&(photo1.height!=0)){
    viewPhoto(img);
  }
  else{
    altResult="controller('"+img+"')";
    interval=setTimeout(altResult,20);
  }
}
function viewPhoto(img){
  winWidth=photo1.width+20;
  winHeight=photo1.height+20;
  txtString="width="+winWidth+",height="+winHeight;
  postResults=window.open(img,"",txtString);
}


// RandomImage from Javascript Source
var theImages = new Array()

theImages[0] = '/images/billboard_02.jpg'
theImages[1] = '/images/billboard_03.jpg'
theImages[2] = '/images/billboard_13.jpg'
theImages[3] = '/images/billboard_05.jpg'
theImages[4] = '/images/billboard_06.jpg'
theImages[5] = '/images/billboard_07.jpg'
theImages[6] = '/images/billboard_08.jpg'
theImages[7] = '/images/billboard_10.jpg'
theImages[8] = '/images/billboard_11.jpg'
theImages[9] = '/images/billboard_12.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="http:\/\/s246680923.onlinehome.us'+theImages[whichImage]+'">');
}


// Date Stamp

function stampIt() {

var now = new Date();
var year = now.getFullYear();
var str='';
str+='<p>Copyright &copy; 2009 <a href="http:\/\/www.elegantbridals.com\/about\/">Elegant Bridals<\/a><br \/>';
str+='		2701 Washington Road Suite 16| Augusta Georgia | 30909 | (706) 228-3465<br \/>';
str+='		Hours of Operation: Tue 10-6 | Wed 10-5 | Thurs 12-8 | Fri 10-6 | Sat 10-4 | Sun-Mon Closed | Appointments Preferred';
str+='		<\/p>';

document.write(str);
}

// Ninja Email

function noSpam(user,domain) {
	locationstring = 'mailto:' + user + '@' + domain;
	window.location = locationstring;
	}

// validate measurements web form 

 function checkFormPrivacy() {
    obj=eval("document.measurements");
    fName=obj.brides_name.value;
    wedDate=obj.wedding_date.value;
    	bmName=obj.bridesmaid_name.value;
    tel=obj.phone.value;
    	cell=obj.cell.value;
    email=obj.email.value;
    dDesigner=obj.designer_of_dress.value;
    reqSize=obj.requested_size.value;
    	bust=obj.bust.value;
    	waist=obj.waist.value;
    	hips=obj.hips.value;
    	nDressSize=obj.normal_dress_size.value;
    	height=obj.height.value;
    	shoe=obj.shoe_size.value;
    	deposit=obj.deposit.value;
    
	if ( (fName=="") || (wedDate=="") || (bmName=="") || (tel=="") || (cell=="") || (email=="") ||  (dDesigner=="") || (reqSize=="") || (bust=="") || (waist=="") || (hips=="") ||  (nDressSize=="") ||  (height=="") ||  (shoe=="") ||  (deposit=="") )
	{
        alert("ATTENION\nPlease complete the required fields indicated with an asterisk \n\Thanks")
    }
    else if(confirm("Thanks for filling out the form completely! Confirm to send."))
    {
        obj.submit();
    }
 }

// validate contact web form 

function checkForm() {
    obj=eval("document.contact_form");
    fName=obj.first_name.value;
    lName=obj.last_name.value;
    email=obj.email.value;
    refer=obj.referrer.value;
    
	if ( (fName=="") || (lName=="") || (email=="") || (refer=="") )
	{
        alert("ATTENION\nPlease complete the required fields indicated with an asterisk \n\Thanks")
    }
    else if(confirm("Thanks for filling out the form completely! Confirm to send."))
    {
        obj.submit();
    }
 }