﻿2011-03


/* Description : Sayfada "divWMP" isimli bir DIV olmalıdır. */
	function Play(pURL){
		var objSender;
	
		try{
			objSender=event.srcElement;
		}catch(err){

		}
		
		var vol=60;		
    	var wmpDynamic = document.getElementById("wmpDynamic");
    	if (wmpDynamic){ 
    		try{
    			vol=wmpDynamic.settings.volume;
    			wmpDynamic.controls.stop();				
			}catch(ex){
			
			}
		}
	
		var strWMP="";
		if (objSender!=null){
			var	strTitle=objSender.innerText;
			strWMP = "<span id='spnTitle'><b>" + strTitle + "</b></span><br>";
		}
		
		
		var strWMP_More="";
		var strExt=pURL.substring(pURL.length-4, pURL.length).toLowerCase();
		var strServer = pURL.substring(0, 7).toLowerCase();
/*		
		if ((strServer=="http://") && (strExt==".mp3" || strExt==".wma" || strExt==".wmv")){
			strWMP_More += "<br><span id='spnDownload'><a onclick='alert(title)' title='Sağ tıklayıp, hedefi farklı kaydediniz.\n Right click and save target as...' target='_blank' rel='nofollow' href=\"" + pURL + "\">İndir/Download</a></span>";
		}else{
			strWMP_More += "<br><span id='spnDownload'>...</span>";
		}
		strWMP_More += " | <span id='spnInfo'><a onclick='alert(Play_Info())' href='#divWMP'>Bilgi/Info</a></span>";
	
		strWMP_More += " | <span id='spnEmbed'><a target='wndEmbed' style='cursor:hand' onclick='PopupWindow(&quot;./Core/Embed/EmbedWMP.aspx?Mode=ShowEmbedCode&URL=" + pURL + "&quot;)'>Sitene Ekle/Embed</a></span>";
*/
        var Boy=60;
        var En=320;
        if (strExt==".wmv"){
            Boy=320;
        }
		
		strWMP += "<OBJECT id='wmpDynamic' type='application/x-oleobject' height='" + Boy + "' width='" + En + "' classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'>";
		strWMP += '<PARAM NAME="URL" VALUE="' + pURL + '">';
		strWMP += "<PARAM NAME='autoStart' VALUE='-1'>";
		strWMP += "<PARAM NAME='volume' VALUE='" + vol + "'>";
		strWMP += "<embed id='wmpDynamic' autostart='-1' src='"+ pURL + "' height='" + Boy + "' width='" + En + "' border='0' type='application/x-mplayer2'/></embed>";
		strWMP += "</OBJECT>";
	
		strWMP += strWMP_More;
	
	//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=strWMP;
	
	}


	/* 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);
	    wForm.focus();

	    return wForm;
	}




	/* Description : İlgili elemanın görünüp, gizlenmesini sağlar. */
	function ToggleDisplay(pID_or_Obj) {
	    var obj = pID_or_Obj; //Nesne olarak kabul edilsin.

	    if (obj.length) { //Nesne uzunluğu tanımlı ise, ID olarak ele alınsın
	        //alert("obj length: " + obj.length);
	        obj = document.getElementById(pID_or_Obj);
	    }

	    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;
        }
    }
}

