// JavaScript Document//sub menu portfolio 
	$(document).ready(function(){
		$("#portfolio").click(function () {
			$("#portfolioSub").slideToggle("slow");
		});
	});

//mouseover do menu
$(document).ready(function(){
	$("#menu img").hover(
		  function () {
			$(this).attr({src:"img/"+this.id+"Over.jpg"});
		  }, 
		  function () {
			$(this).attr({src:"img/"+this.id+".jpg"});
		  }
    );
});

//mouseover do menu EN
$(document).ready(function(){
	$("#menuEN img").hover(
		  function () {
			$(this).attr({src:"../img/"+this.id+"OverEN.jpg"});
		  }, 
		  function () {
			$(this).attr({src:"../img/"+this.id+"EN.jpg"});
		  }
    );
});

//pro menu de backgrounds
function mudaBg(bg){
	if(bg==1){		
		document.body.style.backgroundImage="url(img/bgDesenho.jpg)";
		document.body.style.backgroundAttachment = "Scroll";
		document.body.style.backgroundPosition ="52% 0%";
		document.controlaBg.bg.value = 1;
	}
	else{
		if(bg==2){
		document.body.style.backgroundImage="url(img/bgRosa.jpg)";
		document.body.style.backgroundAttachment = "Scroll";
		document.controlaBg.bg.value = 2;
		}
		else{
			if(bg==3){
				document.body.style.backgroundImage="url(img/bgFeira.jpg)";
				document.body.style.backgroundAttachment = "Fixed";
				document.body.style.backgroundPosition ="54% 0%";				
				document.controlaBg.bg.value = 3;
			}else{
				if(bg==4){
					document.body.style.backgroundImage="url(img/bgCafe.jpg)";
					document.body.style.backgroundAttachment = "Scroll";		
					document.controlaBg.bg.value = 4;
				}else{
					document.body.style.backgroundImage="url()";
					document.controlaBg.bg.value = 5;
				}
			}
		}
	}	
}

//função pros links internos
function irPara(url,sec){
	if(sec!=""){
		document.controlaBg.action = url+"?sec="+sec;
		document.controlaBg.submit();
	}else{
		document.controlaBg.action = url;
		document.controlaBg.submit();
	}
}

function irParaSec(sec){
		document.controlaBg.action = "index.php?sec="+sec;
		document.controlaBg.submit();
}

function irParaPg(pg){
	if(pg!=""){
		document.controlaBg.action = "index.php?pg="+pg;
		document.controlaBg.submit();
	}else{
		document.controlaBg.action = "index.php";
		document.controlaBg.submit();
	}
}

function irParaNov(nov){
		document.controlaBg.action = "index.php?nov="+nov;
		document.controlaBg.submit();
}

//preserva o background internamente
function mudaBgAutomaticamente(bg){
		mudaBg(bg);
}

//mouseover das imagens de fundo do site	
$(document).ready(function(){						   				   
	$("#backgrounds div").hover(			
		function(){
		  $(this).animate({ 
			height: "35px",
			}, 250 );
		}
		
	,
	
		function(){								 
		  $(this).animate({ 
			height: "14px",
			}, 250 );
		}
	
	);
});	


