
$(document).ready(function()
{
    
/*   
var call_top_story=function()
{$.post("/outerprofilecss/ajax_top_story.php",function(data)
{$("#ajax_top_story").html(data);});}
call_top_story();
var call_gc=function()
{$.post("/outerprofilecss/ajax_gc.php",function(data)
{$("#ajax_gc").html(data);});}
call_gc();

$("#cookie_si").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(1);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});
*/

/*
$("#view_full_profile_sign").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(1);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#close_div_login").click(function()
{$("#sign_in_fromprofile").fadeOut("slow",function()
{$("#login_pages").val('');$("#Layer4").hide();})});$("#cancel_login").click(function()
{$("#sign_in_fromprofile").fadeOut("slow",function()
{$("#login_pages").val('');$("#Layer4").hide();})});$("#contact_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(2);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#sign_in_and_add").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(2);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#network_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(3);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#send_msg").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(4);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#scrapbook_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(5);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#member_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(6);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#member_login_lnk").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(6);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#community_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(7);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#community_login1").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(7);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#app_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(8);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#app_login1").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(8);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#mentor_login").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(9);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});$("#mentor_login1").click(function()
{$("#sign_in_fromprofile").fadeIn("slow",function()
{$("#login_pages").val(8);$("#sign_in_fromprofile").focus();$("#Layer4").hide();})});});$(document).ready(function()
{function sign_in_function(e){$("#Layer4").removeClass().addClass('messagebox').text('Validating........').fadeIn(500);if($('#email_login').val()=="")
{$("#Layer4").fadeTo(200,0.1,function()
{$(this).html('Please enter your email id').addClass('messageboxerror').fadeTo(900,1,function()
{$('#email_login').focus();return false;});});}
else if($('#email_login').val()!="")
{var vallll=$('#email_login').val();var str=vallll.replace(/^\s+|\s+$/g,'');var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!filter.test(str))
{$("#Layer4").fadeTo(200,0.1,function()
{$(this).html('Please enter a valid email id').addClass('messageboxerror').fadeTo(900,1,function()
{$('#email_login').focus();});});}else if($('#password_login').val()=="")
{$("#Layer4").fadeTo(200,0.1,function()
{$(this).html('Please enter your password').addClass('messageboxerror').fadeTo(900,1,function()
{$('#password_login').val("");$('#password_login').focus();});});}else
{if(document.getElementById("remember_me").checked==true)
{var remme=1;}else if(document.getElementById("remember_me").checked==false)
{var remme="";}
$.post("/outerprofilecss/login_details_check.php",{email:$('#email_login').val(),password:$('#password_login').val(),checkbox:remme,login_pages:$('#login_pages').val(),Submit:$('#Submit').val(),profile_id:$('#profile_id').val()},function(data)
{var errtext="Incorrect email id or password. Please try again.";var errtext1="Sorry some error is coming"
if(data==errtext||data==errtext1)
{$("#Layer4").fadeTo(200,0.1,function()
{$(this).html(data).addClass('messageboxerror').fadeTo(900,1,function()
{$('#email_login').val("");$('#password_login').val("");$('#email_login').focus();return false;});});}else
{$("#Layer4").fadeTo(200,0.1,function()
{$(this).html('Loading....').addClass('messageboxok').fadeTo(900,1,function()
{document.location=data;});});}});}}
return false;}
$("#sign_in1").click(sign_in_function);$("#newmahi2").keypress(function(evt)
{if(evt.keyCode==13)
{sign_in_function();}});$("#email_login").keypress(function(){$("#Layer4").hide();});$("#password_login").keypress(function(){$("#Layer4").hide();});


*/

function captcha_change()
{$("#captcha_image_change").attr({src:'/news/captcha/CaptchaSecurityImages.php?'+Date.parse(new Date().toString())});}




function forward_form(e1)
{$("#Layer5").removeClass().addClass('messagebox1').text('Validating........').fadeIn(500);var sento_email=$("#sendto").val();var trim_sent_to=sento_email.replace(/^\s+|\s+$/g,'');var arr=sento_email.split(",");if(arr.length>0)
{for(var i=0;i<arr.length;i++)
{if(arr[i].replace(/^\s+|\s+$/g,'')=="")
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html("Please enter receiver's email id").addClass('messageboxerror1').fadeTo(900,1,function()
{$('#sendto').val("");$('#sendto').focus();return false;});});return false;}else
{str=arr[i];var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!filter.test(str))
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html("Please enter a valid email id").addClass('messageboxerror1').fadeTo(900,1,function()
{$('#sendto').focus();return false;});});return false;}}}}
var aaaa=$('#your_name').val();var replace_name_space=aaaa.replace(/^\s+|\s+$/g,'');var flag_for_special_char=false;var iChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var i=0;i<aaaa.length;i++)
{if(iChars.indexOf(aaaa.charAt(i))!=-1)
{flag_for_special_char=true;break;}}
if($("#your_name").val()==""||replace_name_space=="")
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Please insert your name').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#your_name').val("");$('#your_name').focus();return false;});});return false;}else if(flag_for_special_char==false)
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Sorry! symbols or special characters are not allowed.').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#your_name').val("");$('#your_name').focus();return false;});});return false;}else if($("#your_email").val()=="")
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Please insert your email id').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#your_email').val("");$('#your_email').focus();return false;});});return false;}else if($("#your_email").val()!="")
{var val_email=$('#your_email').val();var str=val_email.replace(/^\s+|\s+$/g,'');var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!filter.test(str))
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Please enter a valid email id').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#your_email').val("");$('#your_email').focus();return false;});});return false;}else if($("#subject_profile").val()=="")
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Please insert subject').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#subject_profile').focus();return false;});});return false;}else if($("#images_txt").val()=="")
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html('Please the text from bottom image').addClass('messageboxerror1').fadeTo(900,1,function()
{$('#images_txt').val("");$('#images_txt').focus();return false;});});return false;}else if($("#forward_msg").val().replace(/^\s+|\s+$/g,'')=="")
{var return3=confirm("Send this message without text in message body?");if(return3==false)
{$("#Layer5").hide();$("#forward_msg").val("");$("#forward_msg").focus();return false;}else
{$.post("/outerprofilecss/emlprofile.php",{adminid1:$('#adminid1').val(),subject:$('#subject_profile').val(),toaddress:$('#sendto').val(),fromaddress:$('#your_email').val(),fromname:$('#your_name').val(),message:$('#forward_msg').val(),name:$('#admin_name').val(),images_txt:$('#images_txt').val()},function(data)
{var text="Please enter correct word from bottom image";if(data==text)
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html(data).addClass('messageboxerror1').fadeTo(900,1,captcha_change,function()
{captcha_change;});});}else
{captcha_change();$("#Layer5").fadeTo(200,0.1,function()
{$(this).html(data).addClass('messageboxok1').fadeTo(900,1,function()
{return false;});});$("#sendto").val("");$("#your_name").val("");$("#your_email").val("");$("#forward_msg").val("");$("#forward_msg").val("I found "+$("#admin_name").val()+"'s profile on SiliconIndia and thought you might be interested");$("#images_txt").val("");}});}}else
{$.post("/outerprofilecss/emlprofile.php",{adminid1:$('#adminid1').val(),subject:$('#subject_profile').val(),toaddress:$('#sendto').val(),fromaddress:$('#your_email').val(),fromname:$('#your_name').val(),message:$('#forward_msg').val(),name:$('#admin_name').val(),images_txt:$('#images_txt').val()},function(data)
{var text="Please enter correct word from bottom image";if(data==text)
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html(data).addClass('messageboxerror1').fadeTo(900,1,captcha_change,function()
{return false;});});}else
{$("#Layer5").fadeTo(200,0.1,function()
{$(this).html(data).addClass('messageboxok1').fadeTo(900,1,function()
{$("#forward_profile").hide(9500);});});}});}}
return false;}




