<!--
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];}
}
//-->
/** Page Selected Tab Script **/
	var pNameUrl = location.href;
	pNameUrlVar = pNameUrl.split('/');
	pNameUrlVar = pNameUrlVar[pNameUrlVar.length-1];
	pNameUrlVar = pNameUrlVar.split('.');
	pNameUrlVar = pNameUrlVar[0];

	var pagename = ['home', 'there_me','my_style','memories','cinema','giving','sharing','my_news','and_you'];
	var pageId = ['tab0','tab1','tab2','tab3','tab4','tab5','tab6','tab7','tab8'];
	var imgSrc = ['my_world_on','theres_me_on','my_style_on','memories_on','cinema_on','giving_on','sharing_on','my_team_on','and_you_on'];
	
	
	for(i=0;i<pagename.length;i++) {

		if(pNameUrlVar == pagename[i]) {
			tabVar  = "tab"+i;
			imgVar = imgSrc[i];
			
			$(document).ready(function() {
			
				$('#'+tabVar).attr('src','images/tabs/'+imgVar+'.jpg');
			});
		}
	}
/** End **/
/** Enter Check On Submit**/
function submitonEnter(e, validFnName, ID)
{
	var keycode;

	if (window.event)
	{
		keycode = window.event.keyCode;
	}
	else if (e) 
	{
		//alert(e.which);
		keycode = e.which;
	}

	if(keycode == "13")
	{
		//alert(validFnName);
		if(validFnName(ID))
		{
			return true;
		}
	}
}

/** END **/

$(document).ready(function()
{
	$('#my_gallery').innerfade({ speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '209px' });
	/*$('#maingallery').innerfade({ speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '209px' });*/
	
	$(".exampleRegister").colorbox({transition:"none", innerWidth:382, innerHeight:600, slideshow:false, iframe: false});
	$(".exampleRegister1").colorbox({transition:"none", innerWidth:382, innerHeight:600, slideshow:false, iframe: false});
	$(".sendMailByUser").colorbox({transition:"none", innerWidth:390, innerHeight:700, slideshow:false, iframe: false});
	$(".changePassword").colorbox({transition:"none", innerWidth:390, innerHeight:360, slideshow:false, iframe: false});
	$(".upload-a-video").colorbox({transition:"none", innerWidth:390, slideshow:false, iframe: false});
	$(".upload-photo").colorbox({transition:"none", innerWidth:390, slideshow:false, iframe: true,height: 262, width:385});
	$(".forgotPassword").colorbox({transition:"none", innerWidth:390, innerHeight:180, slideshow:false, iframe: false});
	
	$(".pressLogin").colorbox({transition:"none", innerWidth:390, innerHeight:600, slideshow:false, iframe: false});
	
	$(".example6").colorbox({transition:"none", slideshow:false, iframe: false});
	$(".example8").colorbox({transition:"none", slideshow:false, iframe: false});
	
	

	<!-- Color Box -->
	$('#logout').css("cursor", "pointer");	

	$('#submitLogin').css("cursor", "pointer");
	
	$("#cboxClose").click(function()
	{
		
		var ImageID = $('#comment_ImageID').val();
		var VideoID = $('#comment_VideoID').val();
		var NewsID = $('#comment_NewsID').val();
		$('.popUpbg').css('display','none');
		var count_comments = "Yes";
		
		//alert(VideoID);	

		if(ImageID != null)
		{
			$.post("backend.php", { ImageID: ImageID, count_comments: count_comments, rand:Math.random() }, function(data)
			{	
				if(data != "0")
				{
					$("#example6_"+ImageID+" span").html(data);	
					$("#example8_"+ImageID+" span").html(data);	
				}
			});
		}

		if(VideoID != null)
		{
			$.post("backend.php", { VideoID: VideoID, count_comments: count_comments, rand:Math.random() }, function(data)
			{
				if(data != "0")
				{
					$("#example6_"+VideoID+" span").html(data);
					$("#example8_"+VideoID+" span").html(data);
				}
			});
		}
		if(NewsID != null)
		{
			$.post("backend.php", { NewsID: NewsID, count_comments: count_comments, rand:Math.random() }, function(data)
			{
				if(data != "0")
				{
					$("#example6_"+NewsID+" span").html(data);
					$("#example8_"+NewsID+" span").html(data);
				}
			});
		}
		return false;
	});

	$("#logout").bind('click',userLogout);
	$(".markerLogout").bind('click',userLogout);
	
	$("#login_form").bind('submit',{ID: 'login_form'}, userLogin);
	$("#submitLogin").bind('click',{ID: 'login_form'}, userLogin);
	
	$(".notloggedin").click(function()
	{
	
		$(".notloggedin").colorbox({innerWidth:382, innerHeight:180, href:"login.php"});

	});
	
	$(".menu_and_you").click(function()
	{
		$(".notloggedin").colorbox({innerWidth:382, innerHeight:180, href:"login.php"});

	});
	
	$("#footermenu_notloggedin").click(function()
	{
		$(".footermenu_notloggedin").colorbox({innerWidth:382, innerHeight:180, href:"login.php"});

	});
	
	$("#footermenu_and_you").click(function()
	{
		$(".footermenu_notloggedin").colorbox({innerWidth:382, innerHeight:180, href:"login.php"});

	});
});
function showSocialMessage(ID)
{
	var Title = $("#"+ID).attr("title");
	$("#showTweetMessage").html(Title);
}
function showSocialDefaultMessage(ID)
{
	//var Title = "PC's on social networks.";
	var Title = "PC on social networks.";
	$("#showTweetMessage").html(Title);
}

function showSocialDefaultMessageForTeam(ID)
{
	//var Title = "PC's on social networks.";
	var Title = "Team Priyanka on Social Networks.";
	$("#showTweetMessage").html(Title);
}


function showRegForm(ID)
{
	$("#"+ID).colorbox({transition:"none", innerWidth:387, innerHeight:650, slideshow:false, iframe: false, href:"registration_form.php"});
}

