
// function used to calculate maxlength of input fields */
function maxlength(field, size) {
	if (field.value.length > size) {
		field.value = field.value.substring(0, size);
	}
}

function isNum(o) {
try{
        if(isNaN(o.value)) {
                o.value='';
                o.focus();
                return false;
        }
    } catch(err){}
}

function checkYear(Fromid,Toid) {   
    try{
	if(document.getElementById(Fromid).value!="" && document.getElementById(Toid).value!=""){
		if(document.getElementById(Fromid).value > document.getElementById(Toid).value) {
		   	jQuery("#"+Toid+"Err").show();
			return false;	
		}
		else {
			jQuery("#"+Toid+"Err").hide();			
			return true;
		}
	}
	else {
		return true;
	}
    }catch(err){}	
}

function restorePix(cont)
{

if(cont.getAttribute('imgProc') == 1)
return;
lightVer = cont.innerHTML;
richVer = lightVer.replace(/img_/gi,"img");
cont.innerHTML = richVer;
cont.setAttribute('imgProc',1);
return ;
}

// function used to call omniture click events
function omnilog(l){
	if(typeof(s_gi)!='undefined'){
	 var s=s_gi(s_account);
	 s.pageName="ibibo:myibibo:event:"+l;
	 s.channel="myibibo";
	 s.prop3="s_prop3";
	 s.t()
	} //page view model
}

