// Function scripts
document.onmousedown=noRightClick
document.onkeydown=keyWhat;
///////////////////////////
// uso geral 
////////////////////////////
function Trim(str){return str.replace(/^\s+|\s+$/g,"");}
////////////////////////////////////////////////////////

function conteudo(page,path_info) {
//  set_path_info (path_info);
  var serverPage = page;
  var areaID = "contentID";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}
function show_contato () {
 var serverPage = "contato.php";
  var areaID = "main";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}

//Conteudo para produto
function prodContent(page,path) {
  var serverPage = path+'conteudo/produtos/'+page+'.php?realod=true&ph='+path;
  var areaID = "contentID";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}
function show_acessorios (file) {
 var serverPage = "acessorios/"+file+".php";
  var areaID = "main";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}
function show_caracteristicas (file) {
 var serverPage = file+".php";
  var areaID = "main";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}
function show_catalogos (file) {
 var serverPage = "catalogos/"+file+".php";
  var areaID = "main";
  var str = "";
  processajax ("GET",serverPage,areaID, "");
}
function show_big (file) {
   var target = '../../includes/show_bigpicture.php?reload=true&file='+file;
   win = window.open(target,'PrintWindow','menubar=no,status=yes,location=no,width=700,height=400,resizable=yes,toolbar=no,scrollbars=yes');
   win.opener = self;
   win.window.focus();
}
function noRightClick(b) {
  if(((navigator.appName=="Microsoft Internet Explorer")&&(event.button > 1))
  ||((navigator.appName=="Netscape")&&(b.which > 1))){
  alert('Direitos Autorais Reservados - ACENT Rádio Comunicação');
  return false;
  }
}
function keyWhat(e){
   if (navigator.appName == 'Microsoft Internet Explorer') {                 
     if(event.keyCode == 17 ||event.keyCode == 18 ){ 
          alert("Direitos Autorais Reservados - ACENT Rádio Comunicação");
         return false;
     }
   }
}
function cotacao (CodProd) {
   var target = '../../contatoform1.php?reload=true&cot=1&cp='+CodProd;
   win = window.open(target,'WinCotacao','menubar=no,status=yes,location=no,width=480,height=520,resizable=yes,toolbar=no,scrollbars=yes');
   win.opener = self;
   win.window.focus();
}
function cotacao_produto (page) {
   var target = '../../contato/'+page;
   win = window.open(target,'WinCotacao','menubar=no,status=yes,location=no,width=480,height=580,resizable=yes,toolbar=no,scrollbars=yes');
   win.opener = self;
   win.window.focus();
}

function chgEspChar(valor){
	//Substituir caracteres especiais com acento para sem acento
var char_espin = ['à','è','ì','ò','ù','á','é','í','ó','ú','â','ê','î','ô','û','ä','ë','ï','ö','ü','ã','õ','ç','Ç','À','È','Ì','Ò','Ù','Á','É','Í','Ó','Ú','Â','Ê','Î','Ô','Û','Ä','Ë','Ï','Ö','Ü','Ã','Õ'];
var char_espout =['a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','a','o','c','C','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','A','O'];
var retorno = valor;
for (i=0;i<46;i++){
	while(retorno.indexOf(char_espin[i]) >= 0) retorno = retorno.replace(char_espin[i],char_espout[i]);
}

return retorno;
}

function bookmark(tipo){
   var titulo = unescape(document.title);
   while(titulo.indexOf(" ") >= 0) titulo = titulo.replace(" ","+");
   titulo = chgEspChar(titulo);
   switch (tipo) {
	   case "google" :
			target = "http://www.google.com/bookmarks/mark?op=edit&amp;bkmk="+window.location+"&title="+titulo;
    		win = window.open(target,'Wingoogle','menubar=yes,status=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes');
			break;			
	   case "yahoo" :
			target = "http://myweb2.search.yahoo.com/myresults/bookmarklet?t="+titulo+"&u="+window.location;
    		win = window.open(target,'WinYahoo','menubar=yes,status=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes');
			break;
	   case "winlive" :
			target = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;mkt=en-us&amp;url="+window.location+"&amp;title="+titulo;
    		win = window.open(target,'WinLive','menubar=yes,status=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes');
			break;
	   case "delicious" :
			target = "http://del.icio.us/post?url="+window.location+"&title="+titulo;
    		win = window.open(target,'WinDelicious','menubar=yes,status=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes');
			break;
	   case "digg" :
			target = "http://digg.com/submit?phase=2&url="+window.location+"&title="+titulo;
    		win = window.open(target,'WinDigg','menubar=yes,status=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes');
			break;
   }

    win.opener = self;
	win.window.focus();
	
}

