/* Author: 

*/


//---------------------------------------------------------------------------Nav Active Link Link->>

function setActive() {
  aObj = document.getElementById('main').getElementsByTagName('a');
  for(i=0;i<aObj.length;i++) {
    if(document.location.href.indexOf(aObj[i].href)>=0) {
      aObj[i].className='active';
    }
  }
}

//window.onload = setActive;

// EOF;


//---------------------------------------------------------------------------New Bookmark Us Link->>

function favoris() {
			var url=location.href;
			var title=document.title;
			var ua=navigator.userAgent.toLowerCase();
			var isSafari=(ua.indexOf('webkit')!=-1);
			var isMac=(ua.indexOf('mac')!=-1);
			var buttonStr=isMac?'Command/Cmd':'CTRL';
/*            if ( navigator.appName != 'Microsoft Internet Explorer' ){
                        window.sidebar.addPanel(title,url,""); 
            } else { 
                        window.external.AddFavorite(url,title); 
            } 
*/

			if ( navigator.appName == 'Microsoft Internet Explorer' ){
				window.external.AddFavorite(url,title);
			} else if ( navigator.appName == 'Netscape' ) { 
				
				if ( isSafari ) { // Firefox, Netscape, Safari, iCab
					alert('You need to press '+buttonStr+' + D to bookmark our site.');
				} else if ( isMac ) { // IE5/Mac and Safari 1.0
					alert('You need to press Command/Cmd + D to bookmark our site.');    
				} else {
					window.sidebar.addPanel(title,url,"");
				}
				
//			}  else if ( navigator.appName == 'Opera' ) { 
//				alert('In order to bookmark this site you need to do so manually '+ 'through your browser.');
			} else {
					alert('In order to bookmark this site you need to do so manually '+ 'through your browser.');
				}
}

// EOF;


// Gravity Form Clear script
//
// add .clearit class to your form elements
//
jQuery(document).ready(function() {

	jQuery.fn.cleardefault = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};
jQuery(".clearit input, .clearit textarea").cleardefault();

});





// Clear default values on submission

jQuery.fn.DefaultValue = function(text){
    return this.each(function(){
		//Make sure we're dealing with text-based form fields
		if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
			return;
		
		//Store field reference
		var fld_current=this;
		
		//Set value initially if none are specified
        if(this.value=='') {
			this.value=text;
		} else {
			//Other value exists - ignore
			return;
		}
		
		//Remove values on focus
		$(this).focus(function() {
			if(this.value==text || this.value=='')
				this.value='';
		});
		
		//Place values back on blur
		$(this).blur(function() {
			if(this.value==text || this.value=='')
				this.value=text;
		});
		
		//Capture parent form submission
		//Remove field values that are still default
		$(this).parents("form").each(function() {
			//Bind parent form submit
			$(this).submit(function() {
				if(fld_current.value==text) {
					fld_current.value='';
				}
			});
		});
    });
};


// Initiates for Main Contact Form



// Clear default values on submission

jQuery.fn.DefaultValue = function(text){
    return this.each(function(){
		//Make sure we're dealing with text-based form fields
		if(this.type != 'text' && this.type != 'password' && this.type != 'textarea')
			return;
		
		//Store field reference
		var fld_current=this;
		
		//Set value initially if none are specified
        if(this.value=='') {
			this.value=text;
		} else {
			//Other value exists - ignore
			return;
		}
		
		//Remove values on focus
		$(this).focus(function() {
			if(this.value==text || this.value=='')
				this.value='';
		});
		
		//Place values back on blur
		$(this).blur(function() {
			if(this.value==text || this.value=='')
				this.value=text;
		});
		
		//Capture parent form submission
		//Remove field values that are still default
		$(this).parents("form").each(function() {
			//Bind parent form submit
			$(this).submit(function() {
				if(fld_current.value==text) {
					fld_current.value='';
				}
			});
		});
    });
};



$(document).ready(function() {
	
	// Initiates for Main Contact Form
	$("#input_1_15").DefaultValue("Name*");
	$("#input_1_13").DefaultValue("Email*");
	$("#input_1_14").DefaultValue("Phone Number*");
	$("#input_1_11").DefaultValue("Type your message here...*");
	
	// Initiates for Quick Contact Form
	$("#input_3_1").DefaultValue("Name*");
	$("#input_3_2").DefaultValue("Email*");
	$("#input_3_5").DefaultValue("Phone*");
	$("#input_3_4").DefaultValue("Message*");
	
});