function showLoginForm(ID)
{
	$("#"+ID).colorbox({innerWidth:382, innerHeight:180, href:"login.php"});
}


function newFavourites(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:600,
		href: 'new_favourites.php'		
	});
}

function privacyTerms(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:570,
		transition:"none",
  		speed:300,
		href: 'privacy_policy.php'		
	});
}

function showFullgallery(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:830,
		innerHeight:600,
		href: 'FullscreenGallery.php'		
	});
}


function siteCredits(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:230,
		transition:"none",
  		speed:300,
		href: 'site_credits.php'		
	});
}

function businessEnquiries(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:125,
		transition:"none",
  		speed:300,
		href: 'business_enquiries.php'		
	});
}

function showNews(NewsID)
{
	//$(".moreNews_"+NewsID).colorbox({transition:"none", slideshow:false, iframe: false});	
	$(".moreNews_"+NewsID).colorbox({
		iframe:true,
		innerWidth:500,
		innerHeight:575,
		transition:"none",
  		speed:300
		
	});
}

function viewAll(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:570,
		href: 'viewAll.php'		
	});
}

function iGot(ID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		innerHeight:570,
		href: 'igot.php'		
	});
}


function ClearMessage()
{
	document.getElementById('ErrUsername').innerHTML=' ';
	document.getElementById('ErrPassword').innerHTML=' ';
}

function checkLogin(){
	msg= "Please Login Here to add Comment";
	document.getElementById('loginMsg').style.display = "Block";
	document.getElementById('loginMsg').style.color = "Red";
	document.getElementById('loginMsg').innerHTML = msg;
	document.getElementById('EmailID').focus();
}

function commentonImage(ID, ImageID)
{
	$("#"+ID).colorbox({
		iframe:true,
		innerWidth:382,
		/*innerHeight:560,*/
		innerHeight:395,
		transition:"none",
  		speed:300,
		href: 'comments_box.php?ImageID='+ImageID,
		onOpen:function()
		{
			var ImageID = $("#"+ID).attr("rel");
			$('#comment_ImageID').val(ImageID);
			$('#cboxClose').css("right", "5px");
			$('#cboxClose.hover').css("right", "5px");
		}
	});
}

function commentonVideo(ID, VideoID)
{
	$("#"+ID).colorbox({
		iframe:true,
		/*innerWidth:468,*/
		/*innerWidth:455,*/
		innerWidth:382,
		/*innerHeight:600,*/
		//innerHeight:385,
		innerHeight:395,
		transition:"none",
  		speed:300,
		href: 'comments_box.php?VideoID='+VideoID,
		onOpen:function()
		{
			var VideoID = $("#"+ID).attr("rel");
			$('#comment_VideoID').val(VideoID);
			$('#cboxClose').css("right", "5px");
			$('#cboxClose.hover').css("right", "5px");
		}
	});
}

function commentonNews(ID, NewsID)
{
	$("#"+ID).colorbox({
		iframe:true,
		/*innerWidth:468,*/
		/*innerWidth:455,*/
		innerWidth:382,
		/*innerHeight:600,*/
		//innerHeight:385,
		innerHeight:395,
		transition:"none",
  		speed:300,
		href: 'comments_box.php?NewsID='+NewsID,
		onOpen:function()
		{
			var NewsID = $("#"+ID).attr("rel");
			$('#comment_NewsID').val(NewsID);
			$('#cboxClose').css("right", "5px");
			$('#cboxClose.hover').css("right", "5px");
		}
	});
}


function loginAlert(ID)
{
	$("#"+ID).colorbox({innerWidth:382, innerHeight:180, href:"login.php"});
}


function likeImage(ImageID)
{
	var ImageID = ImageID;
	var Like = "Yes";

	$('#waiting_LikeDontLike_'+ImageID).show();
	$.post("backend.php", { ImageID: ImageID, Like: Like, rand:Math.random() }, function(data){
		if($('#waiting_LikeDontLike_'+ImageID).hide())
		{
			if(data != "0")
			{
				$("#likeCount_"+ImageID).html(data);
			}
		}
	});
	return false;
}

function dontlikeImage(ImageID)
{
	var ImageID = ImageID;
	var DontLike = "Yes";

	$('#waiting_LikeDontLike_'+ImageID).show();
	$.post("backend.php", { ImageID: ImageID, DontLike: DontLike, rand:Math.random() }, function(data){
		if($('#waiting_LikeDontLike_'+ImageID).hide())
		{
			if(data != "0")
			{
				$("#dontLikeCount_"+ImageID).html(data);
				return true;
			}
			else
			{
				return false;
			}
		}
	});
	return false;
}

function likeVideo(VideoID)
{
	var VideoID = VideoID;
	var Like = "Yes";

	$('#waiting_LikeDontLike_'+VideoID).show();
	$.post("backend.php", { VideoID: VideoID, Like: Like, rand:Math.random() }, function(data)
	{
		if($('#waiting_LikeDontLike_'+VideoID).hide())
		{
			if(data != "0")
			{
				$("#likeCount_"+VideoID).html(data);
			}
		}
	});
	return false;
}

function dontlikeVideo(VideoID)
{
	var VideoID = VideoID;
	var DontLike = "Yes";

	$('#waiting_LikeDontLike_'+VideoID).show();
	
	$.post("backend.php", { VideoID: VideoID, DontLike: DontLike, rand:Math.random() }, function(data)
	{
		if($('#waiting_LikeDontLike_'+VideoID).hide())
		{
			if(data != "0")
			{
				$("#dontLikeCount_"+VideoID).html(data);
				return true;
			}
			else
			{
				return false;
			}
		}
	});
	return false;
}

function likeNews(NewsID)
{
	var NewsID = NewsID;
	var Like = "Yes";

	$('#waiting_LikeDontLike_'+NewsID).show();
	$.post("backend.php", { NewsID: NewsID, Like: Like, rand:Math.random() }, function(data)
	{
		if($('#waiting_LikeDontLike_'+NewsID).hide())
		{
			if(data != "0")
			{
				$("#likeCount_"+NewsID).html(data);
			}
		}
	});
	return false;
}

