﻿
shown=''
function OpenFile(url) 
{
  if( shown=='' || shown.closed) 
  {
    shown=window.open(url,'OpenFile','scrollbars=yes, fullscreen=yes, status=no, high, resizable=yes ');
    if (window.focus) {shown.focus()}
  }
  else
  { 
    shown.close();
    shown=window.open(url,'OpenFile','scrollbars=no,status=no, high,width=300,height=300');
  }
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function closeAll(e, id)
{
  if (id=='portfolio_div')
  {
    document.getElementById('services_div').style.display  = 'none';
    createCookie('services_div_menu_show',0, 0);  
    document.getElementById('creative_div').style.display  = 'none';
    createCookie('creative_div_menu_show',0, 0);
  }
  
  if (id=='services_div')
  {
    document.getElementById('portfolio_div').style.display  = 'none';
    createCookie('portfolio_div_menu_show',0, 0);
    document.getElementById('creative_div').style.display  = 'none';
    createCookie('creative_div_menu_show',0, 0);
  }

  if (id=='creative_div')
  {  
    document.getElementById('portfolio_div').style.display  = 'none';
    createCookie('portfolio_div_menu_show',0, 0);
    document.getElementById('services_div').style.display  = 'none';
    createCookie('services_div_menu_show',0, 0);  
  }
  
  if (id=='all')
  {
    document.getElementById('portfolio_div').style.display  = 'none';
    createCookie('portfolio_div_menu_show',0, 0);
    document.getElementById('services_div').style.display  = 'none';
    createCookie('services_div_menu_show',0, 0);  
    document.getElementById('creative_div').style.display  = 'none';
    createCookie('creative_div_menu_show',0, 0);    
  }

}

function ddm3(e,id) 
{
//  alert(e.className);
  if (document.getElementById(id).style.display  == 'block') 
  {
        document.getElementById(id).style.display  = 'none';
    createCookie(id+'_menu_show',0, 0);
    } 
  else 
  {
        document.getElementById(id).style.display = 'block';
    createCookie(id+'_menu_show',1, 0);
    }
}

var wo;   

function showPhoto(id, width, height) {
//  picture = "../images/photo/" + photo;
  if (wo==1) { 
    w1.close(); 
    wo=0; 
  }
  w1=window.open("image_"+id+".htm", "w1","width="+width+",height="+height+",toolbar=0, status=0, location=0, menubar=0, directories=0, scrollbars=1, resizable=1"); 
  wo=1;
  
  return true;  
}


function confirmLink(theLink, theSqlQuery)
{
  //alert(theLink);
  //alert(theSqlQuery);
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery + ' ?');
    if (is_confirmed) {
//        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function