$(document).ready(function() {
		//Time Zone Background Image
		var d = new Date()
			var gmtHours = d.getTimezoneOffset()/60;
			if( gmtHours > 1) {
				$("#main").css( "background", "url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/featured_newyork.jpg) #fff no-repeat");
			}
			else if( gmtHours <= -5){
				$("#main").css( "background", "url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/featured_mumbai.jpg) #fff no-repeat");
			}
			else {
				$("#main").css( "background", "url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/featured_london.jpg) #fff no-repeat");	
			}

	
		var url = window.location.href;
		
		if( url.indexOf('#usermessage4a') != -1 ) {
			$('#form-next-popup, #li-3-37, #pagenation, #cforms3form, .reqthesource').hide();
			$('#form-next-popup, #li-5-37, #pagenation, #cforms5form, .reqthesource').hide();
			$('#contact-popup, #cforms3form .cf-fs4, #cforms3form .cf-sb, #part3').show();
			$('#contact-popup, #cforms5form .cf-fs4, #cforms5form .cf-sb, #part3').show();
       $('#sub-nav-source-step2 .step2').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-2-off.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step2').css('color', '#D0D0D0');
       
       
       $('#sub-nav-source-step2 .step3').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-3-on.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step3 span').css('color', '#00BCEC');
		}


if( url.indexOf('#usermessage6a') != -1 ) {
			$('#form-next-popup, #li-3-37, #pagenation, #cforms3form, .reqthesource').hide();
			$('#form-next-popup, #li-5-37, #pagenation, #cforms5form, .reqthesource').hide();
			$('#contact-popup, #cforms3form .cf-fs4, #cforms3form .cf-sb, #part3').show();
			$('#contact-popup, #cforms5form .cf-fs4, #cforms5form .cf-sb, #part3').show();
       $('#sub-nav-source-step2 .step2').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-2-off.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step2').css('color', '#D0D0D0');
       
       
       $('#sub-nav-source-step2 .step3').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-3-on.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step3 span').css('color', '#00BCEC');
		}
		
		
		
		
		
		
		$("#form-next-popup").click(function () { 
      
 
       $('#sub-nav-source-step2 .step2').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-2-off.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step2').css('color', '#D0D0D0');
       
       
       $('#sub-nav-source-step2 .step3').css('background', 'url(http://www.pharmalinkconsulting.com/wp-content/themes/pharmalink/images/step-3-on.png) no-repeat 2px -3px');
       $('#sub-nav-source-step2 .step3 span').css('color', '#00BCEC');
    });

	$(document).pngFix(); 
	$('#s').focus(function() {
		if (this.value == 'Search') {
			this.value = '';	
		}
	});
	$('#s').blur(function() {
		if (this.value == '') {
			this.value = 'Search';	
		}
	});

	$('#newsletter-email-field').focus(function() {
		if (this.value == 'Enter Your Email') {
			this.value = '';	
		}
	});

	$('#newsletter-email-field').blur(function() {
		if (this.value == '') {
			this.value = 'Enter Your Email';	
		}
	});

	$('#form-next-popup').click(function() {
		$('#contact-popup, .requirements #cforms3form .cf-fs4, .requirements #cforms3form .cf-sb, #part3').show();
		$('#contact-popup, .requirements #cforms5form .cf-fs4, .requirements #cforms5form .cf-sb, #part3').show();
		$('#form-next-popup, .requirements #cforms3form ol.cf-ol #li-3-37, #pagenation, #cforms3form, .reqthesource').hide();
		$('#form-next-popup, .requirements #cforms5form ol.cf-ol #li-3-37, #pagenation, #cforms5form, .reqthesource').hide();
	});
	$('#status-text-ul .status-text').autoEllipsis(); 
		});

		$('#sub-footer #sub-contact, #sub-footer #contact-map').click(function(event) {
		   window.location = 'http://www.pharmalinkconsulting.com/contact';
		});

		$('#sub-footer #sub-blog').click(function(event) {
		   window.location = 'http://www.pharmalinkconsulting.com/blog';
		});

		$('#sub-footer #sub-source').click(function(event) {
		   window.location = 'http://www.pharmalinkconsulting.com/questionaire-the-source';
		});

		$('#sub-footer #sub-twitter').click(function(event) {
		   window.location = 'http://www.twitter.com/pharmalink';
		});