//responsavel pelas tootips da parte de downloads de background
$(document).ready(function(){
   
     // basic usage  
/*     $('a.normalTip').aToolTip();  */
       
     // fixed tooltip  
/*     $('a.fixedTip').aToolTip({  
         fixed: true  
     });  */
       
     // on click tooltip with custom content  
     $('a.clickTip1').aToolTip({  
		 clickIt: true,                     // set to true for click activated tooltip  
         closeTipBtn: 'aToolTipCloseBtn',    // you can set custom class name for close button on tooltip  
         fixed: true,                       // Set true to activate fixed position  
         inSpeed: 400,                       // Speed tooltip fades in  
         outSpeed: 100,                      // Speed tooltip fades out  
         tipContent: "<a href='img/bgDownload/1/1024x768.zip' target='_blank'>1024x768</a><br /><a href='img/bgDownload/1/1280x720.zip' target='_blank'>1280x720</a><br /><a href='img/bgDownload/1/1280x800.zip' target='_blank'>1280x800</a><br /><a href='img/bgDownload/1/1280x1024.zip' target='_blank'>1280x1024</a><br /><a href='img/bgDownload/1/1366x768.zip' target='_blank'>1366x768</a><br /><a href='img/bgDownload/1/1440x900.zip' target='_blank'>1440x900</a><br /><a href='img/bgDownload/1/1680x1050.zip' target='_blank'>1680x1050</a>",                     // Pass in content or it will use objects 'title' attribute  
         toolTipClass: 'aToolTip',           // Set custom class for tooltip  
         xOffset: -60,                         // x Position  
         yOffset: -5
     }); 
	 
	 $('a.clickTip2').aToolTip({  
		 clickIt: true,                     // set to true for click activated tooltip  
         closeTipBtn: 'aToolTipCloseBtn',    // you can set custom class name for close button on tooltip  
         fixed: true,                       // Set true to activate fixed position  
         inSpeed: 400,                       // Speed tooltip fades in  
         outSpeed: 100,                      // Speed tooltip fades out  
         tipContent: "<a href='img/bgDownload/2/1024x768.zip' target='_blank'>1024x768</a><br /><a href='img/bgDownload/2/1280x720.zip' target='_blank'>1280x720</a><br /><a href='img/bgDownload/2/1280x800.zip' target='_blank'>1280x800</a><br /><a href='img/bgDownload/2/1280x1024.zip' target='_blank'>1280x1024</a><br /><a href='img/bgDownload/2/1366x768zip' target='_blank'>1366x768</a><br /><a href='img/bgDownload/2/1440x900.zip' target='_blank'>1440x900</a><br /><a href='img/bgDownload/2/1680x1050.zip' target='_blank'>1680x1050</a>",                     // Pass in content or it will use objects 'title' attribute  
         toolTipClass: 'aToolTip',           // Set custom class for tooltip  
         xOffset: -60,                         // x Position  
         yOffset: -5
     });
	 
	 $('a.clickTip3').aToolTip({  
		 clickIt: true,                     // set to true for click activated tooltip  
         closeTipBtn: 'aToolTipCloseBtn',    // you can set custom class name for close button on tooltip  
         fixed: true,                       // Set true to activate fixed position  
         inSpeed: 400,                       // Speed tooltip fades in  
         outSpeed: 100,                      // Speed tooltip fades out  
         tipContent: "<a href='img/bgDownload/3/1024x768.zip' target='_blank'>1024x768</a><br /><a href='img/bgDownload/3/1280x720.zip' target='_blank'>1280x720</a><br /><a href='img/bgDownload/3/1280x800.zip' target='_blank'>1280x800</a><br /><a href='img/bgDownload/3/1280x1024.zip' target='_blank'>1280x1024</a><br /><a href='img/bgDownload/3/1366x768.zip' target='_blank'>1366x768</a><br /><a href='img/bgDownload/3/1440x900.zip' target='_blank'>1440x900</a><br /><a href='img/bgDownload/3/1680x1050.zip' target='_blank'>1680x1050</a>",                     // Pass in content or it will use objects 'title' attribute  
         toolTipClass: 'aToolTip',           // Set custom class for tooltip  
         xOffset: -60,                         // x Position  
         yOffset: -5
     });
	 
	 $('a.clickTip4').aToolTip({  
		 clickIt: true,                     // set to true for click activated tooltip  
         closeTipBtn: 'aToolTipCloseBtn',    // you can set custom class name for close button on tooltip  
         fixed: true,                       // Set true to activate fixed position  
         inSpeed: 400,                       // Speed tooltip fades in  
         outSpeed: 100,                      // Speed tooltip fades out  
         tipContent: "<a href='img/bgDownload/4/1024x768.zip' target='_blank'>1024x768</a><br /><a href='img/bgDownload/4/1280x720.zip' target='_blank'>1280x720</a><br /><a href='img/bgDownload/4/1280x800.zip' target='_blank'>1280x800</a><br /><a href='img/bgDownload/4/1280x1024.zip' target='_blank'>1280x1024</a><br /><a href='img/bgDownload/4/1366x768.zip' target='_blank'>1366x768</a><br /><a href='img/bgDownload/4/1440x900.zip' target='_blank'>1440x900</a><br /><a href='img/bgDownload/4/1680x1050.zip' target='_blank'>1680x1050</a>",                     // Pass in content or it will use objects 'title' attribute  
         toolTipClass: 'aToolTip',           // Set custom class for tooltip  
         xOffset: -60,                         // x Position  
         yOffset: -5
     });
 
});



//insere objeto flash
function insereFlash(arq,larg,alt){
	resultado = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+larg+"' height='"+alt+"' id='FlashID' title='Premiata Design'><param name='movie' value='swf/"+arq+".swf' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='swfversion' value='9.0.45.0' /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --><param name='expressinstall' value='Scripts/expressInstall.swf' /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type='application/x-shockwave-flash' data='swf/"+arq+".swf' width='"+larg+"' height='"+alt+"'><!--<![endif]--><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='swfversion' value='9.0.45.0' /><param name='expressinstall' value='Scripts/expressInstall.swf' /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' width='112' height='33' /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>";
	document.write(resultado);
}

function insereFlashEn(arq,larg,alt){
	resultado = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+larg+"' height='"+alt+"' id='FlashID2' title='Premiata Design'><param name='movie' value='../swf/"+arq+".swf' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='swfversion' value='9.0.45.0' /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --><param name='expressinstall' value='../Scripts/expressInstall.swf' /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type='application/x-shockwave-flash' data='../swf/"+arq+".swf' width='"+larg+"' height='"+alt+"'><!--<![endif]--><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='swfversion' value='9.0.45.0' /><param name='expressinstall' value='../Scripts/expressInstall.swf' /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' width='112' height='33' /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>";
	document.write(resultado);
}