function stripTags(o)
{
var st =o.value;

st=st.replace("<!--","");
st=st.replace("-->","");
st=st.replace("<","");
st=st.replace(">","");

st=st.replace(/^\s*|\s*$/,"");
st=st.replace(/\"/g,"");
st=st.replace(/\'/g,"");

o.value=st.replace(/<.*>/g, '' );
o = o.value;
o= trim(o);
}


// function used to trim spaces input fields 
function trim(u) {
	return u.replace(/^\s+|\s+$|\<.*>/g, '' );
}


function pwdBoxFocus(element, txt, incHeight){
	jQuery('#dashPassword2').hide();
	jQuery('#p').show();
	jQuery('#p').get(0).value = '';	
	jQuery('#p').focus();
}

function pwdBoxBlur(){
	jQuery('#p').hide();
	jQuery('#dashPassword2').show();
	
}


function labelBoxFocus(element, txt, incHeight){
	txt = jQuery.trim( txt );
	if( element.value == txt ){
		element.style.color = '#000';
		element.value = '';
		if( incHeight ) {
           element.style.height = incHeight + 'px';
        }	
	}
}

function labelBoxBlur(element, txt, decHeight){
	var elementVal = jQuery.trim( element.value );
	if( elementVal == '' ){
		element.style.color = '#999';
		element.value = txt;
		if( decHeight && !jQuery.browser.msie) {
			element.style.height = decHeight + 'px';
		}
	}
	
}

var iShareUrl = 'http://ishare.ibibo.com/ff.php';
function makeUrl() {
	var ele = document.getElementById('findfr_share');
	ele.href = iShareUrl + "?usn=" +document.getElementById('usn').value + "&p=" +document.getElementById('p').value + "&s=" +document.getElementById('s').value ;
}
 
function processFindFriend(e){
	var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
	if( key == 13 ) {
		jQuery('#findfr_share').trigger('click');
	}
}


 /** Search Friend **/
function fr_search(frm){
	var searchStr = jQuery.trim( frm.searchStr.value );
	if( searchStr == '' || searchStr == 'Type name' ) {
		frm.searchStr.value = 'Type name';
		return false;
	}
}


function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}

/* function to call new notification counts[[used by dashboard as well as blurbs page]] */
function DashboardNewLink(uid)
 {
 var urlsend = '<?=base64_encode("http://feeds.ibibo.com/nfo/notification_stats.py?userid=$this->selfUId")?>';

 var correctUrl= base_url+"dashboard/fetchNotificationsCount/"+uid;
 
 jQuery.post(correctUrl,{},function(data){
 	
 //	data = '<response> <status>success</status> <userid>617a42f5-6263-4ac1-9ee8-9150c715e5b7</userid> <num_notifications>224230</num_notifications></response>';
 	numNotif = -1;
 	startTag = "<num_notifications>";
 	endTag = "</num_notifications>";
 	index1 = data.indexOf(startTag)+startTag.length;
 	index2 = data.indexOf(endTag);
 	numNotif = data.substring(index1,index2);
 	
 	 /*if(numNotif!='0')
 	   {
 		jQuery('#notificatinsLink').addClass('myTextBold');
 	   }
 	   else
 	   {
 	   	 jQuery('#notificatinsLink').removeClass('myTextBold');
 	   }*/
 	   
 		document.getElementById('NewNotificationsMsg').innerHTML=numNotif;
 		
 		 });

 }
 
 /*
function to wrap a string
*/
function wordwrap(str,strlen)
{
	//alert(str.length);
	strlen = parseInt(strlen);
	var tmp_str,i;
	var wrap_str = '';
	if(str.len < strlen)
		return str;
	else
	{
		for(i=0;i<str.length;i++)
		{
			if(i%strlen == 0)
			{
				tmp_str = str.slice(i,i+strlen);
				
				wrap_str += tmp_str;
				wrap_str += "<br/>";
			}
			
		}
		
		return wrap_str;
	}
}

/* common function for calling ajax calls */ 
   function ajaxContentLoad(urlCall , htmlDiv)
   {	jQuery.ajax({
		type: "POST",
		url: base_url+urlCall,
		data: "",
		success: function(msg)
		{ if(msg!="")
		  { //alert(msg);
			jQuery('#'+htmlDiv).show();
			jQuery('#'+htmlDiv).html(msg);
			
		  }
		}
	});
			
   }


/** Word wrap applicable only for plain text. It might not be accurate, if the text contains html tags **/
function _wordwrap(str,width,brkChar){

	if(!width) width = 72;
	if(!brkChar) brkChar = ' ';

        var strlen = str.length;
        if( strlen <= width ) {
                return str;
        }

        var retString = '';
        var strParts = str.split(' ');
	var totalStrParts = strParts.length;
	for(var i = 0; i < totalStrParts; i++){
                var partLen = strParts[i].length;
                if( partLen > width && strParts[i].indexOf(' ') == -1 ){
                        var currentPos = 0;
                        var temp_strParts = '';
                        while( currentPos < partLen ){
                                temp_strParts+= strParts[i].substr(currentPos,width) + brkChar;
                                currentPos+= width;
                        }
                        retString+= temp_strParts+' ';
                }
                else{
                        retString+= strParts[i]+' ';
                }
        }

        return retString;
}

/*  ends here */



// function to truncate a string.
function truncateMe(str,start,len){
if(str && str.length > len)
return str.substr(start,(len-3))+'...';

return str;
}



	// Set up my regular expressions that will match the HTML tags and attributes that I want to allow
var reAllowedAttributes = /^(face|size|style|dir|color|id|class|alignment|align|valign|rowspan|colspan|width|height|background|cellpadding|border|href|src|target|alt|title)$/i;
var reAllowedHTMLTags = /^(h1|h2|a|b|em|li|ol|p|pre|strong|ul|font|span|div|u|sub|sup|table|tbody|blockquote|tr|td)$/i;

function ParseHTML(theHTML){
// Start of with a test to match all HTML tags and a group for the tag name which we pass in as an extra parameter
theHTML = theHTML.replace(/<[/]?([^> ]+)[^>]*>/g, function(match,HTMLTag)
{
// if the HTML tag does not match our list of allowed tags return empty string which will be used as a
// a replacement for the pattern in our inital test.
if(!reAllowedHTMLTags.test(HTMLTag)){
return "";
}else{
// The HTML tag is allowed so check attributes with the tag

// Certain attributes are allowed so we do another replace statement looking for attributes and using another
// function for the replacement value.
match = match.replace(/([^=]+)="[^"]*"/g, function(match2, attributeName)
{
// If the attribute matches our list of allowed attributes we return the whole match string
// so we replace our match with itself basically allowing the attribute.
if(reAllowedAttributes.test(attributeName)){
return match2;
}else{
return match2;  // not allowed so return blank string to wipe out the attribute value pair
}
});

}
return match;

}); //end of the first replace

//return our cleaned HTML
return theHTML;
}

function addSelClass(el){
        jQuery(el).addClass('myThemeSelBg');
}

