/**
 * Needed for Baird Framework...
 */
var version = "0.0.1";

/* Common script used to find anything anywhere by its id and return that element
 * @PARAM n = the elemend id value to look for
 * @PARAM d = the document or frame to look in
 */
function findObj(n, d) {
  var p,i,x;
  if(!d){d=document;}
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }
  for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[n];
  if(!x && d.getElementById)
    x=d.getElementById(n);
  return x;
}

/* Global function to show mesages in the browser's status bar */
function displaySBMsg(msgStr){window.status=msgStr;return true;}

/* TODO: Generalize this function */
function setFieldValue(elem, val){
    var text = "What do you think?  Type your feedback here and then hit Submit.";
    if(val == false && elem.value == text ){
        elem.value = "";
        //document.getElementById("feedbackArea").style.height="125px";
        //elem.style.height="80px";
        }
    else if (val == true && elem.value == "" ){
        //elem.style.height="20px";
        //document.getElementById("feedbackArea").style.height="47px";
        elem.value = text;
        }
}//feedbackArea

function submitFeedbackForm(){
    var text = "What do you think?  Type your feedback here and then hit Submit.";
    var warn = "Please Type your feedback first, then hit Submit!";
    var obj = document.getElementById("data");
    if(obj.value.length >0 && obj.value == text ){
        alert(warn);
        return;
    }
    else{
        //alert('you said ' + obj.value);
		jslogInfo(obj.value);
		alert('Thanks for your comments!');
        ///window.frames['player'].feedbackSubmit(document.forms['feedback']);
        //document.getElementById("data").style.height="20px";
        //document.getElementById("feedbackArea").style.height="47px";
        document.getElementById("data").value=text;
        //new Effect.BlindUp('fbInfo');
    }
}

function popUpWindow( filename , title , windowHeight , windowWidth , scroll, options)
{
    var ScrollBar = 0;
    var strOptions = "";
    if(typeof(scroll) != "undefined"){
        if (scroll == "yes" || scroll == "Yes")
            ScrollBar = 1;
    }

    var features = "top=20,left=20,alwaysRaised=1,resizable=yes,scrollbars=" + ScrollBar;
    if(typeof(windowWidth) != "undefined"){
        if( windowWidth && windowWidth > 0 )
            features += ",width=" + windowWidth;
        else
            features += ",width=550";
    }

    if(typeof(windowHeight) != "undefined"){
        if( windowHeight && windowHeight > 0 )
            features += ",height=" + windowHeight;
        else
            features += ",height=585";
    }

    if ( typeof(options) != "undefined" && options && options != " " )
    {
        var strChopList = options.split( ",");
            strOptions = "?";
        for (count = 0 ; count < strChopList.length; count++ )
          strOptions = strOptions + "&" + strChopList[ count ];
    }
    if( typeof(title) != "undefined" ||!title )
        title = "SlackerWindow";

    if( top.window.popupWindow && ! top.window.popupWindow.closed )
        top.window.popupWindow.close();


    if(arguments.length != popUpWindow.length) {
        top.window.popupWindow=window.open(filename, title, "");
    }
    else{
        top.window.popupWindow=window.open(filename + strOptions, title, features);
    }
    void(0);
}

function emThis(pref,text,subj){
    var s = "@";
    var d = "slacker";
    var e = "com";
    document.write("<a href=\"mailto:"+pref+s+d+"."+e+"?subject="+escape(subj)+"\">"+text+"</a>");
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);

      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  }
}


//document.onload = MM_CheckFlashVersion('8,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?');



var io = new Image();
var pageAction, price, sku, order_code, currency_id, user_defined1, user_defined2, user_defined3, user_defined4, ic_cat, ic_bu, ic_bc, ic_ch, ic_nso, altid, ic_type, urlA, prefix;
function pixel(){var icstring =".ic-live.com/goat.php?cID=1498&cdid=4935&campID=8";var refVar = (document.referrer);var locURL = location.href;var locHttp = locURL.split(":")[0];if (!pageAction) { pageAction = 0; };if (!price) { price=""; }if (!sku) { sku=""; }if (!order_code) { order_code=""; }if (!user_defined1) { user_defined1=""; }if (!user_defined2) { user_defined2=""; }if (!user_defined3) { user_defined3=""; }if (!user_defined4) { user_defined4=""; }if (!currency_id) { currency_id=""; }if (!ic_bu) { ic_bu=""; }if (!ic_bc) { ic_bc=""; }if (!ic_ch) { ic_ch=""; }if (!ic_nso) { ic_nso=""; }if (!altid) { altid=""; }if (!ic_cat) { ic_cat=""; }if (!ic_type) { ic_type=""; }if (locHttp.toLowerCase( ) == "https")  { prefix="https://www"+icstring+"";}if (locHttp.toLowerCase( ) == "http")  { prefix="http://1498"+icstring+"";}if (pageAction > 0) { urlA = prefix+"&convID="+pageAction+"&convP="+price+"&curID="+currency_id+"&ordID="+escape(order_code)+"&ud1="+escape(user_defined1)+"&ud2="+escape(user_defined2)+"&ud3="+escape(user_defined3)+"&ud4="+escape(user_defined4)+"&ic_cat="+escape(ic_cat)+"&ic_type="+escape(ic_type)+"&ic_bu="+escape(ic_bu)+"&ic_bc="+escape(ic_bc)+"&ic_ch="+escape(ic_ch)+"&ic_nso="+escape(ic_nso)+"&altid="+escape(altid)+"&sku="+escape(sku)+"&refVar="+escape(refVar); } else { urlA = prefix+"&ic_cat="+escape(ic_cat)+"&ic_type="+escape(ic_type)+"&ic_bu="+escape(ic_bu)+"&ic_bc="+escape(ic_bc)+"&ic_ch="+escape(ic_ch)+"&ic_nso="+escape(ic_nso)+"&altid="+escape(altid)+"&refVar="+escape(refVar); }	 io.src = urlA; } 
/* 
 * To activate this code initialize with the following in the bodyOnload;
 * pixel();
 */
