// JavaScript Document
/********************************Drop-down-menu*****************************************/
function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
/********************************Drop-down-menu*****************************************/
/*********************************Rollover Image****************************************/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*********************************Rollover Image****************************************/
/*********************************Sliders**********************************************/
function formatText(index, panel) {
	  return index + "";
	}
	$(function () {
		$('.anythingSlider').anythingSlider({
			easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 4000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 2000,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             // Start text
			stopText: "Stop",				// Stop text			
			navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
		});
		$('.anythingSlider-s, .anythingSlider-sub, .anythingSlider-cbox').anythingSlider({
			easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 5000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 1000,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",             // Start text
			stopText: "Stop",               // Stop text
			navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
		});
		

		$('.anythingSlider-logos').anythingSlider({
			easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 3000,                    // How long between slide transitions in AutoPlay mode
			startStopped: false,            // If autoPlay is on, this can force it to start stopped
			animationTime: 1000,             // How long the slide transition takes
			hashTags: true,                 // Should links change the hashtag in the URL?
			buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
			startText: "",             // Start text
			stopText: "",               // Stop text
			navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
		});
		
		
		/*$("#slide-jump").click(function(){
			$('.anythingSlider').anythingSlider(6);
			$('.anythingSlider-s').anythingSlider(6);
			$('.anythingSlider-sub').anythingSlider(6);
			$('.anythingSlider-cbox').anythingSlider(6);
			$('.anythingSlider-logos').anythingSlider(6);
		});*/
	});
/******************************************************Sliders-end*******************************************/
/*******************************************************send to friend*****************************************/
$(document).ready(function(){
	$("#slideMail").css("visibility", "visible");
	$("#slideMail").hide();
	$("a#mailBtn").click(function () {
	  if ($("#slideMail").is(":hidden")) {
		$("#slideMail").slideDown("slow");
	  } else {
		$("#slideMail").slideUp();
	  }
	});
	$('.tabs li:last a').css("margin-right", 0);
	$("#closeMail").click(function(){
		$("#slideMail").slideUp();							   
	})
	$('.tabs-nav a:last').css('margin-right', 0);
	
});
/*******************************************************send to friend*****************************************/
/*******************************************************Enlarge minimize font********************************************/
var max_font_size = 18;
var min_font_size = 10;

$(function(){
	$('.resize-font a').click(function(){
		var ourText = $('#printarea, #printarea div, #printarea td, #printarea span, #printarea li').not(".more a");
		var currFontSize = ourText.css('fontSize');
		var finalNum = parseFloat(currFontSize, 12);
		var stringEnding = currFontSize.slice(-2);
		if(this.id == 'large') {
			if(finalNum < max_font_size) finalNum += 2;
		}
		else if (this.id == 'small'){
			if(finalNum > min_font_size) finalNum -=2;
		}
		ourText.css('fontSize', finalNum + stringEnding);
	});
});

/*******************************************************Enlarge minimize font********************************************/
function ValidateSearch(source, args) {
/*MM_findObj('ctl00$ControlHead1$ControlSearch1$txtSearch').value.length < 3*/
        if (MM_findObj('ControlSearch1_txtSearch').value.length < 3)
            args.IsValid = false;
        else
            args.IsValid = true;
        
}



/***************************************Print This Page *****************************************/
var pagetitle
function print_function(){ 
	//alert('Coming Soon');
	var pagetitle = document.getElementById('ctl00_ContentPlaceHolder1_mypagetitle').value;
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
	disp_setting+="scrollbars=yes,width=900, height=700, left=100, top=100";
	var content_title = document.getElementById(pagetitle);
	var content_value = document.getElementById("printarea").innerHTML;
	var docprint=window.open("","",disp_setting);
	docprint.document.open();
	docprint.document.write('<html><head><title>Nassar Office</title>');
	docprint.document.write('<link rel="stylesheet" type="text/css" href="styles/nassar.css" media="screen" /></head><body onLoad="javascript:self.print(); self.close();" style="background-color:white; background:none; font-size:12px !important;">');
	docprint.document.write('<div style="margin-bottom:10px; padding:10px;"><table cellspacing="0" cellpadding="0" border="0"><tr><td><img src="images/logo.gif" /></td><td></td></tr></table></div><div><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="padding:10px;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="230" height="24"><param name="movie" value="swf/title.swf" /><param name="flashvars" value="title='+pagetitle+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="swf/title.swf" width="230" height="24" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" flashvars="title='+pagetitle+'"></embed></object></td></tr><tr><td class="printable" id="centercontent" style="font-family:Arial,Helvetica,sans-serif; font-size:12px !important;"><span style="font-size:12px !important;">'+content_value+'</span></td></tr></table></div><div>&nbsp;</div>');
	docprint.document.write('</body></html>');
	docprint.document.close(); 
 	docprint.focus();
}

/***********************************************************************/
function ValidateName(source, args) {
    if (MM_findObj("ctl00_ContentPlaceHolder1_ControlTools1_TxtName").value == "" || MM_findObj("ctl00_ContentPlaceHolder1_ControlTools1_TxtName").value == "Name")
        args.IsValid = false;
    else
        args.IsValid = true;
}
function ValidateName2(source, args) {
    if (MM_findObj("TxtName").value == "" || MM_findObj("TxtName").value == "Name")
        args.IsValid = false;
    else
        args.IsValid = true;
}

function ValidateFName(source, args) {
    if (MM_findObj("ctl00_ContentPlaceHolder1_ControlTools1_TxtFName").value == "" || MM_findObj("ctl00_ContentPlaceHolder1_ControlTools1_TxtFName").value == "Friend Name")
        args.IsValid = false;
    else
        args.IsValid = true;
}
function ValidateFName2(source, args) {
    if (MM_findObj("TxtFName").value == "" || MM_findObj("TxtFName").value == "Friend Name")
        args.IsValid = false;
    else
        args.IsValid = true;
}

