﻿var TimeToFade = 1000.0;

 
///
/// Disable Text Selection
///
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}
///
/// Add to Favorites
///
function addBookmark(){
//if (document.all)
window.external.AddFavorite("http://apps.appleiphone.ir","گالری برنامه ها - اپل آیفون دات آی آر")
}


///
/// Disable RightClick
///
function clickIE4(){
    if (event.button==2){
        alert(message);
        return false;
    }
}

function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
        if (e.which==2||e.which==3){
            alert(message);
            return false;
        }
    }
}

// SHAAHIN SCROLLER
function initializeScroller(id, dir) {
    var div = document.getElementById(id);

    div.scrollLeft = 0;
    if (div.scrollWidth > parseInt(div.style.width)) {
        scroll(id, dir);
    }
}
function scroll(id, dir) {
    
    var div = document.getElementById(id);
    var speed = 70;
    var scrWidth = div.scrollWidth - parseInt(div.style.width);
    if ((div.scrollLeft != scrWidth && dir == 1) || (div.scrollLeft != 0 && dir == -1)) {
        div.scrollLeft += dir;
        setTimeout("scroll('" + id + "'," + (dir) + ")", speed);
    }
    else {
        setTimeout("scroll('" + id + "'," + (-1 * dir) + ")", 500);
    }
}




function openPopup(url) {
    if (confirm("Are You sure?")) {
        window.open('/admin/censor.aspx?appid=' + url, 'name', 'height=100,width=400,left=50%,top=50%,resizable=no,scrollbars=no,toolbar=no,status=yes');
    }
}
