$(document).ready(function() {


	// shows the sign-up box on clicking the tab 
  $('.showLink').click(function() {
    $('#loginBox').fadeIn('fast');
  		prepareToShowDialog();
	    return false;
  });

 // hides the sign-up box on clicking the close icon 
 $('.hideLink').click(function() {
    $('#loginBox').fadeOut('fast');
				prepareToHideDialog();
				return false;
  });


	
	$('.showFPlink').click(function() {
			$('#loginBox').fadeOut('fast');
   	 $('#forgotBox').fadeIn('fast');
			prepareToShowDialog();
    return false;
  });

 // hides the sign-up box on clicking the close icon 
 $('.hideFPlink').click(function() {
    $('#forgotBox').fadeOut('fast');
			prepareToHideDialog();
				return false;
  });
  
	$("#debtdiet_signup").click(function(){
		if ($('#debtdiet_signup').is(':checked')) {
			$('#debtDietFields').slideDown('slow');	
			$('#regZIP').hide();
			$('#regZIP input').val('');
		//	$('#debtDietFields input, #debtDietFields select').addClass('required');
			//	if ($('#debtDietFields input').hasClass('notRequired')) {
					//	$('.notRequired').removeClass('required');
			//	}

 		} else {     
			$('#debtDietFields').slideUp('slow');	
						$('#regZIP').show();
		//	$('#debtDietFields input, #debtDietFields select').removeClass('required');
			}
	});
				
});


function prepareToShowDialog() {
			var headshot = $('#jeanHeadShot');
			var mainappear =		$('#mainAppear');
// Detect Browsers to hide the elements that overlap//
//	if (navigator.appName == 'Microsoft Internet Explorer' ||navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
					$("iframe, select, .hideForIE").hide();
	//	} 
			headshot.hide();
			mainappear.css({'position' : ''});
			scroll(0,0);
			$('#loginBox input#user_login').focus();
}



function prepareToHideDialog() {
			var headshot = $('#jeanHeadShot');
			var mainappear =		$('#mainAppear');
// Detect Browsers to hide the elements that overlap//
		 // if (navigator.appName == 'Microsoft Internet Explorer' ||navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
				$("iframe, select, .hideForIE").show();
		//	} 
//
			headshot.show();
			mainappear.css({'position' : 'relative'});
				scroll(0,0);
}


function myFocus(element) {
     if (element.value == element.defaultValue) {
       element.value = '';
			 element.style.color = "#333333";
     }
   }
   function myBlur(element) {
     if (element.value == '') {
       element.value = element.defaultValue;
			 element.style.color = "#666666";

     }
   }
	
		document.write('<style type="text/css">');    
		document.write('div.domtab div{display:none;}<');
		document.write('/s'+'tyle>');    
		
					
		function launchPop(theURL,iHeight,iWidth) {
leftPos = (screen.width) ? (screen.width-iWidth)/2 : 0;
topPos = (screen.height) ? (screen.height-iHeight)/2 : 0;

newWindow = window.open(theURL,'subWindowCustom','toolbar=no,location=no,scrollbars=yes,status=no,menubar=no,resizable=yes,left='+leftPos+',top='+topPos+',height='+iHeight+',width='+iWidth+',fullscreen=no')
newWindow.focus()
}