function dontlikeNews(NewsID)
{
	var NewsID = NewsID;
	var DontLike = "Yes";

	$('#waiting_LikeDontLike_'+NewsID).show();
	
	$.post("backend.php", { NewsID: NewsID, DontLike: DontLike, rand:Math.random() }, function(data)
	{
		if($('#waiting_LikeDontLike_'+NewsID).hide())
		{
			if(data != "0")
			{
				$("#dontLikeCount_"+NewsID).html(data);
				return true;
			}
			else
			{
				return false;
			}
		}
	});
	return false;
}


function likeGallery(Gallery_Category)
{
	var Gallery_Category = Gallery_Category;
	Gallery_Category = Gallery_Category.split('_');
	var Gallery = Gallery_Category[0];
	var Category = Gallery_Category[1];
	
	var Like = "Yes";
	$('#waiting_LikeDontLike_'+Gallery+'_'+Category).show();
	$.post("backend.php", { Gallery: Gallery, Category: Category, Like: Like, rand:Math.random() }, function(data)
	{
		
		if($('#waiting_LikeDontLike_'+Gallery+'_'+Category).hide())
		{
			if(data != "0")
			{
				$("#likeCount_"+Gallery+'_'+Category).html(data);
			}
			
		}
	});
	
}


<!-- Error Suppressor -->
function silentErrorHandler() {return true;}
window.onerror=silentErrorHandler;

<!-- Error Suppressor -->
  
 
function userLogout()
{
		cache:false;
	
		$('#status').hide();
		$(".welMessage").hide();
		$('#waiting').show();

		var totalVideoIds = $('#totalVideoIds').val();
		if(totalVideoIds != null)
		{
			totalVideoIds = totalVideoIds.split(',');		
			//alert(totalVideoIds);
		}
		
		var totalImageIds = $('#totalImageIds').val();
		if(totalImageIds != null)
		{
			//alert(totalImageIds);	
			totalImageIds = totalImageIds.split(',');			
		}
		
		var totalNewsIds = $('#totalNewsIds').val();
		if(totalNewsIds != null)
		{
			//alert(totalNewsIds);	
			totalNewsIds = totalNewsIds.split(',');				
		}
		
		
		var logoutval = "Logout";
		
		$.post("backend.php", { Logout: logoutval }, function(data) {

				if($('#waiting').hide()){
				if(data == 2)
				{
						if(totalVideoIds != null)
						{
							if(totalVideoIds.length > 0)
							{
								for(j=0; j < totalVideoIds.length; j++)
								{
									//alert(totalVideoIds[j]);
									$('#example6_'+totalVideoIds[j]).removeClass().addClass('example6').css("display", "none");
									$('#example8_'+totalVideoIds[j]).removeClass().addClass('example8').css("display", "block");
								}			
							}
						}
						
						if(totalImageIds != null)
						{
							if(totalImageIds.length > 0)
							{
								for(j=0; j < totalImageIds.length; j++)
								{
									//alert(totalImageIds[j]);
									$('#example6_'+totalImageIds[j]).removeClass().addClass('example6').css("display", "none");
									$('#example8_'+totalImageIds[j]).removeClass().addClass('example8').css("display", "block");
								}			
							}
						}
						
						if(totalNewsIds != null)
						{
							if(totalNewsIds.length > 0)
							{
								for(j=0; j < totalNewsIds.length; j++)
								{
									//alert(totalNewsIds[j]);
									$('#example6_'+totalNewsIds[j]).removeClass().addClass('example6').css("display", "none");
									$('#example8_'+totalNewsIds[j]).removeClass().addClass('example8').css("display", "block");
								}			
							}
						}	
						
						$('.example6').removeClass().addClass('example6').css("display", "none");
						$('.example8').removeClass().addClass('example8').css("display", "block");
						
					
						$('#loginSuccessMessage').css("display", "none");						
						$('#loginTitle').css("display", "block");
						$('#loginInputs').css("display", "block");
						$('#logoutTitle').css("display", "none");
						
						$('#menu_and_you').removeClass().addClass('notloggedin').attr('href', 'index.php?Notloggedin');
						
						$('#notloggedin').removeClass().addClass('notloggedin').attr('href', 'index.php?Notloggedin');
						
						$('#footermenu_and_you').removeClass().addClass('footermenu_notloggedin').attr('href', 'index.php?Notloggedin');
						
						if($('#footermenu_notloggedin').removeClass().addClass('footermenu_notloggedin').attr('href', 'index.php?Notloggedin'))
						{
							if(pNameUrlVar=="and_you")
							{							
								location.href = "home.php";	
							}							
							$('.joinNow').css("display", "block");
							$('#loginTable').css("display", "block");
							$(".welMessage").html('');
							//$(".welMessage_withoutwelProfImage .topLogout").html('');
							//var signIn = "<a href=\"javascript:;\" id=\"signin\" onclick=\"loginAlert(this.id)\"> Sign In</a>";
							var signIn = "<a href=\"javascript:;\" id=\"signin\" onclick=\"loginAlert(this.id)\"> Sign In</a> <span class=\"bar\">|</span> <a href=\"javascript:;\" id=\"troubleshoot\" onclick=\"troubleShoot(this.id)\"  style=\"margin-left:0px;\">Having trouble?</a>";
							//$(".welMessageWrap .topLogout").css("margin-left","110px");
							$(".welMessageWrap .topLogout").css("margin-left","18px");
							$(".welMessageWrap .topLogout").html(signIn);
							$(".logoutText span.bar").html('');
							$(".logoutText .logoutTopLink").html('');
							$("#EmailID").val("Email");
							$("#Password").val("Password");
							$("#loginPopStatus_wel").hide();
							$("#loginPopStatus_wel").css("color","#015301");
							$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
							$("#loginPopStatus_wel").css("width","352px");
							$("#loginPopStatus_wel").html('You have been successfully logged out.');
							$.fn.colorbox.close(); 
							
							//$.fn.colorbox({inline:true,href:'#loginPopStatus_wel'}); 
							/** To center align Message **/
							//CenterAlignMessageDiv('colorbox');
							/** End **/
						}
						
				}
			}
			
			});
			//alert(pNameUrlVar);
			if(pNameUrlVar=="my_news")
			{
				$('.showblk').removeClass().addClass('hideblk');
				$('.hideblk').hide();
			}
			return false;
}


