	function echoPage(varverif){
		if(varverif) {  // if we've detected an acceptable version
			var oeTags = '	<div id="site">\n'
			+ '<center>\n'
			+ '		<table class="site" width="762" border="0" cellpadding="0" cellspacing="0">\n'
			+ '		<!--DWLayoutTable-->\n'
			+ '		<tr>\n'
			+ '			<td width="760" height="420" valign="top">\n'
			
			+ '<object id="siteFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="760" height="420"'
			+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">\n'
			+ '<param name="movie" value="flash/index.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />'
			+ '<embed name="siteFlash" src="flash/index.swf" quality="high" wmode="transparent" bgcolor="#ffffff" '
			+ 'width="760" height="420" name="index" align="middle"'
			+ 'play="true"'
			+ 'loop="false"'
			+ 'quality="high"'
			+ 'swLiveConnect="true"'
			+ 'allowScriptAccess="sameDomain"'
			+ 'type="application/x-shockwave-flash"'
			+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
			+ '					<\/embed>\n'
			+ '				<\/object>\n'
			
			+ '			</td>\n'
			+ '		</tr>\n'
			+ '	</table>\n'
	 //   + '	Caso deseje  fazer o download de meu Portfólio, <a href="./portfolio.pdf">[clique aqui]</a>.'n
			+	'<br>&copy; <a href="mailto:thiago@thiagovieira.com?subject=Contato%20pelo%20Site">Thiago Vieira</a> <span class="style1">·</span> 2008\n'
			+ '<iframe scrolling="no" frameborder="0" name="mailFrame" width="1" height="1"></iframe></center>\n'
			+ '	</div>\n';
			document.write(oeTags);   // embed the flash movie
		} else {  // flash is too old or we can't detect the plugin
			var alternateContent = '	<center>\n'
			+ '			<table width="600" border="0" cellpadding="0" cellspacing="0">\n'
			+ '				<!--DWLayoutTable-->\n'
			+ '				<tr>\n'
			+ '					<td height="114" colspan="3" valign="top"><img name="topo1" src="./images/topo1.jpg" width="280" height="114" border="0" id="topo1" alt="" /></td>\n'
			+ '					<td colspan="2" valign="top"><img name="webdesign" src="./images/webdesign.jpg" width="320" height="114" border="0" id="webdesign" alt="Webdesign" /></td>\n'
			+ '				</tr>\n'
			+ '				<tr>\n'
			+ '					<td height="93" colspan="2" valign="top"><img name="topo2" src="./images/topo2.jpg" width="218" height="93" border="0" id="topo2" alt="" /></td>\n'
			+ '					<td colspan="3" rowspan="2" align="center" valign="middle" style="background:url(images/em_construcao.jpg) no-repeat; cursor:default; font-size:12px"><center>\n'
			+ '						Faça o <a href="http://www.macromedia.com/go/getflash/" target="_blank" style="font-size:12px">Download</a> do plugin do flash para visualizar o site </center></td>\n'
			+ '				</tr>\n'
			+ '				<tr>\n'
			+ '					<td width="193" rowspan="3" valign="top"><img name="eu" src="./images/eu.jpg" width="193" height="155" border="0" id="eu" alt="" /></td>\n'
			+ '					<td width="25" height="70">&nbsp;</td>\n'
			+ '				</tr>\n'
			+ '				<tr>\n'
			+ '					<td height="44">&nbsp;</td>\n'
			+ '					<td width="62">&nbsp;</td>\n'
			+ '					<td width="72">&nbsp;</td>\n'
			+ '					<td width="248" valign="top" class="nHUnderline" id="mail2"><a href="mailto:thiago@thiagovieira.com?subject=Contato pelo Site"><img name="mail" src="./images/mail.jpg" width="248" height="43" border="0" id="mail" alt="thiago@thiagovieira.com" onMouseOver="document.getElementById(\'mail2\').className = \'hUnderline\';" onMouseOut="document.getElementById(\'mail2\').className = \'nHUnderline\';"></a></td>\n'
			+ '				</tr>\n'
			+ '				<tr>\n'
			+ '					<td height="41"></td>\n'
			+ '					<td></td>\n'
			+ '					<td></td>\n'
			+ '					<td valign="top"><img name="fone" src="./images/fone.jpg" width="248" height="41" border="0" id="fone" alt="(47) 9929-0392"></td>\n'
			+ '				</tr>\n'
			+ '			</table>\n'
			+ '			Caso não deseje atualizar seu plugin é possível fazer o download de meu Portfólio, <a href="./portfolio.pdf">[clique aqui]</a>.<br>\n'
			+ '			&copy; Thiago Vieira <span class="style1">·</span> 2008\n'
			+ '		</center>';
			document.write(alternateContent);  // insert non-flash content
		}
	//
	}
