function multimediagallery(val) {

    var xmlHttpReq5 = false;
    var self5 = this;
	
   	 strURL='player.php?id='+val;


    if (window.XMLHttpRequest) {
        self5.xmlHttpReq5 = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self5.xmlHttpReq5 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self5.xmlHttpReq5.open('POST', strURL, true);
    self5.xmlHttpReq5.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self5.xmlHttpReq5.onreadystatechange = function() {
        if (self5.xmlHttpReq5.readyState == 4) {
            updatebreadcrumb(self5.xmlHttpReq5.responseText,'mcontentRightInternal');
        }
    }
    self5.xmlHttpReq5.send('');
}




function gallery(val)
{
selectgalimage(val);
thumbscroll(val);
}

function selectgalimage(val,page) {
currentimageid=val;

    var xmlHttpReq3 = false;
    var self3 = this;
	if(page=='home')
   	 strURL='homegallery.php?id='+val;
	else
	 strURL='galleryfile.php?id='+val;

    if (window.XMLHttpRequest) {
        self3.xmlHttpReq3 = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self3.xmlHttpReq3 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self3.xmlHttpReq3.open('POST', strURL, true);
    self3.xmlHttpReq3.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self3.xmlHttpReq3.onreadystatechange = function() {
        if (self3.xmlHttpReq3.readyState == 4) {
            updatebreadcrumb(self3.xmlHttpReq3.responseText,'gallery');
        }
    }
    self3.xmlHttpReq3.send('');
}

function thumbscroll(val) {

    var xmlHttpReq4 = false;
    var self4 = this;

	 strURL='thumbscroll.php?id='+val;

    if (window.XMLHttpRequest) {
        self4.xmlHttpReq4 = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self4.xmlHttpReq4 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self4.xmlHttpReq4.open('POST', strURL, true);
    self4.xmlHttpReq4.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self4.xmlHttpReq4.onreadystatechange = function() {
        if (self4.xmlHttpReq4.readyState == 4) {
            updatebreadcrumb(self4.xmlHttpReq4.responseText,'thumbscroll');
        }
    }
    self4.xmlHttpReq4.send('');
}





function selectmoregalimage(val) {


    var xmlHttpReq = false;
    var self = this;
    strURL='moregalleryfile.php?id='+val;

    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatebreadcrumb(self.xmlHttpReq.responseText,'gallery');
        }
    }
    self.xmlHttpReq.send('');
}
function selectbookimage(val) {


    var xmlHttpReq = false;
    var self = this;
    strURL='bookfile.php?id='+val;

    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatebreadcrumb(self.xmlHttpReq.responseText,'book');
        }
    }
    self.xmlHttpReq.send('');
}

function playmultimedia(file,type,id)
{

	playfile(file,type);
	setTimeout("togglediv("+id+","+type+")",1000);
}



function playfile(file,type) {
//alert(type);

    //var val=document.frmcat.addnew.value;
    var xmlHttpReq1 = false;
    var self1 = this;
    strURL='play.php?file='+file+'&type='+type;
	
	if(type==1)
		div='radio';
	else
		div='video';
		
	
    //alert(div);
    if (window.XMLHttpRequest) {
        self1.xmlHttpReq1 = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self1.xmlHttpReq1 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self1.xmlHttpReq1.open('POST', strURL, true);
    self1.xmlHttpReq1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self1.xmlHttpReq1.onreadystatechange = function() {
        if (self1.xmlHttpReq1.readyState == 4) {
            updatebreadcrumb1(self1.xmlHttpReq1.responseText,div,type,file);
        }
    }
    self1.xmlHttpReq1.send('');
}

function updatebreadcrumb1(str,divname,type,file){
    aa=document.getElementById(divname);
    aa.innerHTML=str;
if(type==2)	{
var so = new SWFObject('player.swf','mpl','470','320','9');

so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&author=Lonny Shavelson&file=video/'+file+'&backcolor=000000&frontcolor=ffffff&lightcolor=FF6600&screencolor=000000&autostart=true');
so.write('videodiv');
}
else
{
	setTimeout("niftyplayer('niftyPlayer1').play()",1000);
}

}




function togglediv(id,type) {
    var xmlHttpReq2 = false;
    var self2 = this;
   
	if(type==1)
	{
		div='video';
		 strURL='imagediv.php?id='+id+'&type='+type;
	}
		
	else
	{
		div='radio';
		 strURL='blank.php?id='+id+'&type='+type;
	}
    if (window.XMLHttpRequest) {
        self2.xmlHttpReq2 = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self2.xmlHttpReq2 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self2.xmlHttpReq2.open('POST', strURL, true);
    self2.xmlHttpReq2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self2.xmlHttpReq2.onreadystatechange = function() {
        if (self2.xmlHttpReq2.readyState == 4) {
            updatebreadcrumb2(self2.xmlHttpReq2.responseText,div);
        }
    }
    self2.xmlHttpReq2.send('');
}

function updatebreadcrumb(str,divname){
    aa=document.getElementById(divname);
    aa.innerHTML=str;
}
function updatebreadcrumb2(str,divname){
    aa=document.getElementById(divname);
    aa.innerHTML=str;
}