function userLogin(ID)
{			
	if(typeof (ID) == 'object')
	{
		var formID = ID.data.ID;
	}
	else
	{
		var formID = ID;
	}
	
	var totalVideoIds = $('#totalVideoIds').val();
	if(totalVideoIds != null)
	{
		totalVideoIds = totalVideoIds.split(',');
		//alert(totalVideoIds);
	}
	
	var totalImageIds = $('#totalImageIds').val();
	if(totalImageIds != null)
	{
		//alert(totalImageIds);	
		totalImageIds = totalImageIds.split(',');		
		
	}
	
	var totalNewsIds = $('#totalNewsIds').val();
	if(totalNewsIds != null)
	{
		//alert(totalNewsIds);	
		totalNewsIds = totalNewsIds.split(',');		
		
	}
	
	cache:false;
	
	$('#status').hide();
	$(".welMessage").show();
	if(formID == 'login_form')
	{
		$('#waiting_'+formID).show();
	}
	else
	{
		$('#waiting_'+formID).show();
	}
	var unameval = $("#EmailID").val();
	var pwordval = $("#Password").val();
	
	$.post("backend.php", { username: unameval,
	password: pwordval }, function(data) {
		if($('#waiting_'+formID).hide())
		{
			if(data != 1 && data != 2 && data != 3)
			{
				
				$('#loginTitle').css("display", "none");
				$('#loginSuccessMessage').css("display", "block");
			
				$('#logoutTitle').css("display", "block");
				$('#logoutTitle').css("cursor", "pointer");
				
				if(totalVideoIds != null)
				{
					if(totalVideoIds.length > 0)
					{
						for(j=0; j < totalVideoIds.length; j++)
						{
							//alert(totalVideoIds[j]);
							$('#example8_'+totalVideoIds[j]).removeClass().addClass('example8').css("display", "none");
							$('#example6_'+totalVideoIds[j]).removeClass().addClass('example6').css("display", "block");
						}			
					}
				}
				
				if(totalImageIds != null)
				{
					if(totalImageIds.length > 0)
					{
						for(j=0; j < totalImageIds.length; j++)
						{
							//alert(totalImageIds[j]);
							$('#example8_'+totalImageIds[j]).removeClass().addClass('example8').css("display", "none");
							$('#example6_'+totalImageIds[j]).removeClass().addClass('example6').css("display", "block");
						}			
					}
				}
				
				if(totalNewsIds != null)
				{
					if(totalNewsIds.length > 0)
					{
						for(j=0; j < totalNewsIds.length; j++)
						{
							//alert(totalNewsIds[j]);
							$('#example8_'+totalNewsIds[j]).removeClass().addClass('example8').css("display", "none");
							$('#example6_'+totalNewsIds[j]).removeClass().addClass('example6').css("display", "block");
						}			
					}
				}
				
				/*$('.example8').css("display", "none");
				$('.example6').css("display", "block");*/
				
				$('.example8').removeClass().addClass('example8').css("display", "none");
				$('.example6').removeClass().addClass('example6').css("display", "block");
				
				$('#loginTable').css("display", "none");
				$('#loginInputs').css("display", "none");
				$('.joinNow').css("display", "none");
				$('#notloggedin').attr('onclick', '');
				$('#notloggedin').attr('href', '').attr('onclick', '').removeClass().attr('href', 'and_you.php').addClass('menu_and_you');
				$('.notloggedin').attr('href', '').attr('onclick', '').removeClass().attr('href', 'and_you.php').addClass('menu_and_you');
				//$('#menu_and_you').removeClass().addClass('notloggedin').attr('href', 'index.php?Notloggedin');
				
				$('#footermenu_notloggedin').attr('href', 'and_you.php').removeClass().addClass('footermenu_and_you');
				//$('#footermenu_and_you').removeClass().addClass('footermenu_notloggedin').attr('href', 'index.php?Notloggedin');
				
				$(".welMessage").html(data);
				//$(".welMessage_withoutwelProfImage .topLogout").html(data);
				$(".welMessageWrap .topLogout").css("margin-left","0px");
				$(".welMessageWrap .topLogout").html(data);					
				$(".logoutText span.bar").html('|');
				$(".logoutText .logoutTopLink").html('Logout');
				$("#loginPop").hide();
				$("#loginPopStatus_wel").show();
				$("#loginPopStatus_wel").css("color","#015301");
				$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
				$("#loginPopStatus_wel").css("width","352px");
				$("#loginPopStatus_wel").html('You are successfully logged in.');
				//$.fn.colorbox.close(); 
				/** To center align Message **/
				CenterAlignMessageDiv('colorbox');
				/** End **/
				/******** ************/
				/** Check Press user **/
				//alert(unameval+"="+pwordval);
				var PostData1 = "";
				var CheckPressUser = "CheckPressUser";
				PostData1 = "username="+unameval+"&CheckPressUser="+CheckPressUser;	
				//alert(PostData1);
				$.ajax(
				{		
					type: "POST",
					url: "../CommonMethods.php",
					//ajaxStart : ShowWait('Errcomments'),
					data: PostData1,
					success: function(msg1)
					{
						//alert(msg1);
						if(msg1 == 5)
						{
							PressUser = "Yes";
							if(PressUser == 'Yes')
							{
								//alert(PressUser);
								if(pNameUrlVar=="my_news")
								{
									$('.hideblk').removeClass().addClass('showblk');
									$('.showblk').show();
								}
							}
						}
						else
						{
							PressUser = "No";	
						}
					}
				}
				);
				/******** ************/
				/** End Check Press user **/
			}
			if(data == 1)
			{
				
				data = "Please enter login credentials.";
				if(formID == 'login_form')
				{
					$('#status').css("display", "block");
					$("#status").css("color","#ff0000");
					$("#status").html(data);
				}
				$("#loginPopStatus").css("color","#ff0000");
				$("#loginPopStatus").html(data);
			}
			if(data == 2)
			{
				
				data = "Wrong username or password.";
				if(formID == 'login_form')
				{
					$('#status').css("display", "block");
					$("#status").css("color","#ff0000");
					$("#status").html(data);
				}
				$("#loginPopStatus").show();
				$("#loginPopStatus").css("color","#ff0000");
				$("#loginPopStatus").html(data);
				
			}
			if(data == 3)
			{						
				data = "Please activate your account.";
				if(formID == 'login_form')
				{
					$('#status').css("display", "block");
					$("#status").css("color","#ff0000");
					$("#status").html(data);
				}
				$("#loginPopStatus").show();
				$("#loginPopStatus").css("color","#ff0000");
				$("#loginPopStatus").html(data);
			}					
		}				
	});
	return false;
}

