/*
 * MD funs													MD(10/9)(11/2)
 *    (c) Max Díaz, 2011
 *    www.maxdiaz.com
 *
 */
var hostname="maxdiaz.com",username="info",coptext="2011 Legere Software Inc.",doctit="Max D\u00edaz",optCV=false;function linit(){var a=document.referrer;if(a.indexOf("twitter")>=0){alert(a);locSet(a)}optq=location.search;if(optq!=null&&optq.length>1){optq=optq.substring(1).toLowerCase();optCV=optq.substr(0,2)=="cv"}Shadowbox.init({handleOversize:"drag",modal:false,viewportPadding:20,continuous:true,overlayOpacity:0.9})}
function init(){optCV&&$(window).bind("resize",bgAdj);lsMail("idemail","email",'<img src="img/email.png" style="margin-bottom:-4px;" alt=""/>&nbsp;email');iniFlaps();if(optCV){iniCont();sectionCV("main")}else bgAdj()}function chgLang(){alert("Sorry, not yet...")}function iniCont(){var a=$("body").height()-$(".header").height()-8;a+="px";$(".cont").css({backgroundColor:"#F7F7F7",minHeight:a,height:a});$("body").attr("class","bgrad")}
function iniFlaps(){$(".flapt").buildMbExtruder({positionFixed:false,width:150,extruderOpacity:1,autoCloseTime:1E3,onExtOpen:function(){},onExtContentLoad:function(){},onExtClose:function(){$(".flapt").css("z-index","100")}});$(".flapt").css({top:"49px",left:"auto"});$(".flapt").each(function(){$(this).css("margin-left",$(this).metadata().lpos)});if(optCV){$(".flapl").buildMbExtruder({position:"left",top:0,positionFixed:false,width:150,extruderOpacity:1,autoCloseTime:500,onExtOpen:function(){},onExtContentLoad:function(){},
onExtClose:function(){}});$(".flapl").css({top:"auto"});$(".flapl").each(function(){$(this).css("margin-top",$(this).metadata().tpos)})}}var bght=300,bgol=75;function bgAdj(){var a=$(".container").height(),b=$("body").height();a+(bght-bgol)>b?$("html").css("background-position","center "+(a-bgol)+"px"):$("html").css("background-position","center bottom")}function bgNoAdj(){$("html").css("background-position","center bottom");$(window).unbind("resize",bgAdj)}
function section(a){var b,c=null;switch(a){case "web":a="htm/web.html";b="Website Development";c=function(){$(".tooltip").tooltip({fadeOut:"300",fadeOut:"100",offsetY:-36,offsetX:-36,hoverInt:true});$(".tooltipw").tooltip({mousefoll:false,offsetY:-150,offsetX:-340,hoverInt:true})};break;case "free":a="htm/free.html";b="Freebies";c=function(){$(".tooltip").tooltip({mousefoll:false,offsetY:-275,offsetX:-150,hoverInt:true})};break;default:return false}$("#fltSoft").closeMbExtruder();iniCont();c!=null?
$(".cont").load(a,c):$(".cont").load(a);$("#hdrsec").text(b);document.title=doctit+" - "+b;bgNoAdj();return false}
function sectionCV(a){var b=null;$("#langctl").css("display","block");switch(a){case "main":a="CV/main.html";break;case "tech":a="CV/tech.html";b=function(){$(".tooltip").tooltip({mousefoll:false,offsetY:-300,offsetX:-224})};break;case "work":a="CV/work.html";break;case "link":return false;case "pub":a="CV/pub.html";break;case "web":a="htm/web.html";break;default:return false}b!=null?$(".cont").load(a,b):$(".cont").load(a);$("#hdrsec").text("Curriculum vit\u00e6");document.title=doctit+" - R\u00e9sum\u00e9";
return false}function ckUpload(){$("#fltCont").closeMbExtruder();ckPw("inc/ckpw.php",function(a){a!=null&&locSet(a)});return false}function modImg(a,b){return"images/"+(a==null?b:"Web_"+a+"-"+b)+".jpg"}function modObj(a,b){return{player:"img",content:modImg(a,b)}}function modShowSB(a){Shadowbox.open(a)}function modShowSM(){}function modPic(a,b){if(a instanceof Array){for(var c=[],d=0;d<a.length;d++)c[d]=modObj(b,a[d]);modShowSB(c)}else modShowSB(modObj(b,a));return false};

