function OpenFoto(url){
	window.open("/foto.php?foto="+url,"foto","toolbar=0,location=no, top=0, left=0, directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=600");
}

function OpenSelected(uid){
	winN = window.open("/selected.php?uid="+uid,"selected","toolbar=0,location=no, top=0, left=0, directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=780,height=600");
	window.winN.focus();
}

function OpenURL(url){
	window.opener.location.href = url;
	window.opener.focus();
}

function Add(url){
	window.location.href = url;
	window.opener.location.reload(true);
}

function OpenAditionFoto(id){
	window.open("/adfoto.php?id="+id,"foto","toolbar=0,location=no, top=0, left=0, directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=600");
}

function regMe(tf) {
    document.getElementById('tf').value = tf;
    document.getElementById('fRegMe').submit();
}

function sendMe(tf) {
    document.getElementById('tf').value = tf;
    document.getElementById('fBasket').submit();
}

function openAnsw() {
    $('#rew_view').hide();
    $('#answ_blank').hide();
    $('#review').hide();
    
    $('#rew_blank').show();
    $('#answ_view').show();
    $('#ansers').show();
    
    return false;
}

function openRew() {
    $('#rew_view').show();
    $('#answ_blank').show();
    $('#review').show();
    
    $('#rew_blank').hide();
    $('#answ_view').hide();
    $('#ansers').hide();
    
    return false;
}

function doClipboard(txt) {
    if(window.clipboardData) { // IE
        window.clipboardData.setData("Text", txt);
    }
    else { // не IE
        var fc = document.getElementById("flashCopier");
        if(!fc) { // Элемент с "flashCopier" не существует
            fc = document.createElement("div"); // создаем
            fc.id = "flashCopier"; // добавляем id
            document.body.appendChild(fc); // добавляем созданный элемент к <body>
        }
        fc.innerHTML = '<embed src="/images_site/clipboard.swf" FlashVars="clipboard=' + // src="clipboard.swf" - путь к clipboard.swf
            encodeURIComponent(txt) +
            '" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    }
}