function CenterAlignMessageDiv(id)
{
	  //alert(id);
	  var pos=parseInt($(window).scrollTop())+parseInt($(window).height());
	  pos_sub = parseInt($(window).height())/2;
	  
	  //$('#'+id).css("top",pos-pos_sub+"px");
	  $('#'+id).css("top",pos-parseInt(400)+"px");	  
	  $('#'+id).show(); //display the message box
	  /*$(window).scroll(function()
	  {
		 var pos=parseInt($(window).scrollTop())+parseInt($(window).height());
		 pos_sub = parseInt($(window).height())/2;
		$('#'+id).animate({top:pos-pos_sub+"px" },{queue: false, duration: 500});
	  });*/
}

function validateLoginForm(Form)
{
	//if(ValidateForm(this.form,ObjFields)){userLogin('submit_POP');}
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();		
	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("EmailID","","text","email","Please enter valid email id","Please enter email id"));
	ObjFields.Add(new Field("Password","","text","string","Please enter password",null,null));
	if(ValidateForm(Form,ObjFields)){userLogin('submit_POP');}
}

function validateLoginFormIndex(Form)
{
	userLogin(Form);
}

function validateRegistrationForm(Form)
{
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("ImageID","","text","numeric","Please choose profile picture",null,null));
	ObjFields.Add(new Field("Firstname","","text","string","Please enter firstname",null,null));
	ObjFields.Add(new Field("Lastname","","text","string","Please enter lastname",null,null));
	ObjFields.Add(new Field("EmailID","","text","email","Please enter valid email id","Please enter email id"));

	ObjFields.Add(new Field("Password","","text","length","Password must be minimum 6 characters long and maximum 20 characters","Please enter password",new Range(5,21)));
	ObjFields.Add(new Field("ConfirmPassword","","text","compare","Password and confirm password must match",null,new Comparer("Password"),false));
	//ObjFields.Add(new Field("Mobile","","text","numeric","Please enter mobile number",null,null));	
	//ObjFields.Add(new Field("Address","","text","string","Please enter postal address",null,null));
	ObjFields.Add(new Field("City","","text","string","Please enter city",null,null));
	if(ValidateForm(Form,ObjFields)){register();}
}

function validateRegistrationForm1(Form)
{
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("ImageID","","text","numeric","Please choose profile picture",null,null));
	ObjFields.Add(new Field("Firstname","","text","string","Please enter firstname",null,null));
	ObjFields.Add(new Field("Lastname","","text","string","Please enter lastname",null,null));	
	//ObjFields.Add(new Field("Mobile","","text","numeric","Please enter mobile number",null,null));	
	//ObjFields.Add(new Field("Address","","text","string","Please enter postal address",null,null));
	ObjFields.Add(new Field("City","","text","string","Please enter city",null,null));
	if(ValidateForm(Form,ObjFields)){registerEdit();}
}

function validateChangePassword(Form)
{
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("OldPassword","","text","length","Password must be minimum 6 characters long and maximum 20 characters","Please enter password",new Range(5,21)));
	ObjFields.Add(new Field("NewPassword","","text","length","Password must be minimum 6 characters long and maximum 20 characters","Please enter password",new Range(5,21)));
	if(ValidateForm(Form,ObjFields)){changePassword();}
}


function validateUploadVideo(Form)
{
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("upload-a-video","","text","string","Please upload video",null,null));
	if(ValidateForm(Form,ObjFields)){uploadVideo();}
}

function validatePasteVideoUrl(Form)
{
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("pasteVideoUrl","","text","string","Please paste video url",null,null));
	if(ValidateForm(Form,ObjFields)){pasteVideoUrl();}
}


function validateUploadPhoto(Form)
{
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("upload-a-photo","","text","string","Please upload photo",null,null));
	if(ValidateForm(Form,ObjFields)){uploadPhoto();}
}

function pasteVideoUrl(){
	var PostData = "";
	PostData = "pasteVideoUrl="+document.getElementById('pasteVideoUrl').value+"&EmailID="+document.getElementById('EmailID').value+"&Action="+document.getElementById('Action').value;	
	//alert(PostData);
	$.ajax({		
		type: "POST",
		url: "../CommonMethods.php",
		//ajaxStart : ShowWait('Errcomments'),
		data: PostData,
		success: function(msg)
			{
				//alert(msg);
				if(msg == 1)
				{
					data = "Video Url Sent.";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");						
					$("#regPopStatus").html(data);
	
					//alert(document.getElementById('VisitorID').value);
					/** To center align Message **/
					CenterAlignMessageDiv('colorbox');
					/** End **/
				}					
				if(msg == 2)
				{
					data = "Unable to send video url. Please contact webmaster!";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");
					$("#regPopStatus").html(data);	
				}				
			}				
		});
}

