﻿// JScript File
// Open the big map on Localização channel
// PRODUCAO
//var strNormalHost = "http://192.168.12.13/MontebeloGolfe/";
var strNormalHost = "http://www.golfemontebelo.pt/site/";
var strSecureHost = "https://www.visabeiraturismo.pt/secure/mhs/";
var strHostName = "www.golfemontebelo.pt";
// var strHostName = "192.168.12.13";

function openMap( number )
{
    if ( number == 1 ) {
        dmapaP.style.display='block';
        dmapaP.style.visibility='visible';
        dmapaR.style.display='none';
        dmapaR.style.visibility='hidden';        
    }
    else if ( number == 2 ) {
        dmapaP.style.display='none';
        dmapaP.style.visibility='hidden';
        dmapaR.style.display='block';
        dmapaR.style.visibility='visible';
    }

    try{
        xmlhttp1 = new XMLHttpRequest();
    }catch(ee){
        try{
            xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
                xmlhttp1 = false;
            }
        }
    }

    if ( number == 1 ) {
        window.location.hash = 'MP';    
        xmlhttp1.open("GET", "Content.aspx#MP",true);
    }
    else if ( number == 2 ) {
        window.location.hash = 'MR';    
        xmlhttp1.open("GET", "Content.aspx#MR",true);
    }

    xmlhttp1.onreadystatechange=function() {
        if (xmlhttp1.readyState==4){ 
        }
    }
    xmlhttp1.send(null)
    
    var txtTitle = window.document.title;
    var txtUrl = window.location.href;
    
    if ( number == 1 ) {
        if (txtTitle.indexOf("#MP") > 0)
           window.document.title = 'Golfe Montebelo';
        else if (txtUrl.indexOf("#MP") > 0)
            window.document.title = 'Golfe Montebelo';
    }
    else if ( number == 2 ) {
        if (txtTitle.indexOf("#MR") > 0)
           window.document.title = 'Golfe Montebelo';
        else if (txtUrl.indexOf("#MR") > 0)
            window.document.title = 'Golfe Montebelo';
    }
}


// Jump from FAQS
function jumpFAQs( number )
{
    try {
        xmlhttp1 = new XMLHttpRequest();
    }
    catch(ee) {
        try {
            xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            try {
                xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(E) {
                xmlhttp1 = false;
            }
        }
    }

    switch ( number ) {
        case 0:        
            window.location.hash = 'faqTop';    
            xmlhttp1.open("GET", "Content.aspx#faqTop",true);
            break;
    
        case 1:        
            window.location.hash = 'P1';    
            xmlhttp1.open("GET", "Content.aspx#P1",true);
            break;
        case 2:        
            window.location.hash = 'P2';    
            xmlhttp1.open("GET", "Content.aspx#P2",true);
            break;
        case 3:        
            window.location.hash = 'P3';    
            xmlhttp1.open("GET", "Content.aspx#P3",true);
            break;
        case 4:        
            window.location.hash = 'P4';    
            xmlhttp1.open("GET", "Content.aspx#P4",true);
            break;
        case 5:
            window.location.hash = 'P5';    
            xmlhttp1.open("GET", "Content.aspx#P5",true);
            break;
        case 6:
            window.location.hash = 'P6';    
            xmlhttp1.open("GET", "Content.aspx#P6",true);
            break;
    }
        
    xmlhttp1.onreadystatechange=function() {
        if (xmlhttp1.readyState==4){ 
        }
    }
    xmlhttp1.send(null)
    
    var txtTitle = window.document.title;
    var txtUrl = window.location.href;
    
    if (txtTitle.indexOf("#faqTop") > 0 || txtTitle.indexOf("#P1") > 0 || txtTitle.indexOf("#P2") > 0 || txtTitle.indexOf("#P3") > 0 || txtTitle.indexOf("#P4") > 0 || txtTitle.indexOf("#P5") > 0 || txtTitle.indexOf("#P6") > 0)
       window.document.title = 'Golfe Montebelo';
    else if (txtUrl.indexOf("#faqTop") > 0 || txtUrl.indexOf("#P1") > 0 || txtUrl.indexOf("#P2") > 0 || txtUrl.indexOf("#P3") > 0 || txtUrl.indexOf("#P4") > 0 || txtUrl.indexOf("#P5") > 0 || txtUrl.indexOf("#P6") > 0 )
        window.document.title = 'Golfe Montebelo';
}

function openMenu(openItem)
{    
}

function setCookie(c_name,value,expiredays) {
    var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1)
        { 
        c_start=c_start + c_name.length+1; 
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
        } 
      }
    return "";
}


