



$(document).ready(function()
{
	  // ========== Cufon Replacement
	  /*Cufon.replace('h1.bitstream', { fontFamily: 'Bitstream Vera Sans' });
	  Cufon.replace('h2.bitstream', { fontFamily: 'Bitstream Vera Sans' });
	  Cufon.replace('h3.bitstream', { fontFamily: 'Bitstream Vera Sans' });
	  Cufon.replace('h4.bitstream', { fontFamily: 'Bitstream Vera Sans' });
	  Cufon.replace('h5.bitstream', { fontFamily: 'Bitstream Vera Sans' });
	  Cufon.replace('h6.bitstream', { fontFamily: 'Bitstream Vera Sans' });*/
	  
	  
	  
	  // ========== Slider 
	  //$("div.scrollable").scrollable({size: 1, loop: true, clickable: false, speed: 200}).circular().autoscroll({autoplay: true}); 
	  $("div.scrollable").scrollable();
	  

	  
	  // ========== Form Text Fields Focus/Blur
	  $('input.text, textarea.text').focus(function(){ if (this.value == this.defaultValue) { this.value = ''; } });
	  $('input.text, textarea.text').blur(function(){ if (this.value == '') { this.value = this.defaultValue; } });
	  
	  
	  
	  // ========== 
	  $('.photo_post_thumbnail:nth-child(3n)').css('margin-right', '0px');
	  $("a[rel='lightbox']").lightBox({
            imageLoading:  'http://www.clients.eirestudio.net/hatstand/wordpress/wp-content/themes/hatstand-nelly/elements/images/lightbox-ico-loading.gif',
			imageBtnClose: 'http://www.clients.eirestudio.net/hatstand/wordpress/wp-content/themes/hatstand-nelly/elements/images/lightbox-btn-close.gif',
			imageBtnPrev:  'http://www.clients.eirestudio.net/hatstand/wordpress/wp-content/themes/hatstand-nelly/elements/images/lightbox-btn-prev.gif',
			imageBtnNext:  'http://www.clients.eirestudio.net/hatstand/wordpress/wp-content/themes/hatstand-nelly/elements/images/lightbox-btn-next.gif',
      });

	  
	  
	  
	  
	  // ========== Form Hide
	  $('.wpcf7 .hide').hide();
	  $('.wpcf7 input[value=Other]').click(function()
	  {
			if($(this).attr('checked'))
			{
				  $('.wpcf7 .hide').fadeIn();
			}
			else 
			{
				  $('.wpcf7 .hide').hide();
			}
	  });
	  
	  





rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
}

function rand(number) {
        return Math.ceil(rnd()*(number+1));
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function refresh() {
        window.history.go(0);
}




function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function DynamicLayerText(objName,x,imageName) {
    	newImageName = imageName.substr(0,imageName.length-4);
		medImageName = newImageName + "_med";
		imageType = imageName.substr(imageName.length-4);
		medImageSrc = medImageName + imageType;
		newText = "<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td><div align='center'><img src='" + medImageSrc + "' width='200'height='200'></div></td></tr></table>";
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

var newWin = null;
function winBuild(imageName,imageDesc)
{

	newImageName = imageName.substr(0,imageName.length-4);
	bigImageName = newImageName + "_big";
	imageType = imageName.substr(imageName.length-4);
	bigImageSrc = bigImageName + imageType;
	
	if(newWin!=null)newWin.close();
	newWin = window.open('','','left=0,top=0,width=400, height=400, toolbars=no,resize=no,menu=no');
	newWin.document.write('<html><head><title>' + imageDesc + '</title></head>');
	newWin.document.write('<body leftmargin="0" topmargin="0"><img src="' + bigImageSrc + '" height="400" width="400"></body></html>');
	newWin.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



	  
});