function validatePressForm(Form)
{
	var ObjFields=(new FieldsList()).instanceOf();

	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("Firstname","","text","string","Please enter firstname",null,null));
	ObjFields.Add(new Field("Lastname","","text","string","Please enter lastname",null,null));
	ObjFields.Add(new Field("Organisation","","text","string","Please enter organisation",null,null));
	ObjFields.Add(new Field("EmailID","","text","email","Please enter valid email id","Please enter email id"));

	ObjFields.Add(new Field("Password","","text","length","Password must be minimum 6 characters long and maximum 20 characters","Please enter password",new Range(5,21)));
	ObjFields.Add(new Field("ConfirmPassword","","text","compare","Password and confirm password must match",null,new Comparer("Password"),false));
	ObjFields.Add(new Field("Mobile","","text","numeric","Please enter mobile number",null,null));	
	ObjFields.Add(new Field("Address","","text","string","Please enter postal address",null,null));
	ObjFields.Add(new Field("City","","text","string","Please enter city",null,null));
	if(ValidateForm(Form,ObjFields)){pressRegister();}
}


function ClearMessage()
{
	document.getElementById('ErrFirstname').innerHTML='';
	document.getElementById('ErrLastname').innerHTML='';
	document.getElementById('ErrEmailID').innerHTML='';
	document.getElementById('ErrPassword').innerHTML='';
	document.getElementById('ErrConfirmPassword').innerHTML='';
	document.getElementById('ErrMobile').innerHTML='';
	document.getElementById('ErrCity').innerHTML='';
	document.getElementById('ErrAddress').innerHTML='';
	document.getElementById('ErrImageID').innerHTML='';
	document.getElementById('ImageID').value = '';

}
function selectImageID(ImageID, ImageVal, profilePicIds)
{

	profilePicIds = profilePicIds.split(',');
	totalProfilePics = profilePicIds.length;
	ProfPicID = document.getElementById(ImageID);
	ProfPicID.value = ImageVal;


	for(i = 0; i < totalProfilePics; i++)
	{
		if(parseInt(profilePicIds[i]) == parseInt(ImageVal))
		{
			document.getElementById('profilePic_'+profilePicIds[i]).style.border = "1px solid #ff0000";
		}
		else
		{
			document.getElementById('profilePic_'+profilePicIds[i]).style.border = "1px solid #fff";
		}
	}
}

function deSelectImageID()
{
	var profilePicIds = document.getElementById('totalProfilePics').value;
	profilePicIds = profilePicIds.split(',');
	totalProfilePics = profilePicIds.length;

	//alert(totalProfilePics);

	for(i = 0; i < totalProfilePics; i++)
	{
		document.getElementById('profilePic_'+profilePicIds[i]).style.border = "1px solid #fff";
	}
	document.getElementById('ImageID').value = '';
}

function register(){

    	var PostData = "";
		PostData = "Firstname="+document.getElementById('Firstname').value+"&Lastname="+document.getElementById('Lastname').value+"&EmailID="+document.getElementById('EmailID').value+"&Password="+document.getElementById('Password').value+"&Mobile="+document.getElementById('Mobile').value+"&City="+document.getElementById('City').value+"&Address="+document.getElementById('Address').value+"&ImageID="+document.getElementById('ImageID').value+"&Action="+document.getElementById('Action').value;	
//alert(PostData);
		$.ajax(
			{	
				type: "POST",
				url: "../CommonMethods.php",
				ajaxStart : ShowWait('waiting_submit_POP'),
				data: PostData,
				success: function(msg)
				{
					//alert(msg);
					if(msg == 1)
					{
						//data = "You are successfullly registered.<br />Please check your email to activate your account.";
						data = "You are successfullly registered.";
						$("#regPop").css("display","none");						
						$("#regPopStatus").css("display","block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");						
						$("#regPopStatus").html(data);
						/** To center align Message **/
						//$.fn.colorbox.close(); 
						CenterAlignMessageDiv('colorbox');
						/** End **/

					}
					if(msg == 3)
					{
						//data = "This user is already exists in our database.Try with another email id.";
						data = "This email id is already exists.";
						$("#ErrEmailID").html(data);
					}
				}
			}
		);		
}

function pressRegister(){

    	var PostData = "";
		PostData = "Firstname="+document.getElementById('Firstname').value+"&Lastname="+document.getElementById('Lastname').value+"&Organisation="+document.getElementById('Organisation').value+"&EmailID="+document.getElementById('EmailID').value+"&Password="+document.getElementById('Password').value+"&Mobile="+document.getElementById('Mobile').value+"&City="+document.getElementById('City').value+"&Address="+document.getElementById('Address').value+"&Action="+document.getElementById('Action').value;	
//alert(PostData);
		$.ajax(
			{		
				type: "POST",
				url: "../CommonMethods.php",
				ajaxStart : ShowWait('waiting_submit_POP'),
				data: PostData,
				success: function(msg)
				{
					//alert(msg);
					if(msg == 1)
					{
						data = "You are successfullly registered for press.";
						$("#regPop").css("display","none");
						$("#regPopStatus").css("display","block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");						
						$("#regPopStatus").html(data);
						//$.fn.colorbox.close(); 		
						/** To center align Message **/
						CenterAlignMessageDiv('colorbox');
						/** End **/

					}
					if(msg == 3)
					{
						//data = "This user is already exists in our database.Try with another email id.";
						data = "This email id is already exists.";
						$("#ErrEmailID").html(data);
					}
				}
			}
		);
	}
	