$("#forward_profile_user1").click(function()
{$("#Layer5").hide();
$("#forward_profile").show(captcha_change);});
var fullname=$("#admin_name").val();
var tfullname=fullname.slice(0,60);
var subjt=fullname+"&rsquo;s profile."

$("#forward_profile").html("<div id='forwardmain'></div> <div id='forwardbottom'> <input type='hidden' id='focus_on_msg' value='0' /> <div id='close'>   <div align='right'><a id='close_profile_box' href='#' title='close'><img src='/images/x_d.gif' alt='close' border='0' /></a></div> </div><div class='arial12Ash'id='Layer5' style='display:none;' ></div>     <div class='h5' id='forward1'>Forward "+tfullname+"&rsquo;s updated profile </div> <div class='h2' id='forward2'>*Send to</div> <div id='forward3'><input name='sendto' id='sendto' type='text' class='photonewcommunity' / style='width:300px;'> </div> <div class='Verdana10Ash999' id='forward4'>Separate emails by comma </div> <div class='h2' id='forward5'>*Your name</div> <div id='forward6'><input id='your_name' name='your_name' type='text' class='photonewcommunity' / style='width:300px;'></div><div class='h2' id='forward7'>*Your's email</div>	<div id='forward8'><input id='your_email' name='your_email' type='text' class='photonewcommunity' / style='width:300px;'></div>	<div class='h2' id='forward9'>Subject</div> <div id='forward10'><input id='subject_profile' name='subject_profile' type='text' class='photonewcommunity'  style='width:300px;' value='"+subjt+"' readonly='readonly'></div>    <div class='h2' id='forward11'>Message</div> <div id='forward12'> 	  <textarea id='forward_msg' name='forward_msg' rows='4' class='photonewcommunity' style='width:300px;' >I found  "+fullname+"'s profile on SiliconIndia and thought you might be interested</textarea></div>	<div id='forward13'>	<div id='forward14'><img id='captcha_image_change' src=''></div> <div id='forward15'>	<div class='Verdana10Ash999' id='forward16'>*Type the characters you see in the image below</div>	<div id='forward17'><input name='images_txt' id='images_txt' type='text' class='photonewcommunity' / style='width:150px;'></div></div></div><div id='forward18'> <a href='#forwardmain' id='forward_submit' class='people' title='Forward  "+tfullname+"&rsquo;s updated profile'> Submit</a>&nbsp; <a id='close_forward_box123' href='#' class='graybtn' title='Cancel'> Cancel</a></div></div>");



