// JavaScript Document

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}


// modified link to get title and href <a href="javascript:bookmarksite(document.title, location.href)">Bookmark this site!</a>

// Email Page Link

function mailpage()
{
mail_str = "mailto:?subject= Check this link --> " + document.title;
mail_str += "&body= " + document.title;
mail_str += "... at: " + location.href;
location.href = mail_str;
} 

// Email Page Link

function mailpage_video()
{
mail_str = "mailto:?subject= Check out this video about itegrity from REDW --> " + document.title;
mail_str += "&body= " + document.title;
mail_str += "... at: " + location.href;
location.href = mail_str;
} 

// <a href="javascript:mailpage()" target="_top">Send this link to a friend</a>

/*******************************************************************
* JavaScript/CSS Font Size Changer (Persistent Between Pages)
* (c) DB Design, All rights are reserved
* http://phpscriptindex.com, phpsales@gmail.com
********************************************************************
* Script will allow user to visually change font size. Font size 
* will persist thru page change using a cookie.
********************************************************************
* Directions: Change fontElementId var to the element id you wish to
* allow users to change font sizes. 
********************************************************************
* Tip: Next span element inside normal div to inherit parent style
* but enable use to change font size.
*******************************************************************
* FireFox 2.0.0.3 Tested
* MS IE 7 Tested
* Netscape 8.1.2 Tested
* Opera 9.1 Tested
******************************************************************/

var fontElementId = "page_content"; //CHANGE ME TO YOUR ELEMENT ID

//DO NOT MODIFY BELOW

/* Module Change Font (string) */
function changeFont(fontClass){
	var element = document.getElementById(fontElementId);
	element.className = fontClass;
	setCookie("fontSize", fontClass, 5);
}		

/* Module Set Default Font Size (void) */
function setDefaultFontSize(){
	var fontSize = getCookie("fontSize")
	if(fontSize){
		var element = document.getElementById(fontElementId);
		element.className = fontSize;
	}
}

/* Module Set Cookie (string, string, int) -- http://www.w3schools.com/js/js_cookies.asp */
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
/* Module Get Cookie (string) -- http://www.w3schools.com/js/js_cookies.asp */
function getCookie(c_name){
	if(document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return false;
}


/************* Facebox Contact Verification *************/
// Facebox
function FaceBoxVerifyContactForm() {
	jQuery.facebox({ ajax: 'contact_disclaimer.php?Page=contact_disclaimer' });
	
	//alert ('here you go');
}

// Facebox
function FaceboxContactConfirmation(is_approved) {	
	
	if (is_approved && document.ConfirmForm.agree.checked) {
		jQuery(document).trigger('close.facebox');
		setTimeout("document.ContactForm.submit ()",1000);	
	} else if (is_approved && !document.ConfirmForm.agree.checked){
		alert ('please check the confirmation box before continuting');
		return;
	} else if (!is_approved) {
		jQuery(document).trigger('close.facebox');
	} 
}


/// IOS CSS

   if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {
       document.write('<link rel="stylesheet" href="css/ios.css">'); 
   }