function removeSelClass(el){
        jQuery(el).removeClass('myThemeSelBg');
}


 function onChangeEmailClick( caller ) {
try { 
var prepend = '';

if( caller != "D" ) {
    prepend = 'O';
}


    var new_email = jQuery(  "#" + prepend + "strNewEMailId" ).val();

jQuery( "#"+ prepend + "errMsg" ).hide();


    var uId       = jQuery( "#" + prepend + "uId" ).val();
    var old_email = jQuery( "#" + prepend + "email" ).val();
    var prev_html = jQuery( "#" + prepend + "msgBlock" ).html();

    var pubNo = jQuery( "#" + prepend + "pubNo" ).val();
    var sec_code = jQuery( "#" + prepend + "security_code" ).val();

sec_code = trim( sec_code );
new_email = trim( new_email );

    







if( new_email == '' ) {
        // jQuery( "#msgBlock" ).html( prev_html );
        jQuery( "#" + prepend + "errMsg" ).text( "Please enter your new Email Id" );
        jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#" + prepend + "strNewEMailId" ).focus();
        jQuery( "#"+ prepend + "strNewEMailId" ).val( ''); //select();
        return false;
    }

    // case: entered email is not a valid one
   /* var email_pattern = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
    if( !email_pattern.test( new_email ) ) {
        jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#" + prepend + "errMsg" ).text( "Please enter an valid Email Id" );
        jQuery ( "#" + prepend + "strNewEMailId").focus();
        jQuery( "#" + prepend + "strNewEMailId" ).select();
        return false;
    }*/
    
    
	var eExp =/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	m = eExp.test(new_email);
	if(!m)
	{
		 jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#" + prepend + "errMsg" ).text( "Please enter an valid Email Id" );
        jQuery ( "#" + prepend + "strNewEMailId").focus();
        jQuery( "#" + prepend + "strNewEMailId" ).select();
        return false;
	}
	
	
	
 // case: old email is entered
   if( new_email == old_email ) {
        jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#" + prepend + "errMsg" ).text( "Please enter a new email Id" );
        jQuery ( "#" + prepend + "strNewEMailId").focus();
        jQuery( "#" + prepend + "strNewEMailId" ).select();
        return false;
   }

   // case: ibibo mail id is entered
   if( new_email.indexOf( "ibibo.com" ) > 1 ) {
        jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#" + prepend + "errMsg" ).text( "You can not use your ibibo mail id. Please give some other email Id" );
        jQuery ( "#" + prepend + "strNewEMailId").focus();
        jQuery( "#" + prepend + "strNewEMailId" ).select();
        return false;

   }

  /*if( captcha_ret == 0 ) {
      jQuery( "#errMsg" ).show();
      jQuery( "#errMsg" ).text( "Please enter the correct text in the adjacent given box" );
      jQuery( "#security_code" ).focus();
      return false;
  } */

 if( sec_code == '' ) {
  jQuery( "#" + prepend + "errMsg" ).text( "Please enter the text in the adjacent box" );
        jQuery( "#" + prepend + "errMsg" ).show();
        jQuery( "#"+prepend +"security_code" ).focus();
jQuery( "#"+prepend  + "security_code" ).val( "" );
        return false;

    }


    jQuery( "#" + prepend + "errMsg" ).hide();
 // after successful validation
    jQuery( "#" + prepend + "msgBlock" ).html( '<div class="myTextCenter myPULoader" id = "divLoader" name = "divLoader"><img src="'+base_url+'images/load.gif" alt="Loader" /><br /><br /><span>Please wait - We are sending you the confirmation mail</span></div>' );

    // case: valid data, then post the data to the respective server side script
    jQuery.ajax({
        type: "POST",
        url: base_url+"emailverification/changeEmail/",
        data: "uId="+selfUId+"&email="+new_email+"&check_captcha=1&pubNo="+pubNo+"&secCode="+sec_code,
        success: function( msg ) {

            if( msg != "" && msg == 1  ) {
                msg = msg.replace( /^\s+|\s+$/g,"");
                jQuery( "#" + prepend + "msgBlock" ).html(prev_html);
                jQuery( "#" + prepend + "updateMsg" ).html ( "Please find this mail in your mailbox and click on the link in the email to verify your email id and update the same with us." );
                jQuery( "#" + prepend + "emailTBConfd" ).html ( new_email );
                  jQuery( "#" + prepend + "errMsg" ).hide();
jQuery( "#" + prepend + "strNewEMailId" ).val( '');
jQuery( "#" + prepend + "security_code" ).val( '' );
onGetDiffOne();

            }
 else {
                if( msg == 0  ) {
                jQuery( "#" + prepend + "msgBlock" ).html( prev_html );
                 jQuery( "#" + prepend + "errMsg" ).show();
                  jQuery( '#' + prepend + 'errMsg' ).text( "Sorry! Try to change your email later" );
                  return false;
}
                if( msg == -2 )  {
                 jQuery( "#" + prepend + "msgBlock" ).html( prev_html );
jQuery( "#" + prepend + "captchaImg" ).attr( "src", '' );

                 jQuery( "#"+ prepend + "errMsg" ).show();
                 jQuery( "#" + prepend + "errMsg" ).text( "Please enter the correct characters in the adjacent box" ); jQuery( "#" + prepend + "security_code" ).focus();jQuery( "#" + prepend + "security_code" ).select();
                 jQuery( "#" + prepend + "captchaImg" ).attr( "src", base_url+ "emailverification/getCaptcha/"+ Math.floor(Math.random()*1001)+  "/" + pubNo   );
                 jQuery( "#"+ prepend + "strNewEMailId" ).val( new_email );
                 return false;
                }
                if( msg == -3 ) {
                // jQuery( "#msgBlock" ).html( prev_html );
                 jQuery(  "#"+ prepend + "errMsg" ).show();
                 var err_msg  = "Please enter a valid Email Id";
                 jQuery( "#"+ prepend + "errMsg" ).html( err_msg );
                 return false;

            }
                if( msg == -1 ) {
                 jQuery( "#" + prepend + "msgBlock" ).html( prev_html );
                 jQuery( "#" + prepend + "errMsg" ).show();
                 var err_msg  = new_email + " is associated with an existing account. Please use the different one";
                 jQuery( "#" + prepend + "errMsg" ).html( err_msg );
                 return false;

            }
}
        }
    });
}
catch( err ) {

}
}

