
var defaultMenuWidth="150px"
var linkset=new Array()
var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showAuthor(e, which, stars, status, website, memberid, makelesayisi, optWidth){
	strBody = '<table width="200" height="100" border="0" cellpadding="0" cellspacing="0"  class="table_border"><tr bgcolor="#666666"><td height="20" align="center"><div align="center"></div>'
	strBody = strBody + '<span class="ana_beyaz_yazi">' + which + '</span></td></tr><tr><td  align="center" bgcolor="#FFFFFF"> <table width="100%" border="0"><tr><td align="center">'
	for(i=0;i<stars;i++)
		strBody = strBody + '<img src="yazilimakademi_img/medalicon.png" width="17" height="25">'
	strBody = strBody + '</td></tr><tr><td height="20" align="center"><div align="center" class="copyright">' + status + '</div></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center" class="sublinks_siyah">Toplam ' + makelesayisi + ' makale yayinladi.</td>'
	strBody = strBody + '</tr><tr><td height="3"></td></tr><tr><td height="2" bgcolor="#DADADA"></td></tr><tr><td height="20" align="center"><a href="editor_detay.aspx?editor_id='+ memberid + '&name='+ which+ '" class="sublinks2">Edit&ouml;r Hakk&#305;nda</a></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center"><a href="iletisime_gec.aspx?user='+ memberid + '&name='+ which+ '" class="sublinks_siyah">&#304;leti&#351;ime ge&ccedil;mek i&ccedil;in t&#305;klay&#305;n&#305;z.</a></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center"><a href="yazarinmakaleleri.aspx?user='+ memberid + '&name='+ which+ '" class="sublinks_siyah">Yay&#305;nlad&#305;&#287;&#305; t&uuml;m makaleler</a></td>'
	strBody = strBody + '</tr></table></td></tr></table>'
	
	if (!document.all&&!document.getElementById)
	return
	clearhidemenu()
	menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
	menuobj.innerHTML=strBody
	menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
	menuobj.contentwidth=menuobj.offsetWidth
	menuobj.contentheight=menuobj.offsetHeight
	eventX=ie5? event.clientX : e.clientX
	eventY=ie5? event.clientY : e.clientY
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
	var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<menuobj.contentwidth)
	//move the horizontal position of the menu to the left by it's width
	menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
	else
	//position the horizontal position of the menu where the mouse was clicked
	menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
	//same concept with the vertical position
	if (bottomedge<menuobj.contentheight)
	menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
	else
	menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
	menuobj.style.visibility="visible"
	return false
}

function showTitle(e, which, optWidth){
		strBody = '<table width="200" height="100" border="0" cellpadding="0" cellspacing="0"  class="table_border"><tr bgcolor="#666666"><td height="20" align="center"><div align="center"></div>'
	strBody = strBody + '<span class="ana_beyaz_yazi">&nbsp;Mustafa Serhan URAS</span></td></tr><tr><td  align="center" bgcolor="#FFFFFF"> <table width="100%" border="0"><tr><td align="center">'
	strBody = strBody + '<img src="yazilimakademi_img/medalicon.png" width="17" height="25">'
	strBody = strBody + '</td></tr><tr><td height="20" align="center"><div align="center" class="copyright">Diamond (Site Yöneticisi) </div></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center" class="sublinks_siyah">Toplam 150 makale yayinladi.</td>'
	strBody = strBody + '</tr><tr><td height="20" align="center"><a href="http://www.serhanuras.com" class="sublinks2">http://www.serhanuras.com </a></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center"><a href="iletisime_gec.aspx?user=3" class="sublinks_siyah">Iletisime geçmek için tiklayin.</a></td>'
	strBody = strBody + '</tr><tr><td height="20" align="center"><a href="yazarinmakaleleri.aspx?user=3" class="sublinks_siyah">Yayinladigi tüm makaleler.</a></td>'
	strBody = strBody + '</tr></table></td></tr></table>'

	
	if (!document.all&&!document.getElementById)
	return
	clearhidemenu()
	menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
	menuobj.innerHTML=strBody
	menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
	menuobj.contentwidth=menuobj.offsetWidth
	menuobj.contentheight=menuobj.offsetHeight
	eventX=ie5? event.clientX : e.clientX
	eventY=ie5? event.clientY : e.clientY
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
	var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<menuobj.contentwidth)
	//move the horizontal position of the menu to the left by it's width
	menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
	else
	//position the horizontal position of the menu where the mouse was clicked
	menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
	//same concept with the vertical position
	if (bottomedge<menuobj.contentheight)
	menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
	else
	menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
	menuobj.style.visibility="visible"
	return false
}


function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu


function go(strlink){
    window.location= strlink;
}

 function trim(str) {
	return ltrim(rtrim(str, ' '), ' ');
    }
     
    function ltrim(str, chars) {
	    chars = chars || "\\s";
	    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
    }
     
    function rtrim(str, chars) {
	    chars = chars || "\\s";
	    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
    }
    
    function isEMailAddr(elem) {
        var str = elem.value;
        var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
        if (!str.match(re)) {
            
            setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
            return false;
        } else {
            return true;
        }
    }
