﻿
//Function to send invitation 
 //ctl00_ContentPlaceHolder1_leftpanel1_txtFeedback
  

//function to delete the image 
 function deleteImage()
 {
 var msg;
	//ht = document.getElementsByTagName("html");
	//ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	//alert(document.getElementById('ctl00_ContentPlaceHolder1_lblTotalPhoto').innerHTML);
	if(parseInt(document.getElementById('ctl00_ContentPlaceHolder1_lblTotalPhoto').innerHTML)==1)
	{
	  msg=" Since this is the last photo of the album, so are you sure to delete this photo as well as album?"; 
	}
	else
	{
	 msg="Are you sure you want to delete this photo?"; 
	}
	
	if (confirm(msg))
	{
		return true;
	}
	else
	{
		//ht[0].style.filter = "";
		return false;
	}
 }
function UserInfo()
{
  alert("Album containing photos can not be deleted.");
  return false;
}
function deleteAlbm()
{  
if (confirm("Are you sure you want to delete this album?"))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function Confirmdelete()
{  
	//ht = document.getElementsByTagName("html");
	//ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to delete this comment?'))
	{   
	    
		return true;
	}
	else
	{
		//ht[0].style.filter = "";
		return false;
	}
}// JavaScript

//************************************FOR Delete Testimonial*************************************************************//
function deletTestimonials()
{
//ht = document.getElementsByTagName("html");
//	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to delete this testimonial?'))
	{
		return true;
	}
	else
	{
		//ht[0].style.filter = "";
		return false;
	}
}

//************************************FOR IMAGE CROPPING*************************************************************//
function ConfirmCropImage()
{
    if(document.getElementById("x1").value > parseInt(0) && document.getElementById("y1").value> parseInt(0) )
    {
	 if (confirm('Are you sure you want to crop this photo?'))
	    {
		    return true;
	    }
	    else
	    {
		    //ht[0].style.filter = "";
		    return false;
	    }
	}
	else
	{
	  alert("Click on the photo to crop !!");
	  return false ;
	}
}

function ConfirmDonotCropPhoto()
{
  if(document.getElementById("x1").value > parseInt(0) && document.getElementById("y1").value> parseInt(0) )
    {
	 if (confirm('Are you sure you want to crop this photo?'))
	    {
	        document.getElementById("TxHiddenMode").value="CROP";
		    return true;
		    
	    }
	    else
	    { 
	        // document.getElementById("TxHiddenMode").value="CROP";
		     //alert(document.getElementById("TxHiddenMode").value);
		    //ht[0].style.filter = "";
		    return true;
	    }
	}
}
//******************************************************************************************************************//
//************************************FOR Delte Buddy[mybuddylist.aspx]*********************************************//
function ConfirmMyBuddy()
{
  // ht = document.getElementsByTagName("html");
   // ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to remove from your watch list?'))
	{
		return true;
	}
	else
	{
		//ht[0].style.filter = "";
		return false;
	}
}
//******************************************************************************************************************//

//************************************FOR Delte Buddy[mybuddylist.aspx]*********************************************//
function ConfirmFavImgDelete()
{
  // ht = document.getElementsByTagName("html");
   // ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to remove from your favorite list?'))
	{
		return true;
	}
	else
	{
		//ht[0].style.filter = "";
		return false;
	}
}
//******************************************************************************************************************//
//************************************FOR changeing the display order[movephoto.aspx] ]*********************************************//
function ConfirmChnageDisplayorder()
{
	if (confirm('Would you like to reverse the  photo display order of this album?'))
	{
		return true;
	}
	else
	{
		return false;
	}
}
////////////////////////////////////////////


function listSel(fld,id)
 {
    var opt = fld.selectedIndex;
   
    var myform = document.getElementById(id);
     
    var optarray = myform.getElementsByTagName('select');
     for (var m=0;m<optarray.length;m++)
     { // alert("m="+m);
       for(var n=m+1;n<optarray.length;n++)
       {
           //alert("n="+n);
           if(optarray[m].value==optarray[n].value)
           {
            // alert(optarray[m].value+"="+optarray[n].value)
            //document.aspnetForm.action ="mydashboard.aspx";
             alert("Every photo should have a unique order no");
            return false;
           }
       }
      }
     }  
     
     
     //////////////////////////////////////EditProfile.aspx..................................//
    function DeleteAccout()
    {
	        if(document.getElementById('ctl00_ContentPlaceHolder1_TxtDeleteAccount').value!="")
	        {
	                if (confirm('Are you sure you want to Close your photodekho.com account?'))
	                {  
		                return true;
	                }
	                else
	                {
		                
		                return false;
	                }
	        }
	        else
	        {
	          alert("Kindli enter the reason.");
	          document.getElementById('ctl00_ContentPlaceHolder1_TxtDeleteAccount');
	        }
    } 
    
//*****************************************End*********************************************//

function  JsMovephoto()
{
    alert("You should have atleast two album for Move/Copy any photo.");
    return false;
}
    
    
 //***************************Delete Edited Photos[Allupdate,mydashboar page]**************//
 
 function ConfirmDeletEditPht()
 {
   if (confirm('Are you sure you want to  delete this edited photo?'))
	    {
		    return true;
		    
	    }
	    else
	    { 
		    return false;
	    }
 }
 
 
 
 //*****************************************************************************************//   
   // var val = fld.options[opt].value;
  
//for (var i=optarray.length-1;i > -1; i--) 
//  {  
//   for (var j = optarray[i].length-1; j > -1; j--) 
//    {
//       //alert(fld);
//      if (optarray[i] == fld)
//       {   alert("fid="+ fld.options[j].value+"val="+val);
//         if (fld.options[j].value != val) 
//         {      alert("val="+val)
//          alert(  fld.removeChild(optarray[i].options[j]));
//            }
//          }
//      else if (optarray[i].options[j].value == val)
//       {
//         optarray[i].removeChild(optarray[i].options[j]);
//         }
//      }
//   }
//for (var k=optarray.length-1;k > -1; k--) 
//{
//   if (optarray[k].length != 1) break;
//   }
//if (k == -1) {
//   var al = 'Your selections in order are:\n   ';
//   
//   for (var i=0;i < optarray.length; i++)
//    { 
//       for (var k=i+1;k<=i;k++)
//       {
//          if(optarray[i].options[0].text==optarray[k].options[0].text)
//          
//           al += optarray[i].options[0].text + '\n   ';
//        }
//      }
//   alert(al);
//   }
//}