// JavaScript Document
function desabilitar(){
//	alert('oi');
	return false;
}


document.oncontextmenu=desabilitar;



function iniciaProduto(){
	Effect.toggle("productWindow","appear");
	Effect.toggle("productWindowBg","appear");
	Effect.toggle("seta","appear");
	Effect.toggle("leftProduct2","appear");
	Effect.toggle("leftProduct2","appear");			
}
openSite = function(x){
	var altura = screen.availHeight;
	var largura = screen.availWidth;
	window.open("/sarakali/"+x+"/inicial.asp","janela","width="+largura+",height="+altura+",scrollbars=yes");
}
goTo = function(x){
	if(x=="voltar"){
		parent.history.go(-1);	
	}
	else{
		x = x.replace(/[;]/g,"/");
		var pagina = x;		
		pagina = pagina.toLowerCase();
		location.href="/sarakali/"+pagina+".asp";		
	}
	
}

var globalCounter = 0;
slideReset = function(){
	new Effect.Appear("foto",{duration:1.0});
	setTimeout("slide('foto')",1000);
}

size = function (){
	//setTimeout("slide("foto")",100);
}
slide = function (imgId){
	new Effect.Move(imgId,{x:200,y:0,duration:3.8});
	setTimeout("switchImages('foto','foto2')",3800);
	if (globalCounter==1){
		new Effect.Move("foto2",{x:-200,y:0,duration:0.1});
	}
	globalCounter = globalCounter>=0?1:0;		
}
switchImages = function(imgId,imgId2){
	new Effect.Fade(imgId,{duration:1.0});
	setTimeout("appearImage2('"+imgId2+"')",1000);
}
appearImage2 = function (imgId){
	new Effect.Appear(imgId,{duration:1.0});
	setTimeout("slide2('foto2'),1000");
}
fade2= function(){
	new Effect.Fade("foto2",{duration:3.8})
	new Effect.Move("foto",{x:-200,y:0,duration:0.1});

	setTimeout("slideReset()",3800);
}
slide2 = function(imgId){
	new Effect.Move(imgId,{x:200,y:0,duration:3.8});
	setTimeout("fade2()",3800);

}
closeProduct = function(){
	new Effect.Fade("productWindowBg",{duration:1.0})
	new Effect.Fade("productWindow",{duration:1.0})
}
openProduct = function(){
	new Effect.Appear("productWindowBg",{duration:1.0})
	new Effect.Appear("productWindow",{duration:1.0})
}

closeEstampa = function(){
	new Effect.Fade("estampaWindow",{duration:1.0})
}

switchEstampa = function(x){
	Element.update("rightEstampa","<img src='images/estampas/grande/estampa'+x+'.jpg' alt='Estamapa'>");
}


showEstampas = function(){
	new Effect.Appear("estampaWindow",{duration:1.0})
}


setBg = function(x){
	$("img").style.background='url('+x+')';
}

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

