function ClearTextbox(obj)
{
    myTextBox=document.getElementById(obj);
    
    if (myTextBox.value==myTextBox.defaultValue)
        myTextBox.value='';
    else
        if (trim(myTextBox.value,' ')=='')
            myTextBox.value=myTextBox.defaultValue;
}

function AddToFavorites(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
        
    return false;
}

function MakeHomepage()
{
    this.style.behavior='url(#default#homepage)';
    this.setHomePage('http://www.Akyazi.bel.tr');
    
    //document.setHomePage('http://www.Akyazi.bel.tr');
    
    return false;
}

function PrintContent(id)
{
    window.open('/Print.aspx?ID='+id,'Print','width=700, height=800, resizable=0, left=0, top=0, scrollbars=1');
    return false;
}

function PrintPharmacies()
{
    window.open('/PrintPharmacies.aspx','PrintPharmacies','width=700, height=800, resizable=0, left=0, top=0, scrollbars=1');
    return false;
}

function OpenMedia(id)
{
    window.open("/OpenMedia.aspx?ID=" + id, "PrintMedia", "width=700, height=800, resizable=0, left=0, top=0, scrollbars=1");
    void(0);
}

function OpenVideo(_file)
{
    window.open('/VideoPlayer.aspx?file='+_file,'Player','width=575, height=425, resizable=0, left=50, top=50');
}

function OpenFile(_file)
{
    window.open('/'+_file,'Popup','width=595, height=500, resizable=0, left=50, top=50');
}

// Trim Function
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
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"), "");
}
// Trim Function

function TenderDetail(tenderId)
{
    var page = "/TenderDetail.aspx?TenderId="+tenderId;
    window.open(page, 'TenderDetail', 'left=0, top=0, location=0, scrollbars=1, resizable=0, width=800, height=700');
}