function registerEdit(){
		var PostData = "";
		PostData = "VisitorID="+document.getElementById('VisitorID').value+"&Firstname="+document.getElementById('Firstname').value+"&Lastname="+document.getElementById('Lastname').value+"&Mobile="+document.getElementById('Mobile').value+"&City="+document.getElementById('City').value+"&Address="+document.getElementById('Address').value+"&ImageID="+document.getElementById('ImageID').value+"&Action="+document.getElementById('Action').value;	
//alert(PostData);
cache:false;
		$.ajax(
			{		
				type: "POST",
				url: "../CommonMethods.php",
				ajaxStart : ShowWait('waiting_submit_POP'),
				data: PostData,
				success: function(msg)
				{
					//alert(msg);
					if(msg == 1)
					{
						data = "You are successfullly edit your settings.";
						$("#regPop").css("display","none");	
						$("#regPopStatus").css("display","Block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");						
						$("#regPopStatus").html(data);						
						$(".welProfMessage").html('Hi '+document.getElementById('Firstname').value+' '+document.getElementById('Lastname').value);
						$("#andYouUserName").html(document.getElementById('Firstname').value+' '+document.getElementById('Lastname').value);
						
						//alert(document.getElementById('VisitorID').value);
						
						GetProfilePic(document.getElementById('VisitorID').value);
						/** To center align Message **/
						CenterAlignMessageDiv('colorbox');
						/** End **/
					}
					if(msg == 2)
					{
						//data = "This user is already exists in our database.Try with another email id.";
						data = "Unable to change your settings.";
						$("#regPop").css("display","none");						
						$("#regPopStatus").css("display","Block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");						
						$("#regPopStatus").html(data);						
						
						//alert(document.getElementById('VisitorID').value);
						/** To center align Message **/
						CenterAlignMessageDiv('colorbox');
						/** End **/
					}
				}				
			}
		);
}
function ShowWait(ID){
	$("#"+ID).show();	
}
function changePassword(){
		var PostData = "";
		PostData = "VisitorID="+document.getElementById('VisitorID').value+"&OldPassword="+document.getElementById('OldPassword').value+"&NewPassword="+document.getElementById('NewPassword').value+"&Action="+document.getElementById('Action').value;	
		//alert(PostData);
		$.ajax({		
			type: "POST",
			url: "../CommonMethods.php",
			//ajaxStart : ShowWait('Errcomments'),
			data: PostData,
			success: function(msg)
				{
					//alert(msg);
					if(msg == 1)
					{
						data = "You are successfullly change your password.";
						$("#regPop").css("display","none");						
						$("#regPopStatus").css("display","Block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");						
						$("#regPopStatus").html(data);						
						$(".welProfMessage").html('Hi '+document.getElementById('Firstname').value+' '+document.getElementById('Lastname').value);
						$("#andYouUserName").html(document.getElementById('Firstname').value+' '+document.getElementById('Lastname').value);

						//alert(document.getElementById('VisitorID').value);

						GetProfilePic(document.getElementById('VisitorID').value);
						/** To center align Message **/
						CenterAlignMessageDiv('colorbox');
						/** End **/
					}
					if(msg == 2)
					{
						data = "Your password mismatch.";						
						$("#ErrOldPassword").css("display","Block");					
						$("#ErrOldPassword").html(data);	
					}
					if(msg == 5)
					{
						data = "Your password has been changed but can't mailed on your mail address";
						$("#regPop").css("display","none");						
						$("#regPopStatus").css("display","Block");
						$("#regPopStatus").css("color","#015301");
						$("#regPopStatus").css("padding","15px 13px 20px 17px");
						$("#regPopStatus").css("width","357px");
						$("#regPopStatus").html(data);	
					}
				}				
			});
}


function uploadVideo(){
	var PostData = "";
	PostData = "upload-a-video="+document.getElementById('upload-a-video').value+"&Action="+document.getElementById('Action').value;	
	//alert(PostData);
	$.ajax({		
		type: "POST",
		url: "../CommonMethods.php",
		//ajaxStart : ShowWait('Errcomments'),
		data: PostData,
		success: function(msg)
			{
				//alert(msg);
				if(msg == 1)
				{
					data = "Video Uploaded.";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");						
					$("#regPopStatus").html(data);
	
					//alert(document.getElementById('VisitorID').value);
					/** To center align Message **/
					CenterAlignMessageDiv('colorbox');
					/** End **/
				}					
				if(msg == 2)
				{
					data = "Unable to upload video. Please contact webmaster!";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");
					$("#regPopStatus").html(data);	
				}				
			}				
		});
}



function uploadPhoto(){
	var PostData = "";
	PostData = "upload-a-photo="+document.getElementById('upload-a-photo').value+"&Action="+document.getElementById('Action').value;	
	//alert(PostData);
	$.ajax({		
		type: "POST",
		url: "../CommonMethods.php",
		//ajaxStart : ShowWait('Errcomments'),
		data: PostData,
		success: function(msg)
			{
				//alert(msg);
				if(msg == 1)
				{
					data = "Photo Sent.";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");						
					$("#regPopStatus").html(data);
	
					//alert(document.getElementById('VisitorID').value);
					/** To center align Message **/
					CenterAlignMessageDiv('colorbox');
					/** End **/
				}					
				if(msg == 2)
				{
					data = "Unable to upload photo. Please contact webmaster!";
					$("#regPop").css("display","none");						
					$("#regPopStatus").css("display","Block");
					$("#regPopStatus").css("color","#015301");
					$("#regPopStatus").css("padding","15px 13px 20px 17px");
					$("#regPopStatus").css("width","357px");
					$("#regPopStatus").html(data);	
				}				
			}				
		});
}

function forgotPassword(){
		var PostData = "";
		PostData = "EmailID="+document.getElementById('EmailID').value+"&Action=ForgotPassword";	
		//alert(PostData);
		$.ajax({		
			type: "POST",
			url: "CommonMethods.php",
			//ajaxStart : ShowWait('Errcomments'),
			data: PostData,
			success: function(msg)
				{
					//alert(msg);
					if(msg == 1)
					{
						data = "Your password has been sent to your email address.";
						$("#loginPop").css("display","none");						
						$("#loginPopStatus_wel").css("display","Block");
						$("#loginPopStatus_wel").css("color","#015301");
						$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
						$("#loginPopStatus_wel").css("width","357px");						
						$("#loginPopStatus_wel").html(data);

						//alert(document.getElementById('VisitorID').value);
						/** To center align Message **/
						CenterAlignMessageDiv('colorbox');
						/** End **/
					}					
					if(msg == 3)
					{
						data = "Your password has been changed but can't mailed on your mail address. Please contact webmaster!";
						$("#loginPop").css("display","none");						
						$("#loginPopStatus_wel").css("display","Block");
						$("#loginPopStatus_wel").css("color","#015301");
						$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
						$("#loginPopStatus_wel").css("width","357px");						
						$("#loginPopStatus_wel").html(data);	
					}
					if(msg == 2)
					{
						data = "Something is wrong with your email address. Please check.";
						$("#loginPop").css("display","none");						
						$("#loginPopStatus_wel").css("display","Block");
						$("#loginPopStatus_wel").css("color","#015301");
						$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
						$("#loginPopStatus_wel").css("width","357px");						
						$("#loginPopStatus_wel").html(data);
					}
				}				
			});
}

