/***********************************************************************
Rakpanel v1.0
(Audio Panel using Plugins,HTML  DOM and JavaScript for IE/FIREFOX/NETSCAPE)

Author: Hirak Chatterjee
Date: 02/09/2006

Note: All variables related to Rakpanel are named as 'rak_variablename' and all related functions are named as 'rak_functionName'.



************************************************************************/
//Audio Functions

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


function setvol(currvol)
		{
		
			//alert(currvol);
if (currvol == 0) document.rakpanel.Volume=-10000;
if (currvol == 1) document.rakpanel.Volume=-2200;
if (currvol == 2) document.rakpanel.Volume=-1500;
if (currvol == 3) document.rakpanel.Volume=-1100;
if (currvol == 4) document.rakpanel.Volume=-750;
if (currvol == 5) document.rakpanel.Volume=-500;
if (currvol == 6) document.rakpanel.Volume=-320;
if (currvol == 7) document.rakpanel.Volume=-150;
if (currvol == 8) document.rakpanel.Volume=-80;
if (currvol == 9) document.rakpanel.Volume=0;
	
		}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function startplay()
{
	 var brw = rak_brw.browser;
	var ver = rak_brw.version;
	ie = !!document.uniqueID;
	nn = (brw.indexOf('Netscape') != -1) ? true : false;
	if (((ie && ver >=4) || (nn && ver >=4)) && !isNN8){

		try{
			document.rakpanel.play();
			document.getElementById("mic").src = "http://img.123greetings.com/images/audiopanel/img/mic1.gif";
			document.getElementById("m_on").src = "http://img.123greetings.com/images/audiopanel/img/on_d.gif";
			document.getElementById("m_off").src = "http://img.123greetings.com/images/audiopanel/img/off_e.gif";
			musicIsStop = false;
		}catch(ex){}
	}
	
	//document.getElementById("cardimage").src = card_path;


	
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function stopplay()
{
   var brw = rak_brw.browser;
	var ver = rak_brw.version;
	ie = !!document.uniqueID;
	nn = (brw.indexOf('Netscape') != -1) ? true : false;
	if (((ie && ver >=4) || (nn && ver >=4)) && !isNN8){

		try{
			document.rakpanel.pause();
			//document.rakpanel.stop();
			document.getElementById("mic").src = "http://img.123greetings.com/images/audiopanel/img/mic2.gif";
			document.getElementById("m_on").src = "http://img.123greetings.com/images/audiopanel/img/on_e.gif";
			document.getElementById("m_off").src = "http://img.123greetings.com/images/audiopanel/img/off_d.gif";
			musicIsStop = true;
		}catch(ex){}
	}
	
	
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function volup()
{
				
if( currvol < 9 )
	{
		currvol=currvol+1;
		setvol(currvol);
		
	}							
				
			
}
	

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */			
function voldown()
{
				
if( currvol > 0 ) 
	{	
		currvol=currvol-1;
		setvol(currvol);
		
	}							
				
			
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


	var currvol=9;
	


/*************************************************************************/

//Rakpanel setup variables.

/***********************************************************************/
var knobWidth = 6;

var slider=new Array();
slider[1]=new Object();
slider[1].min=0;
slider[1].max=9;
slider[1].val=9;
slider[1].onchange=setvol;
var activeSlider=-1;
var card_path;
var slider_top;
var musicIsStop = false;



function init_rakpanel()
{
 
//to fix size in netscape

var ie = !!document.uniqueID;
var nn = (rak_brw.browser.indexOf('Netscape') != -1) ? true : false;
if (((ie && rak_brw.version >=4) || (nn && rak_brw.version >=4)) && !isNN8) { //check provided for click card
var ie = (!!document.uniqueID) ? true : false;


	rak_attachSliderEvents();
	rak_addAnEvent(document, 'mousemove', rak_sliderMouseMove);
	var card = document.getElementById("cardimage");
	

	card_path = card.src;	
	card_width = parseInt(card.offsetWidth);
	//alert(card_width);
	//document.getElementById("rak_media").style.border = '1px solid red';
	document.getElementById("audio_panel_holder").style.position ='relative';	
	document.getElementById("rak_media").style.align='center';
	if(!ie)
	{
		
		document.getElementById("audio_panel_holder").style.width = eval(card_width - 2)+'px';
		document.getElementById("rak_media").style.width = eval(card_width - 2)+'px';	

		/*if((card_width-2) >= 300){
			document.getElementById("rak_media").style.paddingLeft= Math.ceil(card_width/10) + "px";
		}else{
			document.getElementById("rak_media").style.paddingLeft="2px";
			var panel = eval(rak_findPosX(document.getElementById("audio_panel_holder")) + document.getElementById("audio_panel_holder").offsetWidth);

			panel = panel - 100;

			document.getElementById("slider01").style.left = panel + 'px';			
			//document.getElementById("slider01").style.left = eval(rak_findPosX(document.getElementById("slider01")) - 5)+'px';		
		}*/
		document.getElementById("rak_media").style.paddingRight="50px";

	}else{
		document.getElementById("audio_panel_holder").style.width = card_width;
		//document.getElementById("rak_media").style.width = card_width;
		//document.getElementById("rak_media").style.paddingRight="50px";

	}
	document.getElementById("audio_panel_holder").style.visibility = "visible";
	document.getElementById("audio_panel_holder").style.borderStyle = "solid";
	document.getElementById("audio_panel_holder").style.borderWidth = 1;
	document.getElementById("audio_panel_holder").style.borderColor = 'red';
	


	try {
	    document.getElementById("audio_panel_holder").style.borderColor = fontcolor;
	}catch (e){}	
	
//slider fix
	var brw = rak_brw.browser;
	var ver = rak_brw.version;
	ie = !!document.uniqueID;
	nn = (brw.indexOf('Netscape') != -1) ? true : false;
	if (((ie && ver >=4) || (nn && ver >=4)) && !isNN8){

			try{
			var elem = document.getElementById("slider01");
			elem.style.visibility = "visible";
			//elem.style.position = "absolute";
			elem.style.cursor = "pointer";
			
			
			var top = rak_findPosY(document.getElementById("rak_media"));
					
			if(ie){
				elem.style.top = (top + 5) + 'px';
			}else{
				//alert('aaaa');
				elem.style.top = (top + 7) + 'px';
			}
				
			}catch(ex){}
	}
	//slider_top=document.getElementById("rak_media").offsetTop;
	
	//fixSlider();
	}
}//end of init_rakpanel()

function hide_slider(){
var brw = rak_brw.browser;
	var ver = rak_brw.version;
	ie = !!document.uniqueID;
	nn = (brw.indexOf('Netscape') != -1) ? true : false;
	if (((ie && ver >=4) || (nn && ver >=4)) && !isNN8){

		try{
			var elem = document.getElementById("slider01");
			elem.style.visibility = "hidden";
		}catch(ex){}
	}
}




/***********************************************************************/
//Rakpanel slider functions

/***********************************************************************/
function rak_addAnEvent(el, evname, func) {
    if (el.attachEvent) { // IE
        el.attachEvent("on" + evname, func);
    } else if (el.addEventListener) { // Gecko / W3C
        el.addEventListener(evname, func, true);
    } else {
        el["on" + evname] = func;
    }
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

//Function to move the knob of the given slider as per the value stored in slider.val

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function rak_moveKnob(slider)
{
	
	
	var knob=slider.getElementsByTagName('img')[0];
	
	var p=(slider.val-slider.min)/(slider.max-slider.min);
	

	var x=(slider.scrollWidth-knobWidth)*p;

	knob.style.left=x+"px";
	
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function rak_setKnobByClientX(slider, clientX) {
     
    //alert("clientX = " + clientX + " scrollWidth = " + slider.scrollWidth);


	var p=(clientX-rak_findPosX(slider))/(slider.scrollWidth-knobWidth);
	
	
	slider.val=(slider.max-slider.min)*p + slider.min;


	slider.val = Math.round(slider.val);
	

	if (slider.val>slider.max) slider.val=slider.max;
	if (slider.val<slider.min) slider.val=slider.min;

	rak_moveKnob(slider);

	slider.onchange(slider.val, slider.num);
	
}

/************************************************************************/

function rak_sliderClick(e) {

	var el=rak_sliderFromEvent(e);
	if (!el) return;

	rak_setKnobByClientX(el, e.clientX);
	
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function rak_sliderMouseMove(e) {
	var el=rak_sliderFromEvent(e);
    var slider_right;
	var slider_left;
	
   




	if (!el) return;
	if (activeSlider<0) return;


	slider_right = document.getElementById(el.id).offsetLeft + document.getElementById(el.id).offsetWidth;
	slider_left = document.getElementById(el.id).offsetLeft + 2;
 

	if(e.clientX >= slider_right) activeSlider = -1;
	if(e.clientX <= slider_left) activeSlider = -1;
	
	
   

	rak_setKnobByClientX(el, e.clientX);
	rak_stopEvent(e);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function rak_sliderFromEvent(e) {
	if (!e && window.event) e=window.event;
	if (!e) return false;

	var el;
	if (e.target) el=e.target;
	if (e.srcElement) el=e.srcElement;
	
		
	if (!el.id || !el.id.match(/slider\d+/)) el=el.parentNode;
	if (!el) return false;
	if (!el.id || !el.id.match(/slider\d+/)) return false;
	
	
	return el;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function rak_attachSliderEvents() {
	var divs=document.getElementsByTagName('div');
	var divNum;
	for(var i=0; i<divs.length; i++) {
		if (divNum=divs[i].id.match(/\bslider(\d+)\b/)) {
			divNum=parseInt(divNum[1]);
			divs[i].min=slider[divNum].min;
			divs[i].max=slider[divNum].max;
			divs[i].val=slider[divNum].val;
			divs[i].onchange=slider[divNum].onchange;
			divs[i].num=divNum;

			rak_addAnEvent(divs[i], 'mousedown', function(e){
				rak_sliderClick(e);
				var el=rak_sliderFromEvent(e);
				if (!el) return;
				activeSlider=el.num;
				rak_stopEvent(e);
			});
			rak_addAnEvent(divs[i], 'mouseup', function(e){
				var el=rak_sliderFromEvent(e);
				if (!el) return;
				activeSlider=-1;
				rak_stopEvent(e);
			});
			
		}
	}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

function rak_findPosX(obj) 
{ 
var curleft = 0; 
if (obj.offsetParent) 
{ 
while (obj.offsetParent) 
{ 
curleft += obj.offsetLeft 
obj = obj.offsetParent; 
} 
} 
else if (obj.x) 
curleft += obj.x; 
return curleft; 
} 


function rak_findPosY(obj) 
{ 
var curtop = 0; 
if (obj.offsetParent) 
{ 
while (obj.offsetParent) 
{ 
curtop += obj.offsetTop 
obj = obj.offsetParent; 
} 
} 
else if (obj.y) 
curtop += obj.y; 
return curtop; 
} 
/* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * */

function rak_stopEvent(event) {
	if (event.preventDefault) {
		event.preventDefault();
		event.stopPropagation();
	} else {
		event.returnValue=false;
		event.cancelBubble=true;
	}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */







/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function rak_enumMimeType()
{
	
	var  mimeType = "application/x-mplayer2"; //default	
	var agt = navigator.userAgent.toLowerCase();
	var is_mac = (agt.indexOf("mac")!=-1);

	with (navigator){
		if (mimeTypes && !(agt.indexOf("windows")!=-1 && agt.indexOf("windows 3.1")==-1)) {
		 //non-IE, no Windows
			var plugin = mimeTypes["audio/mpeg"].enabledPlugin;			
			if (plugin) mimeType = "audio/mpeg"	 //mac/Safari mimeType = "audio/mpeg"
			else {
				plugin = mimeTypes["audio/mpeg-url"].enabledPlugin;				
				if (plugin) mimeType = "audio/mpeg-url" // non-IE 2nd favorite (Linux/FF) 
			}			
		}//end no-Windows 
	}//end with (navigator)	
	
	return mimeType;

}

/****************************************************************************/
// Functions for browsser and plugin detection
/***************************************************************************/
// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.


<!--
// initialize global variables
var detectableWithVB = false;
var pluginFound = false;
var haveQt = false;
var haveWm = false;
var haveRm = false;
var objectHtml;





function canDetectPlugins() {
    if( detectableWithVB || (navigator.plugins && navigator.plugins.length > 0) ) {
	return true;
    } else {
	return false;
    }
}



function detectQuickTime() {
    pluginFound = detectPlugin('QuickTime');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectQuickTimeActiveXControl();
    }
    return pluginFound;
}

function detectReal() {
    pluginFound = detectPlugin('RealPlayer');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = (detectActiveXControl('rmocx.RealPlayer G2 Control') ||
		       detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||
		       detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));
    }	
    return pluginFound;
}

function detectWindowsMedia() {
    pluginFound = detectPlugin('Windows Media');
    // if not found, try to detect with VisualBasic
    if(!pluginFound && detectableWithVB) {
	pluginFound = detectActiveXControl('MediaPlayer.MediaPlayer.1');
    }
    return pluginFound;
}

function detectPlugin() {
    // allow for multiple checks in a single pass
    var daPlugins = detectPlugin.arguments;
    // consider pluginFound to be false until proven true
    var pluginFound = false;
    // if plugins array is there and not fake
    if (navigator.plugins && navigator.plugins.length > 0) {
	var pluginsArrayLength = navigator.plugins.length;
	// for each plugin...
	for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
	    // loop through all desired names and check each against the current plugin name
	    var numFound = 0;
	    for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
		// if desired plugin name is found in either plugin name or description
		if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 
		    (navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
		    // this name was found
		    numFound++;
		}   
	    }
	    // now that we have checked all the required names against this one plugin,
	    // if the number we found matches the total number provided then we were successful
	    if(numFound == daPlugins.length) {
		pluginFound = true;
		// if we've found the plugin, we can stop looking through at the rest of the plugins
		break;
	    }
	}
    }
    return pluginFound;
} // detectPlugin
// Here we write out the VBScript block for MSIE Windows
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');

    document.writeln('\'and the following function handles QuickTime');
    document.writeln('Function detectQuickTimeActiveXControl()');
    document.writeln('  on error resume next');
    document.writeln('  detectQuickTimeActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('    detectQuickTimeActiveXControl = False');
    document.writeln('    hasQuickTimeChecker = false');
    document.writeln('    Set hasQuickTimeChecker = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');
    document.writeln('    If IsObject(hasQuickTimeChecker) Then');
    document.writeln('      If hasQuickTimeChecker.IsQuickTimeAvailable(0) Then ');
    document.writeln('        detectQuickTimeActiveXControl = True');
    document.writeln('      End If');
    document.writeln('    End If');
    document.writeln('  End If');
    document.writeln('End Function');

    document.writeln('</scr' + 'ipt>');


}

/****************************************************************************/
//Image loading Functions
/****************************************************************************/
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*************************************************************************/
//Function to Load Music
/************************************************************************/
function LoadMusic(midi_url)
{
	if(midi_url != ''){
		//If MSIE\NETSCAPE and WINDOWS MEDIA PLAYER LOAD PANEL
		
		navigator.plugins.refresh(); 
		var wm = detectWindowsMedia();
		var ie = !!document.uniqueID;
		var nn = (rak_brw.browser.indexOf('Netscape') != -1) ? true : false;
		var panelHtml;
		var card_width;
		var card_left;


		if (((ie && rak_brw.version >=4) || (nn && rak_brw.version >=4)) && !isNN8)
		{
		
			panelHtml = "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' type='audio/x-midi' width='0' height='0' vspace='0' border='0' id='rakpanel'>";
			panelHtml = panelHtml + "<param name='AudioStream' value='-1'><param name='AutoSize' value='0'><param name='AutoStart' value='-1'><param name='AllowHideControls' value='-1'><param name='AllowScan' value='-1'>";
			panelHtml = panelHtml + "<param name='AutoRewind' value='-1'><param name='Balance' value='0'><param name='BufferingTime' value='0'><param name='ClickToPlay' value='0'><param name='CursorType' value='0'><param name='CurrentPosition' value='0'>";
			panelHtml = panelHtml + "<param name='CurrentMarker' value='0'><param name='DefaultFrame' value='0'><param name='DisplayMode' value='0'><param name='Enabled' value='0'><param name='EnableContextMenu' value='0'><param name='EnablePositionControls' value='-1'>";
			panelHtml = panelHtml + "<param name='EnableFullScreenControls' value='0'><param name='EnableTracker' value='0'><param name='Filename' value='" + midi_url + "'><param name='Mute' value='0'><param name='PlayCount' value='0'><param name='PreviewMode' value='0'>";
			panelHtml = panelHtml + "<param name='Rate' value='-1'><param name='SelectionStart' value='0'><param name='SelectionEnd' value='0'><param name='SendOpenStateChangeEvents' value='-1'><param name='SendWarningEvents' value='-1'><param name='SendErrorEvents' value='-1'>";
			panelHtml = panelHtml + "<param name='SendKeyboardEvents' value='0'><param name='SendMouseClickEvents' value='0'><param name='SendMouseMoveEvents' value='0'><param name='SendPlayStateChangeEvents' value='-1'><param name='ShowControls' value='0'><param name='ShowAudioControls' value='0'>";
			panelHtml = panelHtml + "<param name='ShowDisplay' value='0'><param name='ShowGotoBar' value='0'><param name='ShowPositionControls' value='0'><param name='ShowStatusBar' value='0'><param name='ShowTracker' value='0'><param name='TransparentAtStart' value='0'><param name='VideoBorderWidth' value='0'>";
			panelHtml = panelHtml + "<param name='VideoBorderColor' value='0'><param name='VideoBorder3D' value='0'><param name='Volume' value='0'><param name='WindowlessVideo' value='0'></object>";
			
			if(!ie)
			{		
			//<div id='panel_spacer' class='top_spacer'></div>	(blank div was used to make a space,now not needed)
			panelHtml = panelHtml + "<table align='center' width='45%' border='0' cellpadding='1' cellspacing='2'><tr><td align='right'><img height='9' width='29' src='http://img.123greetings.com/images/audiopanel/img/music.gif'>&nbsp;&nbsp;&nbsp;</td><td><a href='#' onClick='startplay();return false;' onmouseover='return set_status();'><img id='m_on' src='http://img.123greetings.com/images/audiopanel/img/on_d.gif'  style='border:0'></a></td><td><img src='http://img.123greetings.com/images/audiopanel/img/separator.gif'></td><td><a href='#' onClick='stopplay();return false;' onmouseover='return set_status();'><img id='m_off' src='http://img.123greetings.com/images/audiopanel/img/off_e.gif' style='border:0'></a></td>";
			panelHtml = panelHtml + "<td>&nbsp;&nbsp;<img id='mic' height='20' width='28' src='http://img.123greetings.com/images/audiopanel/img/mic1.gif'>&nbsp;</td>";
			panelHtml = panelHtml + "<td><div style='position:relative;border:0px solid blue;'><DIV class=slider_vol id='slider01' style='border:0px solid red'><IMG height='19' src='http://img.123greetings.com/images/audiopanel/img/knob.gif' width='6'></DIV></div></td></tr></table>";
			
			}else{
			panelHtml = panelHtml + "<table width='35%' border='0' cellpadding='1' cellspacing='0'><tr><td align='right'><img height='9' width='29' src='http://img.123greetings.com/images/audiopanel/img/music.gif'>&nbsp;&nbsp;</td><td><a href='#' onClick='startplay();return false;' onmouseover='return set_status();'><img id='m_on' src='http://img.123greetings.com/images/audiopanel/img/on_d.gif'  style='border:0'></a></td><td><img src='http://img.123greetings.com/images/audiopanel/img/separator.gif'></td><td><a href='#' onClick='stopplay();return false;' onmouseover='return set_status();'><img id='m_off' src='http://img.123greetings.com/images/audiopanel/img/off_e.gif' style='border:0'></a></td>";
			panelHtml = panelHtml + "<td>&nbsp;&nbsp;<img id='mic' height='20' width='28' src='http://img.123greetings.com/images/audiopanel/img/mic1.gif'>&nbsp;</td>";
			panelHtml = panelHtml + "<td><div style='position:relative;border:0px solid blue;'><DIV class=slider_vol id='slider01' style='border:0px solid red'><IMG height='19' src='http://img.123greetings.com/images/audiopanel/img/knob.gif' width='6'></DIV></div></td></tr></table>";
			}

			document.getElementById("rak_media").innerHTML = panelHtml;
			init_rakpanel();		
		}else{
	
			panelHtml = "<embed src='" + midi_url + "' width='200' height='20' loop='true' volume='90' autostart='true' playcount='1000'  id='rakpanel'/>"; 
			document.getElementById("normal_audio").innerHTML = panelHtml;
			document.getElementById("audio_panel_holder").style.visibility = "Hidden";
		}
	}
}

function set_status(){
//alert("fired");
window.status = " ";
return true;
}


var rak_brw = {

init : function(){
	this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion)	|| "an unknown version";
},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	]



};

rak_brw.init();


//fix for Netscape 8 and above
var isNN8 = function(){

	if(rak_brw.browser.indexOf('Netscape') != -1 && (parseInt(rak_brw.version,10) >=8 )){
		return true;
	}else{
		return false;
	}
}();





