﻿
function ShowFlash(url, width, height)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '" VIEWASTEXT>');
    document.write('<param name="movie" value="' + url + '">');
    document.write('<param name="quality" value="high">');
    document.write('<param name="wmode" value="transparent">');
    document.write('<param name="wmode" value="window">');
    document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
    document.write('</object>');
}

function GetQueryStr(key, defaultVal)
{
    if (defaultVal == null) defaultVal = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return defaultVal;
    else
        return qs[1];
}

function setCookie(name, value, expiredays)
{
    var todayDate = new Date();
    todayDate.setDate(todayDate.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";";
}

function getCookie(name)
{
    var search = name + "=";
    var cookie = document.cookie;

    if (cookie.length > 0)
    {
        startIndex = cookie.indexOf(name);
        if (startIndex != -1)
        {
            startIndex += name.length;
            endIndex = cookie.indexOf(";", startIndex);
            if (endIndex == -1) endIndex = cookie.length;
            return unescape(cookie.substring(startIndex + 1, endIndex));
        }
        else
        {
            return null;
        }
    }
    else
    {
        return null;
    }
}

function deleteCookie(name)
{
    var expireDate = new Date();
    expireDate.setDate(expireDate.getDate() - 1);
    document.cookie = name + "=" + "; expires = " + expireDate.toGMTString() + "; path=/";
}
