﻿
    function ShowImage(url, w, h)  
    {

      if (w > screen.width || h > screen.width)
      {
        if (w > screen.width && h <= screen.height)
        {
          var nw = screen.width - 70;
          var nh = parseInt(h) + 36
        }
        if (h > screen.height && w <= screen.width)
        {
          var nh = screen.height - 70;
          var nw = parseInt(w) + 36
        }
        if (w > screen.width && h > screen.height)
        {
          var nh = screen.height - 70;
          var nw = screen.width - 70;
        }

        window.open(url,"_blank","width=" + nw + ",height=" + nh + ",left=0,top=0,scrollbars=yes,resizable=yes");

      }
      else
      {
        var nh = parseInt(h) + 25;
        var nw = parseInt(w) + 25;
        window.open(url,"_blank","width=" + nw + ",height=" + nh + ",scrollbars=no,resizable=no");
      }
    }


function dialogImage(txtName)
{
	var elm = document.getElementById( txtName )
	var html = showModalDialog("/Common/FCKEditorV2/editor/dialog/kh_image.html", elm, "dialogWidth:" + 400 + "px;dialogHeight:" + 420 + "px;help:no;scroll:no;status:no");
	// The response is the IMG tag HTML
	if (html != null)
		elm.value = html ;
}

function pencereac(adres,w,en,boy,Icerik)
{
window.open(adres,'','width='+en+', height='+boy+' ,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,resizable=no,status=no,copyhistory=no' );
//document.write(Icerik);
}

function ShowHelp(div, title, desc)
{
	div.style.display = 'inline';
	div.style.position = 'absolute';
	div.style.width = '200';
	div.style.backgroundColor = '#D7EBFF';
	div.style.border = 'dashed 1px black';
	div.style.padding = '10px';
	div.innerHTML = '<b>' + title + '</b><br><div style="padding-left:10; padding-top:5; padding-right:5">' + desc + '</div>';
}
	function HideHelp(div)
{
	div.style.display = 'none';
}

function ShowPreview(div, StartTag, title, EndTag)
{
	div.style.display = 'inline';
	div.style.position = 'absolute';
	div.style.backgroundColor = '#D7EBFF';
	div.style.border = 'solid 1px black';
	div.innerHTML = StartTag + title.toUpperCase() + EndTag;
}
	function HidePreview(div)
{
	div.style.display = 'none';
}

function ExpandMenu(item)
{
    window.setTimeout("ToggleMenu('" + item + "')",0);
    window.setTimeout("ToggleMenu('" + item + "_img1')",0);
    window.setTimeout("ToggleMenu('" + item + "_img2')",0);
    window.setTimeout("ToggleMenu('" + item + "_show')",0);
}
function GetItem(ItemId) {
    var item;
    if (document.all) {
        item = document.all[ItemId];		        
    }
    if (!document.all && document.getElementById) {
        item = document.getElementById(ItemId);		        
    }
    return item;
}
function GetMenuState(itemId) {
    var item = GetItem(itemId);	        
    return item.style.display;
}

function ToggleMenu(itemId) {
    var itemstate = GetMenuState(itemId);
    if (itemstate == "none") {		        
        itemstate = "inline";
    }
    else {
        itemstate = "none";		
    }
    GetItem(itemId).style.display=itemstate;
}
