﻿
function MuyapAlert(pURL) {
    var strHTML = "MÜ-YAP 'tan gelen ihtar üzerine ilgili parça erişimden kaldırılmıştır!<br>";
    //strHTML+= "Şayet bu çalışmanın <a target='_muyap' rel='nofollow' href='http://www.mu-yap.org/getdata.asp?PID=239'>MÜ-YAP repertuarında</a> olmadığından eminseniz, durumu bildirebilirsiniz!";
    strHTML += "Şayet bu çalışmanın MÜ-YAP repertuarında olmadığından eminseniz, durumu <a href='http://www.mbirgin.com/?Ctrl=Cevap&TopicID=1313&PageNo=-1&t=Seferberlik_ilani'><b>bildirebilirsiniz.</b></a>";
    
    //Alt kısım Aralık 2008 'de eklendi. "divWMP" elemanına bakılacak. Bulunamazsa, "divWMP_Common" elemanına bakılacak.
    var divTarget = document.getElementById("divWMP");
    if (!divTarget) {
        divTarget = document.getElementById("divWMP_Common");
    }
    divTarget.innerHTML = strHTML;
}


/* Description : Locate Popup page to center. */
	function PopupWindow(pURL, pH, pW) {
    //if (typeof pH == "undefined") pH = "default value";
    if (!pW) {
        pW = 320;
    }
    if (!pH) {
        pH = 250;
    }
    
	//window.status = '';
	var winleft = (screen.width - pW) / 2;
	var wintop = (screen.height - pH) / 2; 
	
	var args = "top=" + wintop + ", left=" + winleft + ", width=" + pW + ", height=" + pH + ", toolbar=0, menubar=0, scrollbars=0, status=-1, resizable=-1";

	var wForm = window.open(pURL,"wndPopup",args);

	return wForm;
}



/* Description : İlgili elemanın görünüp, gizlenmesini sağlar. */
function ToggleDisplay(pID) {

    var obj=document.getElementById(pID);
    
    if (obj==null) return;
    
    if (obj.style.display==''){
        obj.style.display='none';
    }else{
        obj.style.display=''; 
    }
}


/*İlgili nesnenin işlem yaptığını gösteren bir simge ekler */
function InProgress(pIDSource) {
    var objSource = document.getElementById(pIDSource);
    if (objSource != null) {
        objSource.className = "cssInProgress";
        objSource.disabled = true;
    }
}


/*Enter tuşuna basıldığında bir butona basar.*/
function CheckEnterKey(e, btnId) {
    var evt = e ? e : window.event;
    var btn = document.getElementById(btnId);
    if (btn) {
        if (evt.keyCode == 13) {
            btn.click();
            return false;
        }
    }
}



/*Büyük resimleri otomatik olarak küçültür */
function Resize_All_Big_Images() {
    var MaxWidth = 550;

    var Container = document.getElementById("MainContentCell");
    if (Container == null) { return; }
    
    var All_Images = Container.getElementsByTagName("img");
    //All_Images = document.images;
    
    for (var i = 0; i < All_Images.length; i++) {
        var TheImg = All_Images[i];  //document.images[x];

        var iHeight = TheImg.height;
        var iWidth = TheImg.width;

        if (iWidth > MaxWidth) {
            var Ratio = MaxWidth / iWidth;
            var NewHeight = Ratio * iHeight;
            var NewWidth = MaxWidth;
            TheImg.height = NewHeight;
            TheImg.width = NewWidth;
            //alert(Ratio);

            TheImg.style.cursor = 'crosshair';
            TheImg.onclick = function() {
                var picture = window.open(this.src);
                picture.focus();
                return false;
            }
        }
    }
}

window.onload = function() {Resize_All_Big_Images();}