function GetProfilePic(ID)
{
		var PostData = "";
		PostData = "ProfileID="+ID+"&Action=getProfilePic";	
		//alert(PostData);
		$.ajax(
			{		
				type: "POST",
				url: "../CommonMethods.php",
				//ajaxStart : ShowWait('Errcomments'),
				data: PostData,
				success: function(msg)
				{
					//alert(msg);
					if(msg != "")
					{
						//alert(msg);
						var profilePicUrl = msg;
						var profilePic = "<img src=\""+profilePicUrl+"\" />";
						//alert(profilePic);
						$("#andYouUserPic").html(profilePic);
					}
					return msg;
				}				
			}
		);	
	
}


function selectVideoID(VideoID, VideoVal, totalVideoIDs)
{

	profilePicIds = profilePicIds.split(',');
	totalProfilePics = profilePicIds.length;
	ProfPicID = document.getElementById(ImageID);
	ProfPicID.value = ImageVal;


	for(i = 0; i < totalProfilePics; i++)
	{
		if(parseInt(profilePicIds[i]) == parseInt(ImageVal))
		{
			document.getElementById('profilePic_'+profilePicIds[i]).style.border = "1px solid #ff0000";
		}
		else
		{
			document.getElementById('profilePic_'+profilePicIds[i]).style.border = "1px solid #fff";
		}
	}
}
function ClearValue(ID)
{
	document.getElementById(ID).value='';	
}

/** Ravi R  10-8-2010 **/
function troubleShoot(ID)
{
	$("#"+ID).colorbox({innerWidth:382, innerHeight:428, href:"troubleshoot.php"});
}
function validateTroubleShootForm(Form)
{
	//alert(Form);
	var ObjFields=(new FieldsList()).instanceOf();		
	//new Field(FieldName,DefaultValue,FieldType,ValidationType,Message,EmptyMessage,Range)
	ObjFields.Add(new Field("EmailID","","text","email","Please enter valid email id","Please enter email id"));
	ObjFields.Add(new Field("Message","","text","string","Please enter message",null,null));
	if(ValidateForm(Form,ObjFields)){troubleShootMessage();}
}

function troubleShootMessage(){
	var PostData = "";
	PostData = "Message="+document.getElementById('Message').value+"&EmailID="+document.getElementById('EmailID').value+"&Action="+document.getElementById('Action').value;	
	//alert(PostData);
	$.ajax({		
		type: "POST",
		url: "../CommonMethods.php",
		ajaxStart : ShowWait('waiting_submit_POP'),
		data: PostData,
		success: function(msg)
			{
				//alert(msg);
				if(msg == 1)
				{
					data = "Trouble shoot message sent.";
					$("#loginPop").css("display","none");						
					$("#loginPopStatus_wel").css("display","Block");
					$("#loginPopStatus_wel").css("color","#015301");
					$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
					$("#loginPopStatus_wel").css("width","357px");						
					$("#loginPopStatus_wel").html(data);
	
					//alert(document.getElementById('VisitorID').value);
					/** To center align Message **/
					CenterAlignMessageDiv('colorbox');
					/** End **/
				}					
				if(msg == 2)
				{
					data = "Unable to send trouble shoot message. Please contact webmaster!";
					$("#loginPop").css("display","none");						
					$("#loginPopStatus_wel").css("display","Block");
					$("#loginPopStatus_wel").css("color","#015301");
					$("#loginPopStatus_wel").css("padding","15px 13px 20px 17px");
					$("#loginPopStatus_wel").css("width","357px");
					$("#loginPopStatus_wel").html(data);	
				}				
			}				
		});
}
/** Ravir 10-8-2010 **/
function showForgotPass(ID)
{
	$("#"+ID).colorbox({transition:"none", innerWidth:387, innerHeight:180, slideshow:false, iframe: false, href:"forgotPassword.php"});
}
/** End **/

function popupforiamgeupload()
{
	data = "Image uploaded succesfully. Click here to continue.";
	$("#Uploadphotopopup").css("display","Block");
	$("#Uploadphotopopup").css("color","#015301");
	$("#Uploadphotopopup").css("padding","15px 13px 20px 17px");
	$("#Uploadphotopopup").css("width","357px");
	$("#Uploadphotopopup").css("cursor","pointer");
	$("#Uploadphotopopup").html(data);
	
	  var pos=parseInt($(window).scrollTop())+parseInt($(window).height());
	  pos_sub = parseInt($(window).height())/2;
	  $('#Uploadphotopopup').css("top",pos-pos_sub+"px");
	  $('#Uploadphotopopup').show(); //display the message box
	  $(window).scroll(function()
	  {
		 var pos=parseInt($(window).scrollTop())+parseInt($(window).height());
		 pos_sub = parseInt($(window).height())/2;
		$('#Uploadphotopopup').animate({top:pos-pos_sub+"px" },{queue: false, duration: 500});
	  });	
	  
	var msgbox = document.getElementById("Uploadphotopopup");
  	var x = (window.innerWidth / 2) - (msgbox.offsetWidth / 2);
  	var y = (window.offsetHeight / 2) - (msgbox.offsetHeight / 2);              
  	msgbox.style.top = y;
  	msgbox.style.left = x;	  
}