function displayContent(contentid)
{
    setCookie('canalid',contentid,1);

    var txtTitle = window.document.title;
    var txtUrl = window.location.href;

    if ( getCookie('canalid') == 1)
    {
        if ( txtUrl.indexOf("#MP") > 0 || txtUrl.indexOf("#MR") > 0 || txtUrl.indexOf("#pagePhoto") > 0 || txtUrl.indexOf("#faqTop") > 0 || txtUrl.indexOf("#P1") > 0 || txtUrl.indexOf("#P2") > 0 || txtUrl.indexOf("#P3") > 0 || txtUrl.indexOf("#P4") > 0 || txtUrl.indexOf("#P5") > 0 || txtUrl.indexOf("#P6") > 0 ) {
            window.document.title = 'Golfe Montebelo';
        }
    }
    
    if(contentid.toString()!="0")
    {
        displayPath(contentid);
        var content = document.getElementById("content");
        content.innerHTML = loadingMsg;
        var strContent = "";
        try{
            xmlhttp1 = new XMLHttpRequest();
        }catch(ee){
            try{
                xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
            }catch(e){
                try{
                    xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
                }catch(E){
                    xmlhttp1 = false;
                }
            }
        }

        xmlhttp1.open("GET", "Content.aspx?contentid="+contentid,true);
        xmlhttp1.onreadystatechange=function() {
            if (xmlhttp1.readyState==4){ 
                //building the content
               strContent = xmlhttp1.responseText.toString();
               content.innerHTML = strContent;     
               
               if (strContent.indexOf("ReNameTitle") != -1 )
                    window.document.title = 'Golfe Montebelo';                    
               resetTitle();
            }
        }
        xmlhttp1.send(null)
    }
    else
    {
        var content = document.getElementById("content");
        content.innerHTML = "";
        resetTitle();
    }
}

function openMenuAndDisplayContentWithSearch(channelid,contentid, searchStr)
{
    openMenuAndDisplayContent(channelid,contentid + "&searchStr="+searchStr)
    fillTxtSearch();
}

//This function is used to display content and open the side menu in once
function openMenuAndDisplayContent(channelid,contentid)
{
    /*
    alert(channelid.toString());
    alert(contentid.toString());
    */
    
    if(contentid.toString() != "0")
    {
        // SE É 28 não mostra conteúdo e só banners
        if ( ( channelid.toString() != "0" ) || ( channelid.toString() != "28" ) )
            displayBanners(channelid);
        else 
        { 
            displayBanners(0);
        }
    
        openMenu(channelid);

        displayContent(contentid);

        if ( channelid.toString() != "28" ) {
            resizeFlash('diminuir'); 

            document.getElementById("dvHome").style.display = "block";
            document.getElementById("dvHome").style.visibility = "visible";
            document.getElementById("dvHomeLoop").style.display = "none";
            document.getElementById("dvHomeLoop").style.visibility = "hidden";
            
            if ( ( navigator.appName.indexOf("Microsoft") !=-1 ) || ( navigator.appVersion.indexOf("MSIE") != -1 )) {
                var flashObj = getFlashMovie("home");
		/*
                if (channelid.toString() == "9" || channelid.toString() == "10" ||
                    channelid.toString() == "11" || channelid.toString() == "38" ||
                     channelid.toString() == "39" || channelid.toString() == "40" ||
                     channelid.toString() == "42" || channelid.toString() == "54" ||
                     channelid.toString() == "53") 

                    flashObj.SetVariable("imgToLoad", channelid + ".swf");
                  

                else
		*/
                    flashObj.SetVariable("imgToLoad", channelid + ".jpg");
                              
            } 
            
            else if ( ( navigator.appName == "Netscape" ) || ( navigator.userAgent.indexOf("Firefox") != -1 )) {
		/*
                if ( channelid.toString() == "9" || channelid.toString() == "10" || 
                    channelid.toString() == "11" || channelid.toString() == "38" || 
                     channelid.toString() == "39" || channelid.toString() == "40" || 
                     channelid.toString() == "42" || channelid.toString() == "54" ||
                     channelid.toString() == "53" )
                     
                    document.getElementById('objHomeFF').innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='802' height='293' id='homeFF'><embed src='swf/home.swf?imgToLoad="+ channelid + ".swf' loop='false' menu='false' quality='high'  width='802' height='213' name='homeFF' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' wmode='transparent'  swLiveConnect='true' /></object>";
                else */
                    document.getElementById('objHomeFF').innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='802' height='293' id='homeFF'><embed src='swf/home.swf?imgToLoad="+ channelid + ".jpg' loop='false' menu='false' quality='high'  width='802' height='213' name='homeFF' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' wmode='transparent'  swLiveConnect='true' /></object>";
            }
            
        }
        else if ( channelid.toString() == "28" ) {
            document.getElementById("dvHomeLoop").style.display = "block";
            document.getElementById("dvHomeLoop").style.visibility = "visible";            
             document.getElementById("dvHome").style.display = "none";
             document.getElementById("dvHome").style.visibility = "hidden";
            var flashObj = getFlashMovie("home_loop");
            resizeFlash('aumentar');
        }


    }
}