// function used to verify the captcha
function checkCaptcha( caller ) {

 var prepend = '';
if( caller != "D" ) {
    prepend = 'O';
}

  var pubNo = jQuery( "#" + prepend + "pubNo" ).val();
  var sec_code = jQuery( "#" + prepend + "security_code" ).val();
    var prev_html = jQuery( "#" + prepend + "msgBlock" ).html();

 if( sec_code == '' ) {
     var err_msg = "Please enter the correct text in the adjacent box";
    jQuery( "#"+ prepend + "msgBlock" ).html( prev_html );
    jQuery( "#" + prepend + "errMsg" ).show();
    jQuery( "#" + prepend + "errMsg" ).html( err_msg );
    jQuery( "#" + prepend + "secutiry_code" ).focus();
    return false;
 }

 else {
     // case: valid data, then post the data to the respective server side script
    jQuery.ajax({
        type: "POST",
        url: base_url+"emailverification/checkCaptcha/",
        data: "pubNo="+pubNo+"&secCode="+sec_code,
        success: function( msg ) {

            if( msg != "" && msg == 1  ) {
                return 1;
            }
            else {
               return 0;
            }
        }
    });

 }
}

function onResendConfEmailClick( caller ) {

   try { 

var prepend = "";
if( caller != "D" ) {
    prepend = 'O';
}
    var uId =  jQuery( "#" + prepend + "uId" ).val();
    var email = jQuery( "#" + prepend + "emailTBConfd" ).text( );

//jQuery ( "#email" ).val();
    var prev_html = jQuery( "#" + prepend + "msgBlock" ).html();
 jQuery( "#" + prepend + "msgBlock").html( '<div class="myTextCenter myPULoader" id = "divLoader" name = "divLoader"><img src="'+base_url+'images/load.gif" alt="Loader" /><br /><br /><span>Please wait - We are sending you the confirmation mail</span></div>' );

jQuery.ajax({
        type: "POST",
        url: base_url+"emailverification/sendEmailConfirmation/",
        data: "uId="+uId+"&email="+email,
        success: function( msg ) {
            if( msg!= "" && msg != 0 ) {
                jQuery( "#" + prepend + "msgBlock" ).html( prev_html );
                jQuery( "#" + prepend + "errMsg" ).hide();

            }
            else {
                // getPUMsg( "Sorry! Try to resend your confirmation email later", "myPUError" );
            }
        }
    });
}catch( err ) {
}
}



function onGetDiffOne( caller ) {
    try { 

        if( caller == "D" ) { 
            var pubNo = jQuery( "#pubNo" ).val();
            var img_src = base_url + "emailverification/getCaptcha/" +  Math.floor(Math.random()*1001)+  "/" + pubNo + "/1" ;
            jQuery( "#captchaImg" ).attr( "src", img_src );
        }
        else {
            var pubNo = jQuery( "#OpubNo" ).val();
            var img_src = base_url + "emailverification/getCaptcha/" +  Math.floor(Math.random()*1001)+  "/" + pubNo + "/1" ;
            jQuery( "#OcaptchaImg" ).attr( "src", img_src );

           
        }
    }catch( err ) {
    }

}

