﻿/*var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==ctrl){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==ctrl||e.which==ctrl){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.CTRLDOWN);
document.onctrldown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onctrldown=clickIE4;
}
document.oncontextmenu=new Function("return false")*/
function PlaySong(name, obj) {
    var so = new SWFObject("playerSingle.swf", name, "192", "67", "7", "#FFFFFF");
    so.addVariable("autoPlay", "no");
    so.addVariable("soundPath", name);
    so.write(obj);
}
function OpenCloseFiledSet(table) {
    var _table = document.getElementById(table);
    if (_table.style.display == "none") {
        _table.style.display = "block";
    }
    else {
        _table.style.display = "none";
    }
}
function OpenCloseGroupSetForum(table,img) {
    var _table = document.getElementById(table);
    var _img = document.getElementById(img);
    if (_table.style.display == "none") {
        _table.style.display = "block";
        _img.src = "/image/forum/collapse.gif";
    }
    else {
        _table.style.display = "none";
        _img.src = "/image/forum/expand.gif";
    }
}
function OkCancel() {
    if (confirm("آیا مطمئن هستید ؟")) {
        return true;
    }
    else {
        return false;
    }
}
function Change_Title_Color() {
    var LinkAdd = document.getElementById(control);
    //alert(LinkAdd.style.color);

    if (LinkAdd != null) {
        if (LinkAdd.style.color == color1) {
            LinkAdd.style.color = color2;
        }
        else {
            LinkAdd.style.color = color1;
        }
    }
}

function ShowPopUpWithScroll(url, width, height) {

    var left = (screen.width / 2) - (width / 2);
    var top = (screen.height / 2) - (height / 2);

    window.open(url, "", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + "");
}
function SetWindowPosition(window, width, height) {
    var left = (screen.availWidth / 2) - (width / 2);
    var top = (screen.availHeight / 2) - (height / 2);
    window.setPosition(left, top);
    window.setSize(width, height);
}
function copy_to_clipboard(text) {
    if (window.clipboardData) {
        window.clipboardData.setData('text', text);
    }
    else {
        var clipboarddiv = document.getElementById('divclipboardswf');
        if (clipboarddiv == null) {
            clipboarddiv = document.createElement('div');
            clipboarddiv.setAttribute("name", "divclipboardswf");
            clipboarddiv.setAttribute("id", "divclipboardswf");
            document.body.appendChild(clipboarddiv);
        }
        clipboarddiv.innerHTML = '<embed src="clipboard.swf" FlashVars="clipboard=' +
 encodeURIComponent(text) + '" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    }
    return false;
}
function fireEvent(obj, evt) {

    var fireOnThis = obj;
    if (document.createEvent) {
        var evObj = document.createEvent('MouseEvents');
        evObj.initEvent(evt, true, false);
        fireOnThis.dispatchEvent(evObj);
    } else if (document.createEventObject) {
        fireOnThis.fireEvent('on' + evt);
    }
}