// Detect Client Browser type
  var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
  var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
  var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
  jsVersion = 1.1;
  // JavaScript helper required to detect Flash Player PlugIn version information
  function JSGetSwfVer(i){
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    if ((navigator.plugins != null) && (navigator.plugins.length > 0)) {
      if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
        var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
        descArray = flashDescription.split(" ");
        tempArrayMajor = descArray[2].split(".");
        versionMajor = tempArrayMajor[0];
        versionMinor = tempArrayMajor[1];
        if ( descArray[3] != "" ) {
          tempArrayMinor = descArray[3].split("r");
        } else {
          tempArrayMinor = descArray[4].split("r");
        }
            versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
              flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
          } else {
        flashVer = -1;
      }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    // Can't detect in all other cases
    else {
      
      flashVer = -1;
    }
    return flashVer;
  } 
  // If called with no parameters this function returns a floating point value 
  // which should be the version of the Flash Player or 0.0 
  // ex: Flash Player 7r14 returns 7.14
  // If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
  function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) {
    reqVer = parseFloat(reqMajorVer + "." + reqRevision);
    // loop backwards through the versions until we find the newest version
    for (i=25;i>0;i--) {	
      if (isIE && isWin && !isOpera) {
        versionStr = VBGetSwfVer(i);
      } else {
        versionStr = JSGetSwfVer(i);		
      }
      if (versionStr == -1 ) { 
        return false;
      } else if (versionStr != 0) {
        if(isIE && isWin && !isOpera) {
          tempArray         = versionStr.split(" ");
          tempString        = tempArray[1];
          versionArray      = tempString .split(",");				
        } else {
          versionArray      = versionStr.split(".");
        }
        versionMajor      = versionArray[0];
        versionMinor      = versionArray[1];
        versionRevision   = versionArray[2];
        
        versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
        versionNum        = parseFloat(versionString);
            // is the major.revision >= requested major.revision AND the minor version >= requested minor
        if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
          return true;
        } else {
          return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
        }
      }
    }	
    return (reqVer ? false : 0.0);
  }
  //

defaultStatus = "Thiago Vieira - Webdesigner"
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;

