﻿

//
//  Flowen 2010
//
//

function cxjs_go(p, q)
{
    var r = "default.aspx?p=" + p;
    if(q.length > 0)
    {
        r += "&q=" + escape(q);
    }
    return(r);
}

function cxjs_write_banner(w, h, p, q)
{
    var _out = "";
    _out += "<iframe frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"";
    _out += " height=\"" + h + "\"";
    _out += " width=\"" + w + "\" src=\"" + cxjs_go(p, q) + "\"><" + "/iframe>";
    document.write(_out);
}

function cxjs_showhide(divObj)
{
    if($(divObj).getStyle('visibility') == "hidden")
    {
        $(divObj).setStyle('visibility', 'visible');
        $(divObj).setStyle('display', 'block');
    }
    else
    {
        $(divObj).setStyle('visibility', 'hidden');
        $(divObj).setStyle('display', 'none');
    }
}

function cxjs_show(divObj)
{
    $(divObj).setStyle('visibility', 'visible');
    $(divObj).setStyle('display', 'block');
}


function cxjs_showback(backObj, op)
{
    var wx = $(document).getCoordinates().width;
    var wy = $(document).getCoordinates().height;
    var offsetx = 0; //$(document.body).getScroll().x;
    var offsety = 0; //$(document.body).getScroll().y;

    // Opacity
    $(backObj).setStyle('width', wx + 'px'); 
    $(backObj).setStyle('height', $(document.body).getScrollSize().y + 'px'); 
    $(backObj).setStyle('opacity', op); 
    $(backObj).setStyle('left', offsetx + 'px'); 
    $(backObj).setStyle('top', offsety + 'px');
    //
    cxjs_show(backObj);
}

function cxjs_hideback(backObj)
{
    $(backObj).set('tween', {duration: 400, transition:'linear'});
    $(backObj).tween('opacity', '0');  
}

function cxjs_switch(e1, e2)
{
    $(e1).setStyle("visibility", "visible");
    $(e1).setStyle("display", "block");
    //
    $(e2).setStyle("visibility", "hidden");
    $(e2).setStyle("display", "none");
}

function cxjs_querystring(str) {
   var q = window.location.search;
   var foundValue = ""
   if (q.length > 1) {
      this.q = q.substring(1, q.length);
   }
   this.keyValuePairs = new Array();
   if (q) {
      for (var i = 0; i < this.q.split("&").length; i++) {
         this.keyValuePairs[i] = this.q.split("&")[i];
         if (this.keyValuePairs[i].split("=")[0] == str) {
            foundValue = unescape(this.keyValuePairs[i].split("=")[1]);
         }
      }
   }
   return foundValue;
}


