function textCounter(field,maxChars,spanName)
{
   var txtArea = document.getElementById(field)
   var strTemp = "";
    if (txtArea.value.length > maxChars)
    {
		alert("En fazla " + maxChars + " girebilirsiniz.");
		strTemp = txtArea.value.substring(0, maxChars);
		txtArea.value = strTemp;
    }
   document.getElementById(spanName).innerHTML = maxChars - txtArea.value.length;
}


function PopUp(url,width,height) {
	window.open(url,'','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width='+width+',height=' + height);
}

function warnUserOfDeletion(message) {
  if(confirm(message)) {
    return true;
  }
  else {
    return false;
  }
}

function PopUpDisplayS(imageName) {
	window.open('PhotoDisplaySmall.aspx?i=' + imageName,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=350,height=500');
}

var UniqueID = 314 // Make each link open in a new window 
var newWinOffset = 0 // Position of first pop-up

function PlayerOpen(soundfiledesc,soundfilepath) { 
	PlayWin = window.open('',UniqueID,'width=320,height=240,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus(); 

	var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY bgcolor='#FF9900'>"; 
	winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";


	winContent += "<OBJECT width='300' height='42'>"; 
	winContent += "<param name='SRC' value='" + soundfilepath + "'>";
	winContent += "<param name='AUTOPLAY' VALUE='true'>"; 
	winContent += "<param name='CONTROLLER' VALUE='true'>";
	winContent += "<param name='BGCOLOR' VALUE='#FF9900'>"; 
	winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#FF9900'></EMBED>";
	winContent += "</OBJECT>"; 


	/*
	winContent += "<object id='MediaPlayer1' width='320' height='240' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='application/x-oleobject' VIEWASTEXT><param name='URL' value='" + soundfilepath + "'><PARAM NAME='autostart' VALUE='1'><PARAM NAME='showcontrols' VALUE='1'><embed type='application/x-mplayer2' name='MediaPlayer' width='320' height='240' src='"+ soundfilepath + "' showcontrols='1'></embed></object>";
	*/
	
	winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='" + soundfilepath +"'>Dosyayi Indir</a></p>";
	winContent += "<FORM><DIV align='center'><INPUT type='button' value='Kapat' onclick='javascript:window.close();'></DIV></FORM>"; 
	winContent += "</body></HTML>"; 

	PlayWin.document.write(winContent); 
	PlayWin.document.close(); // "Finalizes" new window 
	UniqueID = UniqueID + 1 // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower 
} 

function LoadFlash(filename, width, height) {
	var flashUrl = filename;

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write('  <param name="movie" value="' + flashUrl + '" />');
	document.write('  <param name="quality" value="high" />');
	document.write('  <embed src="' + flashUrl + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
	document.write('</object>');
}

function LoadMovie(filename, width, height) {
	var movieUrl = filename;
	document.write('  <embed src="' + movieUrl + '" width="' + width + '" height="' + height + '"></embed>');
}

function LoadMovieQuicktime(filename, width, height) {
	var movieUrl = filename;
	document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="' + width + '" HEIGHT="' + height + '" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" VIEWASTEXT>');
	document.write(' <PARAM name="SRC" VALUE="' + movieUrl + '">');
	document.write(' <PARAM name="AUTOPLAY" VALUE="true">');
	document.write(' <PARAM name="CONTROLLER" VALUE="false">');
	document.write(' <EMBED SRC="' + movieUrl + '" WIDTH="' + width + '" HEIGHT="' + height + '" AUTOPLAY="true" CONTROLLER="false" PLUGINSPAGE="http://www.apple.com/quicktime/download/">');
	document.write(' </EMBED>');
	document.write(' </OBJECT>');
}

function LoadMovieMediaPlayer(filename, width, height) {
	var movieUrl = filename;
	document.write('<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT> ');
    document.write(' <PARAM name="autoStart" value="True"> ');
    document.write(' <PARAM name="URL" value="' + movieUrl + '"> ');
    document.write(' <PARAM name="rate" value="1"> ');
	document.write(' <PARAM name="balance" value="0"> ');
	document.write(' <PARAM name="enabled" value="true"> ');
	document.write(' <PARAM name="enabledContextMenu" value="true"> ');
	document.write(' <PARAM name="fullScreen" value="false"> ');
	document.write(' <PARAM name="playCount" value="1"> ');
	document.write(' <PARAM name="volume" value="100"> ');
	document.write('</OBJECT> ');
}

/*
function ShowProductDetailsPopUp(productID) {
	window.open('UrunDetay.aspx?prod=' + productID)
}
*/

/*
function PopUpDisplayS(imageName) {
	window.open('PhotoDisplaySmall.aspx?i=' + imageName,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=600');
}
*/

/*
function right(e) { 
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { 
		alert('ARKIN DESIGN GRAFIK TASARIM VE YAZILIM LTD.');return false; 
	} 
	return true; 
} 

document.onmousedown=right; 

if (document.layers) 
	window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right;
*/
