var visibleDiv = "#container1";
 var browser = navigator.userAgent;  
var allowedBrowsersList = new Array('MSIE'); 

$(document).ready(function() {
	/*if($.browser.msie && (jQuery.browser.version.substr(0,3) + 0) <= 6.5)  {
			alert('This page is not compatible with your browser IE version 6, however your experience will be enhanced with a newer browser.');
			}*/

	loc = String(location.href); 
	if(loc.indexOf('#') >= 0) {
	
		for(var i=2;i<5;i++){
		  $("#container" + i).animate({ 
			left: "750px",
			opacity: 0.0 
		  } ).css({"zIndex":"980"});
		} 
		location_id = loc.substring(loc.indexOf('#') + 1);
		$(visibleDiv).animate({ 
				left: "-100px",
				opacity: 0.0 
			  }, 1000,'linear' ).css("zIndex","980");		
		setTimeout("toggleDivs('#" + location_id + "','" + visibleDiv + "')",1000);
		visibleDiv = "#"+location_id;
	}
	else
	{ 
		for(var i=2;i<5;i++){
		  $("#container" + i).animate({ 
			left: "750px",
			opacity: 0.0 
		  } ).css({"zIndex":"980"});
		} 
	} 
	 $(".go").click(function(){ 
	 if(visibleDiv == $(this).attr('href')) return false;
      $(visibleDiv).animate({ 
        left: "-100px",
        opacity: 0.0 
      }, 1000,'linear' ).css("zIndex","980");   
		var t=setTimeout("toggleDivs('" + $(this).attr('href') + "','" + visibleDiv + "')",1000);
		visibleDiv = $(this).attr('href');
		return false;
    });
	 $(".paintingThumb").click(function(){ 
		$('#paintingHolder').attr('src','images/loading.gif'); 
		$('#paintingHolder').attr('src',$(this).attr('href')); 
		return false;
    });
	$('#contactForm').submit(function(){
		error = 0; 
		message = "All fields are required!";
		if($('#contactForm input[name="name"]').val() == ''){ message += "\n\rThe Name field is mandatory!";error = 1;}
		if($('#contactForm input[name="email"]').val() == ''){ message += "\n\rThe Email field is mandatory!";error = 1;}
		if($('#contactForm textarea[name="message"]').val() == ''){ message += "\n\rThe Message field is mandatory!";error = 1;}
		if($('#contactForm input[name="security_code"]').val().trim() != 'blue'){ message += "\n\rThe 'Human Verification' field is wrong!";error = 1;}
		if(error){
			alert(message);
			return false;
		}
		$("#loading").html("<img src='images/loading.gif' alt='Loading' />");
		$("#contactSubmit").css({display:'none'});
		var variables = {name:$('#contactForm input[name="name"]').val(),
						email:$('#contactForm input[name="email"]').val(),
						message:$('#contactForm textarea[name="message"]').val(),
						security_code:$('#contactForm input[name="security_code"]').val().trim()}; 
		$.post('contact.php',variables,function(data){ 
			if(data.indexOf('rror') >= 0)
				{
					$("#loading").html(" ");
					$("#contactSubmit").css({display:'inline'});
					alert(data);
				}			
			else{
					$("#loading").html(" ");
					$("#contactSubmit").css({display:'inline'});
					$('#contactForm input[name="name"]').val(' ');
					$('#contactForm input[name="email"]').val(' ');
					$('#contactForm textarea[name="message"]').val(' ');
					$('#contactForm input[name="security_code"]').val(' '); 
					alert(data);
				}
			});
		return false;
	});	 $("#hireMe").click(function(){ 	 if(visibleDiv == $(this).attr('href')) return false;      $(visibleDiv).animate({         left: "-100px",        opacity: 0.0       }, 1000,'linear' ).css("zIndex","980");   		var t=setTimeout("toggleDivs('" + $(this).attr('href') + "','" + visibleDiv + "')",1000);		visibleDiv = $(this).attr('href');		return false;    });
 });
 function toggleDivs(showDivId,hideDiv ){  
      $(hideDiv).animate({ 
        left: "750px",
        opacity: 0.0 
      } ).css({"zIndex":"980",'display':'none'}); 
      $(showDivId).animate({ 
        left: "90px",
        opacity: 1.0  
      }, 1000 ).css({"zIndex":"1000",'display':'block'}); 
 }
 function loadDiv(showDivId,hideDiv ){  
      $(hideDiv).animate({ 
        left: "750px",
        opacity: 0.0 
      } ).css("zIndex","980"); 
      $(showDivId).animate({ 
        left: "-10px",
        opacity: 1.0  
      }, 1000 ).css("zIndex","1000"); 
 }
  String.prototype.trim = function() {
	temp = this.toLowerCase()
	return temp.replace(/^\s+|\s+$/g,"");
} 
/*
JSTarget function by Roger Johansson, www.456bereastreet.com
*/
var JSTarget = function () {
	// Default configuration
	var config = {
		strAtt: 'class', // The attribute to be examined
		strVal: 'new-window', // The value to match
		strWarning: ' (new window)' // Warning text
	};
	function init(props) {
		// Check for DOM support
		if (!document.getElementById || !document.createTextNode) {
			return;
		}
		// If any properties were supplied, apply them to the config object.
		for (var key in props) {
			if (config.hasOwnProperty(key)) {
				config[key] = props[key];
			}
		}
		var oWarning;
		var oLink;
		var arrLinks = document.getElementsByTagName('a');
		var oRegExp = new RegExp("(^|\\s)" + config.strVal + "(\\s|$)");
		for (var i = 0, len = arrLinks.length; i < len; i++) {
			oLink = arrLinks[i];
			// If the attribute is class, check for className
			if ((config.strAtt === 'class') && (oRegExp.test(oLink.className)) || (oRegExp.test(oLink.getAttribute(config.strAtt)))) {
				oWarning = document.createElement("em");
				oWarning.appendChild(document.createTextNode(config.strWarning));
				oLink.appendChild(oWarning);
				oLink.target = '_blank';
			}
		}
	}
	return {
		init: init
	};
}();

$(document).ready(function() {
JSTarget.init({strWarning:''});});
