
photoGallerypg=false;
snaredrumselectpg=false;

// if newlook not set, set it to false
try{
 newlook=newlook
}
catch(err){
 newlook=false
}

try{
 pdbck=pdbck
}
catch(err2){
 pdbck=false
}

// if musicdispatch indicates books present, change this to true (see below)
cartContent=0

function gotoForum(){
 opnwind("http://acapella.harmony-central.com/forums/forumdisplay.php?s=&forumid=19")
}

function gotoBackIssues(){
 opnwind("http://www.musicdispatch.com/feature.jsp?featureCat=128")
}


// for going from lesson popup pages to the lesson index

function lessonindex(){
currurl=document.URL
if(currurl.indexOf("lessons-virtual-drum-school.php")>0){
 self.focus()
}
else{
 self.focus()
 window.location="http://www.moderndrummer.com/lessons-virtual-drum-school.php"
}
}


function opnwind(u,wid){
// for offsite urls

if(!u){
if(newlook){
 u=subscribWinStr;
}
else{
 u="http://www.moderndrummer.com"
}

}

var WH="";
if(!wid && wid != false){
 WH="width="+800+",height=680,"
}
else if(wid != false){
 WH="width="+wid+",height=680,"
}
else{
  WH="width="+parseInt(screen.availWidth)+",height="+parseInt(screen.availHeight)+","
}

 opnwin=window.open(u,"opnwin",WH+"status=1,location=1,toolbar=1,directories=1,scrollbars=1,resizable=1,menubar=1,left=0,top=0");

opnwin.focus()
}

function setMV(){

// can get rid of this when 2009 homepage update implemented

try{
 document.getElementById('FavArts').style.left=(setLeft-3000)+"px";
 setMV_var=true;
}
catch(e){
 if(!setMV_var){
   setTimeout("setMV()",500)
 }
}

}


 function sPosSize(){

isMac=(navigator.userAgent.toLowerCase().indexOf('mac')>0);

if(browsertype=="IE"){
 // self.moveTo(-2,-2)
}

wSc=805
hSc=615

ResizeOK=0

if(parseInt(screen.availWidth)<900){
// i.e. resize screen if user using width of 800 pixels
wSc=parseInt(screen.width)
hSc=parseInt(screen.height)
ResizeOK=1
}
//alert(parseInt(document.body.clientWidth))
if(parseInt(document.body.clientWidth)<805){
ResizeOK=1
}


if(!isMac&&ResizeOK&&browsertype=="IE"){

 //self.resizeTo((wSc+Wplus),(hSc-20))
}
}


function validateSignup(myform) {

if (myform.txtEmail.value == '')  {
alert("Please enter an email address.")
return(false)
}

if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myform.txtEmail.value)){
gotoreg=window.open('','mdreg','status=0,menubar=0,toolbar=0,location=0,resizable=1,width=400,height=275')

// submit to included form at bottom of all pages
 dse=document.submitemail
 dse.txtEmail.value=myform.txtEmail.value
 dse.action="mdreg.php";
 dse.target="mdreg";
 dse.submit.click();

gotoreg.focus()
}
else{
alert("Invalid E-mail Address! Please re-enter.")
myform.txtEmail.focus()
}
return false
}



function openWindow() {
 popupRadio = window.open('radio_popup.php', 'radio', 'width=500,height=159');
}

function openMP3(str){
POPUP=window.open(str,'POPUP','toolbar=no,width=150,height=100,left=0,top=0,directories=no,menubar=no,scrollbars=no,resizable=no');
POPUP.focus()
}

popMediaType="";
function openFile(str,mp3vidorpdf,whAspect){

 popnameext="";

	if(mp3vidorpdf=="pdf"){
			setHW="";
	  fileStr=str;
   popnameext="pdf"
		}
		else if(mp3vidorpdf=="video"){
   if(str.toLowerCase().indexOf(".wmv") > 0){
				setHW=",width=500,height=400";
		  fileStr=str;
    popnameext="wmvANDaudio"
   }
   else{
    if(whAspect!=undefined){
     whAspectSpl=whAspect.split("~");
 	   setHW=",width="+(parseInt(whAspectSpl[0])+50)+",height="+(parseInt(whAspectSpl[1])+60);
     setwhAspect="&whAspect="+whAspect;
     popnameext="flv"
    }
    else{
 	   setHW=",width=720,height=600";
     setwhAspect="";
     popnameext="flv"
    }
	   fileStr="previewFlash.php?educationStr="+str+"&swfPlayer=mdvideosPlayer"+setwhAspect;
   }

		}
		else{
			setHW=",width=150,height=120";
	  fileStr=str;
	  popnameext="wmvANDaudio"
		}


if(typeof(POPUP)=="object"){
 if(popMediaType != popnameext){
  POPUP.close()
 }
}

popMediaType=popnameext;
		POPUP=window.open(fileStr,'POPUP'+popnameext,'toolbar=no'+setHW+',left=0,top=0,status=1,directories=no,menubar=no,scrollbars=no,resizable=no');
		POPUP.focus()

}


function opensidebar(str,w,h) {
POPUP=window.open(str,'POPUP','status=0,location=0,width='+w+',height='+h+',directories=0,menubar=0,scrollbars=0,resizable=0');
POPUP.focus()
}

function opensidebar1(str,w,h) {
POPUP=window.open(str,'POPUP','status=0,location=0,toolbar=0,width='+w+',height='+h+',directories=0,menubar=0,scrollbars=0,resizable=0');
}

//Popup Window Script

function openpopup(){
var popurl="md_new_logo_movie.html"
//winpops=window.open(popurl,"newlogo","width=405,height=120,hspace=0,vspace=0")
//winpops.focus()
}

openpopup()

/* now done through function sPosSize()
//self.resizeTo(parseInt(screen.availWidth),parseInt(screen.availHeight))
if(!isMac&&ResizeOK){
self.resizeTo((wSc+Wplus),(hSc-20))
}
self.moveTo(0,0)
*/