$("#close_profile_box,#close_forward_box123").click(function()
{$("#Layer5").hide();$("#forward_profile").hide(captcha_change);});$("#forward_submit").click(forward_form);$("#forward_profile").keypress(function(event)
{if(event.keyCode==13&&$("#focus_on_msg").val()==0)
{forward_form();}});$("#sendto,#your_name,#your_email,#subject_profile,#forward_msg,#images_txt").keypress(function(){$("#Layer5").hide();});function load_data(e)
{var tot_url="/outerprofilecss/auto_member_search.php";if(!$(".ac_results").is(':visible')&&(e!=38||e!=40||e!=46||e!=9)&&e!=8)
{$.post(tot_url,{key:$("#search_member_from_outside").val()},function(data)
{if(data.length>0)
{$(".ac_results").html(data);$(".ac_results").show();$("#sss").val(1);$(".ac_results li").click(function()
{var val1=$(this).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$(".ac_results").hide();$(".ac_results").html("");})
setTimeout("$('.ac_results').hide();",90000);}else
{$(".ac_results").hide();$(".ac_results").html("");}});}else if($(".ac_results").is(':visible')&&e!=38&&e!=40&&e!=46&&e!=9&&$("#search_community").val()!='')
{$.post(tot_url,{key:$("#search_member_from_outside").val()},function(data)
{if(data.length>0)
{$(".ac_results").html(data);$(".ac_results").show();$("#sss").val(1);$(".ac_results li:first").select();$(".ac_results li").click(function()
{var val1=$(this).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$(".ac_results").hide();$(".ac_results").html("");})
setTimeout("$('.ac_results').hide();",90000);}else
{$(".ac_results").hide();$(".ac_results").html("");}});}else if($(".ac_results").is(':visible')&&(e==38||e==40||e==46||e==9||e==8))
{if(e==8)
{$(".ac_results").hide();$(".ac_results").html("");}else if(e==40)
{var tra=$("#sss").val();var sss=$(".ac_results ul li").size();if(tra>$(".ac_results ul li").size())
{$("#sss").val(1);tra=1;}
if(tra<0||tra==0)
{tra=1;}
if(tra==1)
{$(".num"+tra).addClass('hoverstyle');var val1=$(".num"+tra).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$("#sss").val(parseInt(tra)+1);$(".num"+sss).removeClass('hoverstyle');}
else
{$(".num"+tra).addClass('hoverstyle');var val1=$(".num"+tra).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$("#sss").val(parseInt(tra)+1);}
var tt=parseInt(tra)-1;$(".num"+tt).removeClass('hoverstyle');}else if(e==38)
{var tra=$("#sss").val();var sss=$(".ac_results ul li").size();var dd=parseInt(sss)-1;if(tra>$(".ac_results ul li").size())
{$("#sss").val(dd);tra=dd;}
if(tra<0||tra==0)
{tra=$(".ac_results ul li").size();}
if(tra!=1)
{$(".num"+1).removeClass('hoverstyle');}
if(tra==1)
{$(".num"+tra).addClass('hoverstyle');var val1=$(".num"+tra).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$("#sss").val(parseInt(tra)-1);$(".num"+sss).removeClass('hoverstyle');}
else
{var piyali=tra;$(".num"+piyali).addClass('hoverstyle');var val1=$(".num"+piyali).attr('id').replace(/_/g," ");val1=val1.replace(/_/g," ");val1=val1.replace(/_/g," ");$("#search_member_from_outside").focus(function(){$(this).val(val1)});$("#search_member_from_outside").blur(function(){$(this).val(val1)});$("#search_member_from_outside").val(val1);$("#sss").val(parseInt(tra)-1);}
var tt=parseInt(tra)+1;var tt1=parseInt(tra)-1;$(".num"+tt).removeClass('hoverstyle');$(".num"+tt1).removeClass('hoverstyle');}}else
{$(".ac_results").hide();$(".ac_results").html("");}}
$("#search_member_from_outside").keyup(function(e)
{val11=$(this).val();$(this).focus(function(){$(this).val(val11)});$(this).blur(function(){$(this).val(val11)});e1=e.keyCode;load_data(e1);});});
