function create_tooltip(szContentID, szInnerHtml, szPosition, szAlign){
    szPosition = (typeof(szPosition) == 'undefined' ? 'top' : szPosition);
    szAlign = (typeof(szAlign) == 'undefined' ? 'center' : szAlign);
    
    var szInnerContent = szInnerHtml;
    
    $(document).ready(function(){
        $('#'+szContentID).CreateBubblePopup({
            position  : szPosition,
            align     : szAlign,
            innerHtml : szInnerContent.replace("[br]", "<br />").replace("[br]", "<br />").replace("[br]", "<br />").replace("[br]", "<br />"),
            innerHtmlStyle: {
                                color:'#FFFFFF', 
                                'text-align':'center'
                            },
            themeName:     'all-grey',
            themePath:     'http://universitetercihleri.com/js/jquerybubblepopup/jquerybubblepopup-theme'
        });
    });
}

function slide_onhover_div(idHover, idSlideDiv){
  $(document).ready(function(){
    $("#"+idHover).mouseenter(function(){
        $("#"+idSlideDiv+":hidden").slideDown("fast");
    }).mouseleave(function(){
        $("#"+idSlideDiv).fadeOut("fast");
    }).click(function(){
        if($("#"+idSlideDiv).is(':visible')){
            $("#"+idSlideDiv).fadeOut("fast");
        }else{
            $("#"+idSlideDiv).slideDown("fast");
        }
    });
  });
}

function prepare_nextdiv_slide(){
    jQuery(function(){
        $(".next_div_content").hide();
        $(".next_div").click(function(){
            $(this).toggleClass("active").next().slideToggle("fast");
        });
    });
}

function expand_div(szContentID, szHideAll){
    if ($("#"+szContentID).is(":hidden")){
        if(typeof(szHideAll) != 'undefined'){
            $("."+szHideAll).css("display", "none");
        }
        $("#"+szContentID).show();
    }else{
        if(typeof(szHideAll) != 'undefined'){
            $("."+szHideAll).css("display", "none");
        }
        $("#"+szContentID).hide();
    }
}

function expand_list(szRowID){
    jQuery(function(){
        if($(".expandTR_Content_"+szRowID).hasClass("activeExpand")){
            $(".expandTR_Content_"+szRowID).toggleClass("activeExpand").hide();
        }else{
            $(".expandTR_Content_"+szRowID).toggleClass("activeExpand").show();
        }
    });
}

function slide_to_div(divID){
    $.fn.scrollToElement = function(selector, callback) {
        var def = new $.Deferred(),
            el = this;

        $('html, body').animate({scrollTop: $(selector).offset().top}, 'slow', 'swing', def.resolve);

        if (callback) {
            def.promise().done(function(){
                callback.call(el);
            });
        }
    };

    $('html, body').scrollToElement('#'+divID);
}

function slide_divs(szSlideIndex){
    $(document).ready(function() {
        $(".select_play_list li a").removeClass('select');
        $("#"+szSlideIndex).addClass('select');
        $(".seltab_content").css("display", "none");
        $("#"+szSlideIndex+"_content").slideDown();
    });
}

function swf_upload_picture(szControlID, nMemberID, nGalleryID, szContainerID, szUploadScript){
    szUploadScript = (typeof(szUploadScript) == 'undefined' ? 'ddgallery' : szUploadScript);
    
    $(document).ready(function() {
        $('#'+szControlID).uploadify({
          'uploader'    : '/DD/uploadify/uploadify.swf',
          'script'      : '/'+szUploadScript+'/upload_picture/'+nGalleryID,
          'scriptData'  : {'PHPSESSID': sessionId},
          'cancelImg'   : '/DD/uploadify/cancel.png',
          'folder'      : '/tmp12f12f',
          'auto'        : true,
          'removeCompleted' : true,
          'buttonText'  : 'Resim Yukle',
          //'checkScript' : '/DD/uploadify/check.php',
          //'displayData' : 'speed',  //kb/s
          'fileExt'     : '*.jpg;*.gif;*.png',
          'fileDesc'    : 'Image Files',
          'queueSizeLimit': 10,
          'simUploadLimit': 1,
          'multi'       : true,
          'onComplete'  : function(event, ID, fileObj, response, data) {
              if(response !== '1'){
                  alert(response);
              }
              JQAjax(szUploadScript+'/add_picture/'+nGalleryID, szContainerID, 0, 1);
          }
        });
    });
}

function SetAsSelected(idContent){
    $(document).ready(function() {
        $("."+idContent+" a").click(function (event) {
            $("."+idContent+" a").removeClass('select');
            $(this).addClass('select');
        });
    });
}

function checkAll(field, checkAllControl){
    bCheck = checkAllControl.checked;
    for ( i = 0 ; i < field.length ; i++ ){
        field[i].checked = bCheck ;
    }
}
function selectCode(f){
    document.forms[f].elements[0].focus();
    document.forms[f].elements[0].select();
}
function changeScrollbarColor(C){
    if (document.all){
      document.body.style.scrollbarBaseColor = C
    }
}

