//Make Folder Image start
function makeFolderImage(albumId,photo,userId,pageId)
{
	/*alert("pageId= "+pageId);
	alert("photoId= "+photoId);
	alert("userId= "+userId); */
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	//var file = "picasa_albumXml.php?albumId="+albumId+"&photo='"+photo+"'"; 
	 var file = "makeFolderImage.php?albumId="+albumId+"&photo='"+photo+"'"; 
	//window.open(file);
   xmlhttp.open('GET', file, true); 
    xmlhttp.send(null);
	
	var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId=photos&pageId="+pageId+"&xmlRefresh=yes";	
	xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
	       window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;
}
//Make Folder Image Over

//Make Main Image start
function makeMainImage(photoId,pageId,userId,ifRemove)
{
	/*alert("pageId= "+pageId);
	alert("photoId= "+photoId);
	alert("userId= "+userId); */
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "makeMainImage.php?pageId="+pageId+"&photoId="+photoId+"&userId="+userId+"&ifRemove="+ifRemove; 
	//window.open(file);
   xmlhttp.open('GET', file, true); 
    xmlhttp.send(null);
	
	var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId=photos&pageId="+pageId+"&xmlRefresh=yes";	
	xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
	       window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;
}
//Make Main Image Over


//Change Album Status start
function changeAlbumStatus(status,userId,albumName)
{
	/*alert("status= "+status);
	alert("userId= "+userId);
	alert("albumName= "+albumName);*/
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "editAlbumStatus.php?status="+status+"&userId="+userId+"&albumName="+albumName; 
	//window.open(file);
    xmlhttp.open('GET', file, true); 
    xmlhttp.send(null);
	
	var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId=photos&pageId="+pageId;	
	xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
	       window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;
}
//Change Album Status Over

//edit title in MC page2 start
function editTitle(userId,curId,tabId,pageId,newTitle,entId)
{
  /*	alert("userId= "+userId);
	alert("curId= "+curId);
	alert("newTitle= "+newTitle);
	alert("tabId= "+tabId);
	alert("pageId= "+pageId);
	alert("entId= "+entId); */
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "editTitle.php?curId="+curId+"&newTitle="+newTitle+"&tabId="+tabId+"&pageId="+pageId; 
	//window.open(file);
    xmlhttp.open('GET', file, true); 
    xmlhttp.send(null);
	
	if(pageId == "user")
		var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "community")
		var linkUrl= "widget.php?commId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "storefront")
		var linkUrl= "widget.php?sfId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "neighbor")
		var linkUrl= "widget.php?nhId="+entId+"&nhName="+nhname+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	

	xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
	       window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;	
}
//edit title in MC page2 end

//Add as News Letter in Media Center Page2 Start
function addNewsletter(fileId,pageId,sfId)
{
/*	alert("fileId= "+fileId);
	alert("pageId= "+pageId);
	alert("sfId= "+sfId);*/
	
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "./newsletter.php?pageId="+pageId+"&fileId="+fileId+"&sfId="+sfId;	
	//var file = "../typo3conf/ext/newsletter/pi1/class.tx_newsletter_pi1.php?pageId="+pageId+"&fileId="+fileId;
	//window.open(file);
	xmlhttp.open('GET', file, true);
	xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) { 
	      var content3 = xmlhttp.responseText; 
			if( content3 ){ 
				parent.document.getElementById('thumb11').innerHTML = content3; 
			    }
			
       		}
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
		return;
	
}
//Add as News Letter in Media Center Page2 Over

