﻿// JScript File
//Author:    
//Date:       02/10/2008
//Purpose:  Funções diversas

var internalstrImage;
var internalstrClass;
var janela;

/* Liberando acesso https*/
	if(document.location.href.indexOf("https://") != -1)
	{
		document.location.href = document.location.href.replace("https://", "http://");
	}
	else if(document.location.href.indexOf("HTTPS://") != -1)
	{
		document.location.href = document.location.href.replace("HTTPS://", "HTTP://");
	}



    /* Open Image RadWindow */
    function ShowImage(strImage, strClass)
    {        

        try{ 
		internalstrImage = strImage;
		internalstrClass = strClass;

		if (document.getElementById('divCarregando').style.setAttribute) { //IE
		    document.getElementById('divCarregando').style.setAttribute('display', 'block');
		}
		else { //firefox
		    document.getElementById('divCarregando').setAttribute('style', 'display:block'); //firefox
		}
		window.setTimeout('ShowImage2()', 5000);
     
        }
            catch(e)
            {
              
            }
           
           return false;
    }


    /* Open Image RadWindow */
    function ShowImage2()
    {
        try{ 
	
       var strServer = "http://164.109.24.194/purina/dogchow/dia_do_cachorro/"; 
        var janela = window.radopen(((internalstrClass == "fotoshorizontal") ? strServer + "wfGetFoto.aspx" + internalstrImage: strServer + "wfGetFotoVert.aspx" + internalstrImage ), null);
        if(internalstrClass  == "fotoshorizontal")
                   janela.SetSize(623,548);
        else
                    janela.SetSize(468,700);

           janela.Restore();
           janela.Top = 1;
           janela.MoveTo(janela.GetLeftPosition(), "10%");
           if (document.getElementById('divCarregando').style.setAttribute) { //IE
               document.getElementById('divCarregando').style.setAttribute('display', 'none'); //IE
           }
           else { //firefox
               document.getElementById('divCarregando').setAttribute('style', 'display:none'); //firefox
           }
        }
            catch(e)
            {
              
            }
           
           return false;
    }




//Pop up 
function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}