function addhomesite(oForm) {
  if (IE4) {
    oForm.style.behavior = "url(#default#homepage)";
    oForm.setHomePage("http://www.thiagovieira.com.br/");
    return false;
  }
  else {
    janela=window.open('./index.htm', 'html', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=20,left=50,width=316,height=380')
    janela.focus();
  }
}

function addbookmark() {
  var bookmarkurl="http://www.thiagovieira.com.br/";
  var bookmarktitle="Thiago vieira - Webdesigner";
  var message;
  if (IE4)
    window.external.AddFavorite(bookmarkurl,bookmarktitle);
  else {
    janela=window.open('./index.htm', 'favoritos', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=20,left=50,width=316,height=380')
    janela.focus();
  }
}

function explode(inputstring, separators, includeEmpties) {
	inputstring = new String(inputstring);
	separators = new String(separators);
	
	if(separators == "undefined") {
		separators = " :;";
	}
	
	fixedExplode = new Array(1);
	currentElement = "";
	count = 0;
	
	for(x=0; x < inputstring.length; x++) {
		char = inputstring.charAt(x);
		if(separators.indexOf(char) != -1) {
			if ( ( (includeEmpties <= 0) || (includeEmpties == false)) && (currentElement == "")) {
			
			}	else {
				fixedExplode[count] = currentElement;
				count++;
				currentElement = ""; }
		}	else {
			currentElement += char;		
		}
	}
	if (( ! (includeEmpties <= 0) && (includeEmpties != false)) || (currentElement != "")) {
		fixedExplode[count] = currentElement;
	}
	return fixedExplode;
}
function swapImage(id){
	esseId = document.getElementById(id);
	esseSrc = esseId.src;
	var2 = explode(esseSrc,"/");
	var2 = var2.reverse();
	var3 = var2[0].substr(1);
	esseId.src = "./"+var2[1]+"/"+var3;
}
function desswapImage(id){
	esseId = document.getElementById(id);
	esseSrc = esseId.src;
	var2 = explode(esseSrc,"/");
	var2 = var2.reverse();
	esseId.src = "./"+var2[1]+"/_"+var2[0];
}
function openWindow (url, local,w, h){
	w = parseInt(w);
	h = parseInt(h);
/*	x = getMiddleLeft(w);
	y = getMiddleTop(h);*/
	window.open (url, local, 'width='+w+', height='+h+',toolbar=no,titlebar=no,channelmode=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no');
}
//abre pop-up de flash
function abre_flash(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="'+bgcolor+'"\n');  
	newWindow.document.write('<center\n');
	newWindow.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+imageWidth+'" height="'+imageHeight+'">\n');
	newWindow.document.write('	<param name="movie" value="'+imageName+'">\n');
	newWindow.document.write('	<param name="quality" value="high">\n');
	newWindow.document.write('	<param name="wmode" value="transparent">\n');
	newWindow.document.write('	<embed src="'+imageName+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+imageWidth+'" height="'+imageHeight+'"></embed>\n');
	newWindow.document.write('</object>\n');
	newWindow.document.write('</center></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

function txtBoxFormat(objForm, strField, sMask, evtKeyPress) {
	var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;
	
	if(document.all) { // Internet Explorer
		nTecla = evtKeyPress.keyCode;
	}	else if(document.layers) { // Nestcape
		nTecla = evtKeyPress.which;
	}
	
	sValue = objForm[strField].value;
	
	// Limpa todos os caracteres de formatação que
	// já estiverem no campo.
	sValue = sValue.toString().replace( "-", "" );
	sValue = sValue.toString().replace( "-", "" );
	sValue = sValue.toString().replace( ".", "" );
	sValue = sValue.toString().replace( ".", "" );
	sValue = sValue.toString().replace( "/", "" );
	sValue = sValue.toString().replace( "/", "" );
	sValue = sValue.toString().replace( "(", "" );
	sValue = sValue.toString().replace( "(", "" );
	sValue = sValue.toString().replace( ")", "" );
	sValue = sValue.toString().replace( ")", "" );
	sValue = sValue.toString().replace( ":", "" );
	sValue = sValue.toString().replace( " ", "" );
	sValue = sValue.toString().replace( " ", "" );
	fldLen = sValue.length;
	mskLen = sMask.length;
	
	i = 0;
	nCount = 0;
	sCod = "";
	mskLen = fldLen;
	
	while (i <= mskLen) {
		bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/"))
		bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " ") || (sMask.charAt(i) == ":"))
		
		if (bolMask) {
			sCod += sMask.charAt(i);
			mskLen++;
		}	else {
			sCod += sValue.charAt(nCount);
			nCount++;
		}
		i++;
	}
	
	objForm[strField].value = sCod;
	
	if (nTecla != 8) { // backspace
		if (sMask.charAt(i-1) == "9") { // apenas números...
			return ((nTecla > 47) && (nTecla < 58)); // números de 0 a 9
		} else { // qualquer caracter...
			return true;
		}
	}	else {
		return true;
	}
} //Final da função para formatar valores em campos

function checkReqFields(errmsg) {
	elms = new Array(3);
	elms[0] = document.getElementsByTagName("INPUT");
	elms[1] = document.getElementsByTagName("TEXTAREA");
	elms[2] = document.getElementsByTagName("SELECT");
	
	passed = true;
	for(i=0; i<3; i++) {
		len = elms[i].length;
		for(x=0; x<len; x++) {
			if(elms[i][x].getAttribute("required")) {
				if (elms[i][x].tagName == "SELECT")	{
					if (elms[i][x].value == '')	{
						passed = false;
					}
				}	else if(isFieldEmpty(elms[i][x].value))	{
					passed = false;
				}
			}
			
			if (!passed) {
				try {
					elms[i][x].focus();
				} catch(e) {};
				alert(errmsg);
				return false;
			}
		}
	}
	return true;
}
function MM_preloadImages() { //v3.0
  var d=document;
	if(d.images){
		if(!d.MM_p){
			d.MM_p=new Array();
		}
    var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++){
    	if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}
}
//inicio função troca foto
function swapPhoto(imgTarget, imgSwap, total, size, bt, numberNow, fixNameFile){
	if (size == "G") {
		dir1 = "./ampliadas/";
		dir2 = "../../../../images/";
	} else if (size == "P") {
		dir1 = "./";
		dir2 = "../../../images/";
	}
	frameTarget = document.getElementById(imgTarget);
	imgSwap = document.getElementById(imgSwap);
	noNow = document.getElementById(numberNow).value;
	
	btLast = document.getElementById("last");
	btNext = document.getElementById("next");
	btPrev = document.getElementById("prev");
	btFirst = document.getElementById("first");
	
	noNew = 1;
	
	btPressed = bt.id;	
	switch (btPressed){
		case "last":
			noNew = parseInt(total);
		break;
		case "next":
			noNew = parseInt(noNow)+1;
		break;
		case "prev":
			noNew = parseInt(noNow)-1;
		break;
		case "first":
			noNew = 1;
		break;
	}

	if ((noNew > 1) && (noNew < total)) {
		btLast.style.visibility = "visible";
		btNext.style.visibility = "visible";
		btPrev.style.visibility = "visible";
		btFirst.style.visibility = "visible";
	} else if (noNew == 1) {
		btLast.style.visibility = "visible";
		btNext.style.visibility = "visible";
		btPrev.style.visibility = "hidden";
		btFirst.style.visibility = "hidden";
	} else if (noNew == total) {
		btLast.style.visibility = "hidden";
		btNext.style.visibility = "hidden";
		btPrev.style.visibility = "visible";
		btFirst.style.visibility = "visible";
	}
	nameFile = fixNameFile+noNew+".jpg";
	frameTarget.removeChild(imgSwap);//remove a imagem existente

	var new_img = document.createElement('img'); //cria a foto
		new_img.src = dir1+nameFile;
		new_img.id = "imgSwaped";
		new_img.name = "imgSwaped";
	frameTarget.appendChild(new_img); //adiciona a foto novamente
	
	indicate = document.getElementById("indice");
	indicate.innerHTML = noNew+" / "+total;
	document.getElementById(numberNow).value = noNew;
}//fim função troca foto

//abre pop-up de imagem
function abre_imgs(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {

	if (bgcolor=="") {
		bgcolor="#FFFFFF";
	}
	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("vwd_justso.htm","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Clique na imagem para fechar esta janela" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}
function flash(arquivo, largura, altura){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + largura + "' height='" + altura + "'>");
	document.write("	<param name='movie' value='" + arquivo + "'>");
	document.write("	<param name='quality' value='high'>");
	document.write("	<param name='wmode' value='transparent'>");
	document.write("	<embed src='" + arquivo + "' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + largura + "' height='" + altura + "'></embed>");
	document.write("</object>");
}