﻿function setCookie(cookie_name, value, expiredays) {
    var exdate = new Date()
    exdate.setDate(exdate.getDate() + expiredays)
    document.cookie = cookie_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
}

function getCookie(cookie_name) {
    if (document.cookie.length > 0) {
        cookie_start = document.cookie.indexOf(cookie_name + "=")
        if (cookie_start != -1) {
            cookie_start = cookie_start + cookie_name.length + 1
            cookie_end = document.cookie.indexOf(";", cookie_start)
            if (cookie_end == -1) cookie_end = document.cookie.length
            return unescape(document.cookie.substring(cookie_start, cookie_end))
        }
    }
    // 
    return ""
}

function checkCookie() {
    if (getCookie('ScreenWidth') == null || getCookie('ScreenWidth') == "") {
        setCookie('ScreenWidth', screen.width, 7)
    }
}

function CopyToClipboard(elmt) {
    elmt.focus();
    elmt.select();
    //
    CopiedTxt = document.selection.createRange();
    CopiedTxt.execCommand("Copy");
}


function MakeVerifyEmailBold() {
    for (i = 0; i < document.links.length; i++) {
        if (document.links[i].id == "UCNavBar_lbtnVerifyEmail") {
            UCNavBar_lbtnVerifyEmail.style.fontWeight = 'bold';
            UCNavBar_lbtnVerifyEmail.style.textDecoration = 'underline';
            UCNavBar_lbtnVerifyEmail.style.color = 'HotPink';
            return;
        }
    }
}


function MakeAddPhotoBold() {
    for (i = 0; i < document.links.length; i++) {
        if (document.links[i].id == "lbtnAddPhoto") {
            lbtnAddPhoto.style.fontWeight = 'bold';
            lbtnAddPhoto.style.textDecoration = 'underline';
            lbtnAddPhoto.style.color = 'LimeGreen';
            return;
        }
    }
}


function MakeJoinBold() {
    for (i = 0; i < document.links.length; i++) {
        if (document.links[i].id.indexOf("lbtnJoin") >= 0) {
            document.links[i].style.fontWeight = 'bold';
            document.links[i].style.textDecoration = 'underline';
            document.links[i].style.color = 'LimeGreen';
            return;
        }
    }
}


function forward() {
    if (window.history.forward() != null)
        window.history.forward();
}		

	