//Search Functionality  in Media Center Page2 start
function searchRec(searchTxt,userId,tabId,pageId,nhname)
{
	/*alert("searchTxt "+searchTxt);
	alert("userId "+userId);
	alert("tabId "+tabId);
	alert("pageId "+pageId);
	alert("nhname "+nhname);*/
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	
	if(pageId == "user")
	{
		var file = "xml1.php?searchTxt="+searchTxt+"&emailuser="+userId+"&tabId="+tabId+"&pageId="+pageId+"&search=yes"; 
		var linkUrl= "widget.php?userId="+userId+"&search=yes&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	}	
	else if(pageId == "community")
	{
		var file = "comm_xml.php?searchTxt="+searchTxt+"&cid="+userId+"&tabId="+tabId+"&pageId="+pageId+"&search=yes"; 	
		var linkUrl= "widget.php?commId="+userId+"&search=yes&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	}	
	else if(pageId == "storefront")
	{
		var file = "sf_xml.php?searchTxt="+searchTxt+"&sfId="+userId+"&tabId="+tabId+"&pageId="+pageId+"&search=yes"; 	
		var linkUrl= "widget.php?sfId="+userId+"&search=yes&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	}	
	else if(pageId == "neighbor")
	{
		var file = "nh_xml.php?searchTxt="+searchTxt+"&nhId="+userId+"&tabId="+tabId+"&pageId="+pageId+"&search=yes"; 			
		var linkUrl= "widget.php?nhId="+userId+"&nhName="+nhname+"&search=yes&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	}	
	//window.open(file);
	if(searchTxt != "")
	{
	   xmlhttp.open('GET', file, true); 
        xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
	 		
			 //xmlhttp.window.location.reload();
			 //window.location.refresh();
			  //xmlhttp.responseXML = "user_photos_"+userId+".xml";
			   window.location.href=linkUrl;
	 	   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;	
	}
		
}
//Search Functionality  in Media Center Page2 Over

//When Record is Deleted in Media Center Page2 start
function delRecord(userId,curId,tabId,pageId,entId,pageName)
{
 	/*alert("userId "+userId);
	alert("tabId "+tabId);
	alert("pageId "+pageId);
	alert("curId "+curId);
	alert("entId "+entId);
	alert("pageName "+pageName);*/
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "deleteRecord.php?curId="+curId+"&tabId="+tabId+"&pageId="+pageId; 
	//window.open(file);
	xmlhttp.open('GET', file, true); 
	//xmlhttp.send(null); //Nullify the XMLHttpRequest

	if(pageId == "user")
		var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "community")
		var linkUrl= "widget.php?commId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "storefront")
		var linkUrl= "widget.php?sfId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "neighbor")
		var linkUrl= "widget.php?nhId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "page_admin")
		var linkUrl= "widget.php?pId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId+"&pageName="+pageName;		

	   xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
			 window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;	
		//window.open(file);
}
//When Record is Deleted in Media Center Page2 Over

/*
//When Tag is Addedd in Media Center Page2 start
function addTag(userId,curId,tabId,pageId,newTag,entId)
{
	alert("userId== "+userId);
	alert("curId= "+curId);
	alert("pageId= "+pageId);
	alert("newTag= "+newTag);
	alert("tabId== "+tabId);
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "addtagMC.php?curId="+curId+"&newTag="+newTag+"&tabId="+tabId+"&pageId="+pageId; 
    xmlhttp.open('GET', file, true); 
    xmlhttp.send(null);
	if(pageId == "user")
		var linkUrl= "widget.php?userId="+userId+"&link=seemore";
	window.location.href = linkUrl;
	return;	
	//window.open(file);
}
//When Tag is Addedd in Media Center Page2 Over
*/

//When Tag is Edited in Media Center Page2 start
function editTag(userId,curId,newTag,tabId,pageId,entId)
{
/*	alert("userId= "+userId);
	alert("curId= "+curId);
	alert("newTag= "+newTag);
	alert("tabId= "+tabId);
	alert("pageId= "+pageId); */
	
	var xmlhttp=false; 
	try {
			xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp = new
				ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp = false;
					}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
					xmlhttp = new XMLHttpRequest(); 
	 }
	var file = "addtagMC.php?curId="+curId+"&newTag="+newTag+"&tabId="+tabId+"&pageId="+pageId; 
    xmlhttp.open('GET', file, true); 
   
   if(pageId == "user")
		var linkUrl= "widget.php?userId="+userId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "community")
		var linkUrl= "widget.php?commId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "storefront")
		var linkUrl= "widget.php?sfId="+entId+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "neighbor")
		var linkUrl= "widget.php?nhId="+entId+"&nhName="+nhname+"&link=seemore&tabId="+tabId+"&pageId="+pageId;	

	   xmlhttp.onreadystatechange=function() {
       if (xmlhttp.readyState==4) { 
			 window.location.href=linkUrl;
		   }
	   }
	    xmlhttp.send(null); //Nullify the XMLHttpRequest
	    return;	
}
//When Tag is Edited in Media Center Page2 Over
function rating(pageId,tabId,id,rate,userId,McId,entId)
{
	/*alert("pageId "+pageId);
	alert("tabId "+tabId);
	alert("id "+id);
	alert("photoRate "+rate);
	alert("userId "+userId);
	alert("McId "+McId);
	alert("entId "+entId); */
	var xmlhttp1=false; 
	try {
			xmlhttp1 = new ActiveXObject('Msxml2.XMLHTTP'); 
	} 
	catch (e)
	{
		try {
				xmlhttp1 = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (E) {
			xmlhttp1 = false;
					}
	}
	if (!xmlhttp1 && typeof XMLHttpRequest!='undefined') {
					xmlhttp1 = new XMLHttpRequest(); 
	 }
		
	var file1 = "rating.php?pageId="+pageId+"&tabId="+tabId+"&rate="+rate+"&id="+id+"&user="+userId+"&entId="+entId; 
	//window.open(file2);
	//alert(file1);
    xmlhttp1.open('GET',file1,true); 
	
 	if(McId == "Front")
		var link1 = "";
	else 	
		var link1 = "seemore";
    if(pageId == "user")
		var linkUrl= "widget.php?userId="+userId+"&link="+link1+"&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "community")
		var linkUrl= "widget.php?commId="+entId+"&link="+link1+"&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "storefront")
		var linkUrl= "widget.php?sfId="+entId+"&link="+link1+"&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "neighbor")
		var linkUrl= "widget.php?nhId="+entId+"&link="+link1+"&tabId="+tabId+"&pageId="+pageId;	
	else if(pageId == "page_admin")
		var linkUrl= "widget.php?pageAdminId="+entId+"&nhName="+nhname+"&link="+link1+"&tabId="+tabId+"&pageId="+pageId;		

	   xmlhttp1.onreadystatechange=function() {
       if (xmlhttp1.readyState==4) { 
	   	 window.location.href=linkUrl;
		}
	   }
	    xmlhttp1.send(null); //Nullify the XMLHttpRequest
	    return;	 
}