function posLayers()
{
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
            winW = window.innerWidth;
            document.getElementById("banners").style.left = (winW/2)-225;
        }
        else if (navigator.appName.indexOf("Microsoft")!=-1) {
            winW = document.body.offsetWidth;
            document.getElementById("banners").style.left = (winW/2)-225;
        }
        else
        {
        }
    } 
}

function posLayersReserves()
{
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
            winW = window.innerWidth;
        }
        else if (navigator.appName.indexOf("Microsoft")!=-1) {
            winW = document.body.offsetWidth;
        }
        else
        {
        
        }
    }
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;


function openMenuFlash(channelid)
{
    var flashObj = getFlashMovie("menuflash");
    if(navigator.appName.indexOf("Microsoft") > -1)
    {
        flashObj.sendTextToFlash(channelid);
    }
}

function getFlashMovie(movieName) {
    var flashObj = (document[movieName] == null) ? window[movieName] : document[movieName];
    return flashObj;
}


function menuflash_DoFSCommand(command, args) 
{
    var sampleFlaMovieObj = getFlashMovie("menuflash");
    
    if (command == "openMenuAndDisplayContent")
    {
        var args1 = args.split(",");
        openMenuAndDisplayContent(args1[0],args1[1]);
    }
    if (command == "closeDiv")
    {
        closeDiv();
    }
    if (command == "openDiv")
    {
        openDiv();
    }
}

function resizeFlash(command) 
{
    var sampleFlaMovieObj;
        
    if (command == "aumentar")
    {
        document.getElementById("tdTopImg").style.height = 293;
        
        if ( ( navigator.appName.indexOf("Microsoft") !=-1 ) || ( navigator.appVersion.indexOf("MSIE") != -1 )) {
            sampleFlaMovieObj = getFlashMovie("home");
            sampleFlaMovieObj.height = 293;
        }
        document.getElementById("dvBoxLeft").style.height = 278;
    }
    if (command == "diminuir")
    {
        if ( ( navigator.appName.indexOf("Microsoft") !=-1 ) || ( navigator.appVersion.indexOf("MSIE") != -1 )) {
            document.getElementById("tdTopImg").style.height = 213;
            sampleFlaMovieObj = getFlashMovie("home");
            sampleFlaMovieObj.height = 213;
            document.getElementById("dvBoxLeft").style.height = 200;
        } 

        if ( ( navigator.appName == "Netscape" ) || ( navigator.userAgent.indexOf("Firefox") != -1 )) {
            if ( navigator.userAgent.indexOf("Safari") != -1 )
            {
                document.getElementById("tdTopImg").style.height = 213 + 'px';
                document.getElementById("dvHome").style.height = 213 + 'px';
                document.getElementById("dvBoxLeft").style.height = 198 + 'px';
                document.getElementById("tdLeftBox").style.height = 198 + 'px';
            }
            
            if ( navigator.userAgent.indexOf("Firefox") != -1 ) {
                document.getElementById("tdTopImg").style.height = 213 + 'px';
                document.getElementById("dvHome").style.height = 213 + 'px';
                document.getElementById("dvBoxLeft").style.height = 198 + 'px';
                document.getElementById("tdLeftBox").style.height = 198 + 'px';
            }
        }
    }
}