function  onVerifyClick( caller  ) {

 var prepend = '';
 
  if( caller != "D" ) {
      prepend = "O";
  }

     
  var uId =  jQuery ( "#" + prepend + "uId" ).val();
  var email = jQuery( "#" + prepend + "email" ).val();

if( caller == "D"  )  jQuery( "#verifyLnk" ).removeAttr( "onClick" );
else  jQuery( "#OverifyLnk" ).removeAttr( "onClick" );

jQuery.ajax({
        type: "POST",
        url: base_url+"emailverification/sendEmailConfirmation/",
        data: "uId="+uId+"&email="+email,
        success: function( msg ) {
            if( msg!= "" && msg != 0 ) {
                         if( jQuery( "#"+prepend + "emailTBConfd" ).text() != email ) {
                             jQuery( "#" + prepend + "emailTBConfd" ).text( email );
                         }
                        jQuery("#"+prepend + "verifyEmailBlock").slideToggle("slow");

            }
            else {
         if( jQuery( "#" + prepend + "emailTBConfd" ).text() != email ) {
                             jQuery( "#" + prepend + "emailTBConfd" ).text( email );
                         }
                jQuery( "#" + prepend + "verifyEmailBlock" ).slideToggle( "slow" );
                jQuery( "#" + prepend + "msgBlock" ).text( "Sorry! Try to resend your verification email later" );
            }
        }
    });
}

function hideVerifyEmailBlock( caller ) {
    if( caller == "D" )   { 
        jQuery( '#verifyLnk' ).bind( 'click', { call: caller }, bindVerifyClick );
        jQuery( "#verifyEmailBlock").hide("fast");
    }

    else {
       jQuery( '#OverifyLnk' ).bind( 'click', {call: caller }, bindVerifyClick );
        jQuery( "#OverifyEmailBlock").hide("fast");

    } 
}


function bindVerifyClick( event  ) {
    onVerifyClick( event.data.call );
}

var email_target_url;

// function used to render the emailverification block
function renderEmailVerificationBlock( obj, url ) {

    try{ 
var curr_url = window.location.href;
var encoded_url = encodeURIComponent( curr_url );
if( selfUId == '' ) {
  window.location.href = 'http://myaccount.ibibo.com/auth/RegistrationStart.aspx?x=&surl='+ encoded_url;
 return false;

}
	email_target_url = (url) ? url : obj.href;

        jQuery.ajax({
            type: "POST",
            url: base_url+"dashboard/renderEmailVerificationMod", 
            data: "others=1", 
            success: function( msg ) {
            if( msg != "" && msg != 0 ) {
                changePUWidth(630);
            	setPUBody( msg );
                setPUTitle( 'Verify Your Email Id');
                hidePUClose();
                showPU();
            }
            else {
                window.location.href = email_target_url;
            }
        }
    });
    
    var getCaptch = setTimeout('onGetDiffOne()', 500);
	setTimeout('clearCaptchTO()', 550);	
    
    return false;
  } catch( err ) { }
}

function clearCaptchTO(){ clearTimeout(getCaptch); }

function onSkipNow() {
   hidePU();
   window.location.href = email_target_url; 
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}


/// Declare variable required for phone validation
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkPhoneNumber(strPhone){
	var bracket=3;
	strPhone=trim(strPhone);
	if(strPhone.indexOf("+")>1) return false;
	if(strPhone.indexOf("-")!=-1)bracket=bracket+1;
	if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false;
	var brchr=strPhone.indexOf("(");
	if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false;
	if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false;
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

// function used for user call out tips

//var maxStep = 7;
var tipTime;
jQuery(document).ready(function(){   
    if(maxStepCnt!=0)
    {
	var nuRnd = Math.floor(Math.random()*maxStepCnt)+1;
    nuStepOpen(nuRnd);
    tipTime = setTimeout("nuStepClose('"+nuRnd+"','nocookie')", 5000);
    }
    
});

function nuStepClose(id,cookieflag){ 
	
	tip = '#'+tipPage+id; jQuery(tip).hide();
	if(cookieflag != 'nocookie'){
   	 SetCookie('calloutclose','true');
	}
}
function nuStepOpen(id){ tip = '#'+tipPage+id; jQuery(tip).show(); }
function nextTip(id){
	tip = '#'+tipPage+id;
	jQuery(tip).fadeOut('slow');
	if(id == maxStepCnt){ id=0; }
	id += 1; tip = '#'+tipPage+id;	
	jQuery(tip).fadeIn('slow');
	clearTimeout(tipTime);	
}

function setDefAvatar(elm){ elm.src="http://my.ibibo.com/images/default_avatar_48.gif"; }

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)+ ";expires=''";
                 
// alert(document.cookie);;
}

/* common function for calling ajax calls */ 
function delinkGmail()
   {	jQuery.ajax({
		type: "POST",
		url: base_url+"settings/delinkGmail",
		data: "",
		success: function(msg)
		{ 
			jQuery('#openGmail').show();
			jQuery('#successGmail').hide();
			
		}
	});
			
   }
  