
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console) {
    arguments.callee = arguments.callee.caller;
    var newarr = [].slice.call(arguments);
    (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
  }
};

// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());


// place any jQuery/helper plugins in here, instead of separate, slower script files.


//menu
    $(".menu").hover(
        function(){
            $("li.mitem").slideDown("slow");
        },
        function(){
            $("li.mitem").slideUp("fast");
        }
    );

    $("a.contact").click(function() {
        $("div.content, div.citem").hide("fast");
        $("div.content, div.contact").show("slow");
    });

    $("a.about").click( function() {
        $("div.content, div.citem").hide("fast");
        $("div.content, div.about").show("slow");
    });

    $("a.news").click(function() {
        $("div.content, div.citem").hide("fast");
        $("div.content, div.news").show("slow");
    });
    
    $("a.links").click(function() {
        $("div.content, div.citem").hide("fast");
        $("div.content, div.links").show("slow");
    });
    
    $("div.closetab").click( function() {
        $("div.content, div.citem").hide("fast");
    });

	
function checkMail(cemail){
	if (cemail == ''){
		return false;
	}else{
		var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ 
		return cemail.match(re);
	}
}

function checkName(cname) {
	if (cname == ''){
		return false;
	}else{
		var re = /^[a-zA-Z ]+$/
		return cname.match(re);
	}
}

// Message helper    
function showNote(lang, key){
	$.get("/php/locale.php", { locale: lang, i18n: key }, function(data){
		$('#note').empty().append(data);
		$('#note').slideDown(300).fadeIn(400);
		$('#note').delay(5000).slideUp(300).fadeOut(400);
	});
}

// terminology



function terminology(){
	var max1 = 59;
	var max2 = 64;
	var max3 = 43;

	index1 = Math.round(Math.random() * max1);	
	index2 = Math.round(Math.random() * max2);	
	index3 = Math.round(Math.random() * max3);	

	array1 = new Array("implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace", 
	"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize", "morph", "empower", 
	"envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate", "synergize", "strategize", "deploy", 
	"brand", "grow", "target", "syndicate", "synthesize", "deliver", "mesh", "incubate", "engage", "maximize", "benchmark", 
	"expedite", "reintermediate", "whiteboard", "visualize", "repurpose", "innovate", "scale", "unleash", "drive", "extend", 
	"engineer", "revolutionize", "generate", "exploit", "transition", "e-enable", "iterate", "cultivate", "matrix", 
	"productize", "redefine", 
	"recontextualize");

	array2 = new Array("clicks-and-mortar", "value-added", "vertical", "proactive", "robust", "revolutionary", "scalable", 
	"leading-edge", "innovative", "intuitive", "strategic", "e-business", "mission-critical", "sticky", "one-to-one", 
	"24/7", "end-to-end", "global", "B2B", "B2C", "granular", "frictionless", "virtual", "viral", "dynamic", "24/365", 
	"best-of-breed", "killer", "magnetic", "bleeding-edge", "web-enabled", "interactive", "dot-com", "sexy", "back-end", 
	"real-time", "efficient", "front-end", "distributed", "seamless", "extensible", "turn-key", "world-class", 
	"open-source", "cross-platform", "cross-media", "synergistic", "bricks-and-clicks", "out-of-the-box", "enterprise", 
	"integrated", "impactful", "wireless", "transparent", "next-generation", "cutting-edge", "user-centric", "visionary", 
	"customized", "ubiquitous", "plug-and-play", "collaborative", "compelling", "holistic", "rich");

	array3 = new Array("synergies", "web-readiness", "paradigms", "markets", "partnerships", "infrastructures", "platforms", 
	"initiatives", "channels", "eyeballs", "communities", "ROI", "solutions", "e-tailers", "e-services", "action-items", 
	"portals", "niches", "technologies", "content", "vortals", "supply-chains", "convergence", "relationships", 
	"architectures", "interfaces", "e-markets", "e-commerce", "systems", "bandwidth", "infomediaries", "models", 
	"mindshare", "deliverables", "users", "schemas", "networks", "applications", "metrics", "e-business", "functionalities", 
	"experiences", "web services", "methodologies");

	index1 = Math.round(Math.random() * max1);	
	index2 = Math.round(Math.random() * max2);	
	index3 = Math.round(Math.random() * max3);	
	var term = array1[index1] + " " + array2[index2] + " " + array3[index3];
	return term;
}

function runIt() {
      $("#terminology").html(terminology());
      $("#terminology").fadeIn(4000);
      $("#terminology").fadeOut(4000, runIt);
}