// Hook for Internet Explorer
if (navigator.appName && 
  navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && 
  navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write(
    'Sub menuflash_FSCommand(ByVal command, ByVal args)\n');
  document.write(
    ' call menuflash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}

function openDiv()
{
     //document.getElementById("menu").style.clip = "rect(auto auto auto auto)"; 
}

function closeDiv()
{
    document.getElementById("menu").style.clip = "rect(auto auto 50 auto)"; 
}

function displayPath(contentid)
{
    //alert(contentid);
    var strPath = "";
    try{
        xmlhttp2 = new XMLHttpRequest();
    }catch(ee){
        try{
            xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
                xmlhttp2 = false;
            }
        }
    }

    xmlhttp2.open("GET", "Path.aspx?contentid="+contentid,true);
    xmlhttp2.onreadystatechange=function() {
        if (xmlhttp2.readyState==4){ 
            //building the path
           strPath = xmlhttp2.responseText.toString();
           var path = document.getElementById("path");
           path.innerHTML = strPath;
           //alert(strPath);
        }
    }
    xmlhttp2.send(null)
}


//Function used to set the language links style
function markLang(lang)
{
    document.getElementById("but"+lang).className = "selectedLang";
}


function openSearch(searchStr,channelid,contentid)
{
    openMenuAndDisplayContent(channelid,contentid + "&searchStr="+searchStr)
    fillTxtSearch();
}

function changeSearchImg()
{
    document.getElementById("imgSearch").src = "imgs/arrow_search_hover.gif";
}

function resetSearchImg()
{
    document.getElementById("imgSearch").src = "imgs/arrow_search.gif";
}
function fillTxtSearch()
{
    
    document.getElementById("txtSearch").value = searchMsg;
    //align the search button in firefox
    if(navigator.appName.indexOf("Microsoft") == -1)
    {
        document.getElementById("imgSearch").style.paddingBottom="2";
    }
}
function resetTxtSearch()
{
    document.getElementById("txtSearch").value = "";
}

function openAvailability(channelid,contentid,players,holes,services,checkin)
{ 
     var now = new Date();
     var strD = now.getDate();
     var strDD = (strD < 10) ? '0' + strD : strD;
     var strM = now.getMonth() + 1;
     var strMM = (strM < 10) ? '0' + strM : strM;
     var strYear = now.getYear();
     var strDate = strYear + "-" + strMM + "-" + strDD;

    var msg = new String('');
    var lang = "";
    lang = document.getElementById("hidLang").value;

    if ( checkin == "" ) {
	    if ( lang == 'pt' ) {
		    msg = msg + 'A Data não pode ser vazia' + '\n' 
        }		    
        else if ( lang == 'en' ) {
		    msg = msg + 'The Date field cannot by empty' + '\n' 
        }		    
        else if ( lang == 'sp' ) {
		    msg = msg + 'El campo Fecha no puede ser vacía' + '\n' 
        }		    
	}  

    if ( checkin != ""  ) {	    
        if (checkin < strDate) {
	        if ( lang == 'pt' ) {
		        msg = msg + 'A Data é inferior da data hoje.' + '\n'
            }		    
            else if ( lang == 'en' ) {
		        msg = msg + 'O Date field is lower than today\'s date.' + '\n'
            }		    
            else if ( lang == 'sp' ) {
		        msg = msg + 'El campo Fecha es inferior a la fecha de hoy.' + '\n'
            }		    
        }
    }
	
    if (msg != '')	{
	    if ( lang == 'pt' ) {
		    alert(msg);
        }		    
        else if ( lang == 'en' ) {
		    alert(msg);
        }		    
        else if ( lang == 'sp' ) {
		    alert(msg);		
        }		    
	    return;
	}
    else {    
        openMenuAndDisplayContent(channelid,contentid + "&players=" + players + "&holes=" + holes + "&services=" + services + "&checkin=" + checkin )
    }
}

function openAvailabilityWithContact(channelid,contentid)
{ 
    openMenuAndDisplayContent(channelid,contentid)
}

function openPics(channelid,contentid,parentid)
{
    document.location.href= "#pagePhoto";
    document.getElementById("pagePhoto").style.display = 'block';    
    
    var txtTitle = window.document.title;
    var txtUrl = window.location.href;
    
    if (txtTitle.indexOf("#pagePhoto") > 0)
       window.document.title = 'Golfe Montebelo';
    
}

function openMovie(channelid,contentid,parentid)
{
    openMenuAndDisplayContent(channelid,contentid + "&parentid="+parentid)
}

function openView360(channelid,contentid,parentid)
{
    openMenuAndDisplayContent(channelid,contentid + "&parentid="+parentid)
}

//Function that calls and display the html of the banners at the bottom of the page
function displayBanners(channelid)
{

    var strBanners = "";
    try{
        xmlhttp3 = new XMLHttpRequest();
    }catch(ee){
        try{
            xmlhttp3 = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
            try{
                xmlhttp3 = new ActiveXObject("Microsoft.XMLHTTP");
            }catch(E){
                xmlhttp3 = false;
            }
        }
    }
    
    if ((channelid.toString() != 0) && (channelid.toString() != 28) )
    {
        document.getElementById("banners").style.visibility = 'hidden';
        document.getElementById("banners").style.display = 'none';    
        xmlhttp3.open("GET", strNormalHost + "Banners.aspx?channelid=" + channelid + "&v=0");
    }
    else {
        document.getElementById("banners").style.visibility = 'visible';
        document.getElementById("banners").style.display = 'block';    
    
        xmlhttp3.open("GET", "Banners.aspx?channelid=0&v=1");    
    }

    xmlhttp3.onreadystatechange=function() {
        if (xmlhttp3.readyState==4){ 
            //building the menu
           strBanners = xmlhttp3.responseText.toString();

           var banners = document.getElementById("banners");
           banners.innerHTML = strBanners;
        }
    }
    xmlhttp3.send(null)        
}

function resetTitle()
{
    var txtTitle = window.document.title;
    var txtUrl = window.location.href;
    
    if ( txtUrl.indexOf("#MP") > 0 || txtUrl.indexOf("#MR") > 0 || txtUrl.indexOf("#pagePhoto") > 0 || txtUrl.indexOf("#faqTop") > 0 || txtUrl.indexOf("#P1") > 0 || txtUrl.indexOf("#P2") > 0 || txtUrl.indexOf("#P3") > 0 || txtUrl.indexOf("#P4") > 0 || txtUrl.indexOf("#P5") > 0 || txtUrl.indexOf("#P6") > 0 ) {
        window.document.title = 'Golfe Montebelo';
    }
}

function applyForSelectedTournament(tournamentid,channelid,contentid)
{

  //  openMenuAndDisplayContent(channelid,contentid + "&tournamentid="+tournamentid);
}

function openDetailedTournament(tournamentid,channelid,contentid)
{
/*
    alert(tournamentid.toString());
    alert(channelid.toString());
    alert(contentid.toString());
    
*/
    //openMenuAndDisplayContent(channelid,contentid + "&tournamentid="+tournamentid);
}

function insertIt() { 
/*
    var _y = document.getElementById('dvControlo'); 
    var _x = window.frames[0].document.body.innerHTML; 
    _y.innerHTML = _x;
*/
}

function OpenScoringCard( number )
{
	if  ( number == "1" ) {
		document.getElementById("PercursoCaramulo").style.display = "block";		
		document.getElementById("PercursoCaramulo").style.visibility = "visible";		
		document.getElementById("PercursoEstrela").style.display = "none";		
		document.getElementById("PercursoBucaco").style.display = "none";		
	}
	if  ( number == "2" ) {
		document.getElementById("PercursoCaramulo").style.display = "none";
		document.getElementById("PercursoEstrela").style.display = "block";
		document.getElementById("PercursoEstrela").style.visibility = "visible";				
		document.getElementById("PercursoBucaco").style.display = "none";		
		
	}
	if  ( number == "3" ) {
		document.getElementById("PercursoCaramulo").style.display = "none";	
		document.getElementById("PercursoEstrela").style.display = "none";
		document.getElementById("PercursoBucaco").style.display = "block";
		document.getElementById("PercursoBucaco").style.visibility = "visible";						
	}
}


function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

var fixEmbeddedVideo = function(embedCode) {
   if(embedCode && embedCode.toLowerCase().indexOf('classid') == -1) {
      var objPos = embedCode.toLowerCase().indexOf('object') + 'object'.length;
      return embedCode.substr(0, objPos) + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″' + embedCode.substr(objPos);
   } else {
      return embedCode;
   }
}

function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,50); 
    }
}

function makeWindow(img)
{ 	
    ht = picfile.height + 20;
    wd = picfile.width + 20; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    // return window.open(img, 'Imagem', args); 
    
	var popurl="SpecialPages/image.aspx?image=" + img
	winpops = window.open(popurl,"Imagem",args)
    
} 

function openPopUp(strPath) {

    picfile = new Image(); 
    picfile.src =(strPath); 
    fileCheck(strPath); 
}
