﻿// JScript File

//On hover image change

function changeImgSrc(imgid, srcto){
  var elm = document.getElementById(imgid)
  elm.src =  srcto;
} 

function openAdminWindow(url){
    window.open(url,"dialog","menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=no,width=600,height=500,alwaysRaised=yes");   
}

function openFromDialog(url){
    parent.window.opener.location = url;
    window.close("dialog"); 
}


function ConfirmMessage(message) {
    boolReturn = confirm(message);
    if (boolReturn)
        return true;
    else
        return false;
}

function HiglightBox(dropdown){
    var myindex  = dropdown.selectedIndex;
    var SelValue = dropdown.options[myindex].text ;
    var i = 0;
    while (dropdown.options[i] != null){
        el = document.getElementById('holder'+dropdown.options[i].text);
        el.setAttribute("class", "");
        i++; 
    }   
    el = document.getElementById('holder'+SelValue);
    el.setAttribute("class", "selectedHolder");
}

function set_cookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function get_cookie(name) {
    var name_eq = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(name_eq) == 0) return c.substring(name_eq.length,c.length);
    }
    return null;
}